Package org.nuxeo.ecm.core.event.impl
Class AbstractEventContext
java.lang.Object
org.nuxeo.ecm.core.event.impl.AbstractEventContext
- All Implemented Interfaces:
Serializable,EventContext
- Direct Known Subclasses:
EventContextImpl
Base class to be used to create new context events.
This class handles context properties and event creation.
- Author:
- Bogdan Stefanescu
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor to be used by derived classesprotectedAbstractEventContext(Object... args) -
Method Summary
Modifier and TypeMethodDescriptionObject[]Gets event data.Gets the events properties.getProperty(String key) Gets the named property from this context or null if not exists.Returns the repository name associated to the event context, if any.booleanhasProperty(String key) Tests whether or not the given property exists.Creates a new event in that context given the event name.Creates a new event in that context given the event name.voidsetProperties(Map<String, Serializable> properties) Replaces all properties with the given ones.voidsetProperty(String key, Serializable value) Sets a event context propertyvoidsetRepositoryName(String repositoryName) Sets the repository name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.core.event.EventContext
getCoreSession, getPrincipal, setCoreSession, setPrincipal
-
Field Details
-
EMPTY
-
args
-
properties
-
repositoryName
-
-
Constructor Details
-
AbstractEventContext
protected AbstractEventContext()Constructor to be used by derived classes -
AbstractEventContext
-
-
Method Details
-
getArguments
Description copied from interface:EventContextGets event data. More objects can be associated with an event.For this reason an array of objects is returned. This array is usually representing the arguments of the operation that raised the event.
- Specified by:
getArgumentsin interfaceEventContext- Returns:
- the event data
-
getProperties
Description copied from interface:EventContextGets the events properties.Event properties are used to attach random information to an event context and can be set by the event source or by any listener that is processing the event. These properties usually serves to share data between the source and the listeners.
- Specified by:
getPropertiesin interfaceEventContext- Returns:
- the event properties
-
setProperties
Description copied from interface:EventContextReplaces all properties with the given ones. The given map is set as is - no copy occurs.- Specified by:
setPropertiesin interfaceEventContext- Parameters:
properties- the properties to use
-
getProperty
Description copied from interface:EventContextGets the named property from this context or null if not exists.- Specified by:
getPropertyin interfaceEventContext- Parameters:
key- the property key- Returns:
- the property, or null if it does not exist
-
hasProperty
Description copied from interface:EventContextTests whether or not the given property exists.- Specified by:
hasPropertyin interfaceEventContext- Parameters:
key- the property to test- Returns:
- true if the named property was set, false otherwise
-
setProperty
Description copied from interface:EventContextSets a event context property- Specified by:
setPropertyin interfaceEventContext- Parameters:
key- the property keyvalue- the property value
-
newEvent
Description copied from interface:EventContextCreates a new event in that context given the event name. The default flags for the event will be used.- Specified by:
newEventin interfaceEventContext- Parameters:
name- the event name- Returns:
- the event
- See Also:
-
newEvent
Description copied from interface:EventContextCreates a new event in that context given the event name. The given flags will be applied on the event.- Specified by:
newEventin interfaceEventContext- Parameters:
name- the event nameflags- the event flags to use- Returns:
- the event
-
getRepositoryName
Description copied from interface:EventContextReturns the repository name associated to the event context, if any.- Specified by:
getRepositoryNamein interfaceEventContext- Returns:
- the repository name
-
setRepositoryName
Description copied from interface:EventContextSets the repository name. Only used if no CoreSession is available.- Specified by:
setRepositoryNamein interfaceEventContext- Parameters:
repositoryName- the repository name, ornull
-