public class DefaultEventType extends AbstractLogEnabled implements Configurable, EventType, Serviceable, PluginAware
EventType
storing event in JCRModifier and Type | Field and Description |
---|---|
private static int |
__MAX_MERGE_EVENT_RANGE
The default time range to merge compatible events : 5 minutes
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
private String |
_pluginName |
private Map<String,I18nizableText> |
_supportedEventTypes |
protected UserHelper |
_userHelper
Helper to get users
|
EVENT_AUTHOR, EVENT_DATE, EVENT_TYPE
Constructor and Description |
---|
DefaultEventType() |
Modifier and Type | Method and Description |
---|---|
protected UserIdentity |
_getAuthor(Node eventNode)
Gets the identity of the author of the given event
|
void |
configure(Configuration configuration) |
Map<String,Object> |
event2JSON(Node eventNode)
Format an event node to JSON
|
Map<String,I18nizableText> |
getSupportedTypes()
Get the ids of the supported event types
|
boolean |
isMergeable(Map<String,Object> event1,
Map<String,Object> event2)
Determines if two events can be merged
|
Map<String,Object> |
mergeEvents(List<Map<String,Object>> events)
Merge events into one event.
|
void |
service(ServiceManager serviceManager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
protected void |
storeAdditionalEventData(Node eventNode,
Map<String,Object> parameters)
Store additional data on event
|
Node |
storeEvent(String eventId,
Map<String,Object> parameters,
EventHolder eventHolder)
Store an event with the given event id under the given event holder node
|
getLogger, setLogger
private static final int __MAX_MERGE_EVENT_RANGE
protected CurrentUserProvider _currentUserProvider
protected UserHelper _userHelper
private Map<String,I18nizableText> _supportedEventTypes
private String _pluginName
public DefaultEventType()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,I18nizableText> getSupportedTypes()
EventType
getSupportedTypes
in interface EventType
public Node storeEvent(String eventId, Map<String,Object> parameters, EventHolder eventHolder) throws RepositoryException
EventType
storeEvent
in interface EventType
eventId
- the id of the event to storeparameters
- the event parameterseventHolder
- the event holderRepositoryException
- if an error occurs while manipulating the repositoryprotected void storeAdditionalEventData(Node eventNode, Map<String,Object> parameters) throws RepositoryException
eventNode
- The event nodeparameters
- The event's parametersRepositoryException
- if an error occurredpublic Map<String,Object> event2JSON(Node eventNode) throws RepositoryException
EventType
event2JSON
in interface EventType
eventNode
- the node of an eventRepositoryException
- if an error occurs while manipulating the repositoryprotected UserIdentity _getAuthor(Node eventNode) throws RepositoryException
eventNode
- The node of the eventRepositoryException
- if an error occurs while manipulating the repositorypublic boolean isMergeable(Map<String,Object> event1, Map<String,Object> event2)
EventType
isMergeable
in interface EventType
event1
- The first eventevent2
- The second eventpublic Map<String,Object> mergeEvents(List<Map<String,Object>> events)
EventType
mergeEvents
in interface EventType
events
- The events to merge