Class EventHandler
- java.lang.Object
-
- org.nuxeo.ecm.automation.core.events.EventHandler
-
public class EventHandler extends Object
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected Filter
attribute
protected String
chainId
protected String
condition
protected Set<String>
doctypes
protected boolean
enabled
protected Set<String>
events
protected String
facet
protected String
id
protected Boolean
isAdministrator
protected boolean
isPostCommit
protected String[]
lifeCycle
protected List<String>
memberOf
the principal should be member of at least one of the groups.protected String
pathStartsWith
-
Constructor Summary
Constructors Constructor Description EventHandler()
EventHandler(String eventId, String chainId)
EventHandler(Set<String> eventId, String chainId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_setCondition(String expr)
EventHandler
clone()
protected String
convertExpr(String expr)
Filter
getAttribute()
String
getChainId()
String
getCondition()
Condition to define on event handlerSet<String>
getDoctypes()
Set<String>
getEvents()
String
getFacet()
String
getId()
Boolean
getIsAdministrator()
String[]
getLifeCycle()
List<String>
getMemberOf()
String
getPathStartsWith()
boolean
isEnabled()
boolean
isEnabled(OperationContext ctx, EventContext eventCtx, boolean quick)
Checks if this handler should run for the event and operation context.boolean
isPostCommit()
void
merge(EventHandler other)
protected <C extends Collection<V>,V>
CmergeCollections(C collection, C otherCollection, C newCollection)
void
setAttribute(String attribute)
void
setAttributeFilter(Filter attribute)
void
setChainId(String chainId)
void
setCondition(String condition)
void
setDoctypes(Set<String> doctypes)
void
setFacet(String facet)
void
setIsAdministrator(Boolean isAdministrator)
void
setLifeCycle(String[] lifeCycle)
protected void
setLifeCycleExpr(String lifeCycles)
void
setMemberOf(List<String> groups)
void
setPathStartsWith(String pathStartsWith)
void
setPostCommit(boolean isPostCommit)
-
-
-
Field Detail
-
id
protected String id
- Since:
- 2021.16
-
chainId
protected String chainId
-
isPostCommit
protected boolean isPostCommit
-
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
-
-
Method Detail
-
setLifeCycleExpr
protected void setLifeCycleExpr(String lifeCycles)
-
setAttribute
public void setAttribute(String attribute)
-
_setCondition
protected void _setCondition(String expr)
-
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)
-
setPathStartsWith
public void setPathStartsWith(String pathStartsWith)
-
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()
-
getIsAdministrator
public Boolean getIsAdministrator()
-
getPathStartsWith
public String getPathStartsWith()
-
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
- Iftrue
, then this method may not check all filter parameters likefilter/expression
and just returntrue
to avoid costly evaluations onShallowDocumentModel
instances
-
clone
public EventHandler clone()
-
merge
public void merge(EventHandler other)
- Since:
- 2021.16
-
mergeCollections
protected <C extends Collection<V>,V> C mergeCollections(C collection, C otherCollection, C newCollection)
-
-