Class DefaultEventType

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.repository.events.DefaultEventType
All Implemented Interfaces:
EventType, LogEnabled, PluginAware, Configurable, Serviceable
Direct Known Subclasses:
WorkspacesEventType

Default implementation for EventType storing event in JCR
  • Field Details

  • Constructor Details

  • Method Details

    • setPluginInfo

      public void setPluginInfo(String pluginName, String featureName, String id)
      Description copied from interface: PluginAware
      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.
      Specified by:
      setPluginInfo in interface PluginAware
      Parameters:
      pluginName - Unique identifier for the plugin hosting the extension
      featureName - Unique feature identifier (unique for a given pluginName)
      id - Unique identifier of this component
    • configure

      public void configure(Configuration configuration) throws ConfigurationException
      Specified by:
      configure in interface Configurable
      Throws:
      ConfigurationException
    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getSupportedTypes

      Description copied from interface: EventType
      Get the ids of the supported event types
      Specified by:
      getSupportedTypes in interface EventType
      Returns:
      the ids of the supported event types
    • storeEvent

      public javax.jcr.Node storeEvent(String eventId, Map<String,Object> parameters, EventHolder eventHolder) throws javax.jcr.RepositoryException
      Description copied from interface: EventType
      Store an event with the given event id under the given event holder node
      Specified by:
      storeEvent in interface EventType
      Parameters:
      eventId - the id of the event to store
      parameters - the event parameters
      eventHolder - the event holder
      Returns:
      the stored node
      Throws:
      javax.jcr.RepositoryException - if an error occurs while manipulating the repository
    • storeAdditionalEventData

      protected void storeAdditionalEventData(javax.jcr.Node eventNode, Map<String,Object> parameters) throws javax.jcr.RepositoryException
      Store additional data on event
      Parameters:
      eventNode - The event node
      parameters - The event's parameters
      Throws:
      javax.jcr.RepositoryException - if an error occurred
    • event2JSON

      public Map<String,Object> event2JSON(javax.jcr.Node eventNode) throws javax.jcr.RepositoryException
      Description copied from interface: EventType
      Format an event node to JSON
      Specified by:
      event2JSON in interface EventType
      Parameters:
      eventNode - the node of an event
      Returns:
      the JSON for the node
      Throws:
      javax.jcr.RepositoryException - if an error occurs while manipulating the repository
    • _getAuthor

      protected UserIdentity _getAuthor(javax.jcr.Node eventNode) throws javax.jcr.RepositoryException
      Gets the identity of the author of the given event
      Parameters:
      eventNode - The node of the event
      Returns:
      the identity of the author of the given event
      Throws:
      javax.jcr.RepositoryException - if an error occurs while manipulating the repository
    • isMergeable

      public boolean isMergeable(Map<String,Object> event1, Map<String,Object> event2)
      Description copied from interface: EventType
      Determines if two events can be merged
      Specified by:
      isMergeable in interface EventType
      Parameters:
      event1 - The first event
      event2 - The second event
      Returns:
      true if the events can be merged
    • mergeEvents

      Description copied from interface: EventType
      Merge events into one event. Be careful : be sure that the events can be merged calling isMergeable method before
      Specified by:
      mergeEvents in interface EventType
      Parameters:
      events - The events to merge
      Returns:
      Merged event