Class EventHandler

java.lang.Object
org.nuxeo.ecm.automation.core.events.EventHandler

public class EventHandler extends Object
Author:
Bogdan Stefanescu
  • Field Details

    • id

      protected String id
      Since:
      2021.16
    • chainId

      protected String chainId
    • isPostCommit

      protected boolean isPostCommit
    • events

      protected Set<String> events
    • doctypes

      protected Set<String> doctypes
    • facet

      protected String facet
    • lifeCycle

      protected String[] lifeCycle
    • pathStartsWith

      protected String pathStartsWith
    • attribute

      protected Filter attribute
    • memberOf

      protected List<String> memberOf
      the principal should be member of at least one of the groups. OR is used
    • isAdministrator

      protected Boolean isAdministrator
    • condition

      protected String condition
      Since:
      5.7: added to replace the 'expression' element as its evaluation is inverted
    • enabled

      protected boolean enabled
      Since:
      2021.16
  • Constructor Details

    • EventHandler

      public EventHandler()
    • EventHandler

      public EventHandler(String eventId, String chainId)
    • EventHandler

      public EventHandler(Set<String> eventId, String chainId)
  • Method Details

    • setLifeCycleExpr

      protected void setLifeCycleExpr(String lifeCycles)
    • setAttribute

      public void setAttribute(String attribute)
    • _setCondition

      protected void _setCondition(String expr)
    • convertExpr

      protected String convertExpr(String expr)
    • getEvents

      public Set<String> getEvents()
    • getId

      public String getId()
    • getChainId

      public String getChainId()
    • setPostCommit

      public void setPostCommit(boolean isPostCommit)
    • isPostCommit

      public boolean isPostCommit()
    • setAttributeFilter

      public void setAttributeFilter(Filter attribute)
    • setIsAdministrator

      public void setIsAdministrator(Boolean isAdministrator)
    • setMemberOf

      public void setMemberOf(List<String> groups)
    • setPathStartsWith

      public void setPathStartsWith(String pathStartsWith)
    • setDoctypes

      public void setDoctypes(Set<String> doctypes)
    • setFacet

      public void setFacet(String facet)
    • setLifeCycle

      public void setLifeCycle(String[] lifeCycle)
    • setChainId

      public void setChainId(String chainId)
    • getCondition

      public String getCondition()
      Condition to define on event handler
      Since:
      5.7
    • setCondition

      public void setCondition(String condition)
      Since:
      5.9.1
    • getFacet

      public String getFacet()
    • getAttribute

      public Filter getAttribute()
    • getLifeCycle

      public String[] getLifeCycle()
    • getMemberOf

      public List<String> getMemberOf()
    • getIsAdministrator

      public Boolean getIsAdministrator()
    • getPathStartsWith

      public String getPathStartsWith()
    • getDoctypes

      public Set<String> getDoctypes()
    • isEnabled

      public boolean isEnabled()
    • isEnabled

      public boolean isEnabled(OperationContext ctx, EventContext eventCtx, boolean quick)
      Checks if this handler should run for the event and operation context.
      Parameters:
      quick - If true, then this method may not check all filter parameters like filter/expression and just return true to avoid costly evaluations on ShallowDocumentModel instances
    • clone

      public EventHandler clone()
      Overrides:
      clone in class Object
      Since:
      2021.16
    • merge

      public void merge(EventHandler other)
      Since:
      2021.16
    • mergeCollections

      protected <C extends Collection<V>, V> C mergeCollections(C collection, C otherCollection, C newCollection)