Class ElementEvent
- java.lang.Object
-
- nl.gx.webmanager.contentapi.event.ElementEvent
-
- All Implemented Interfaces:
EntityEvent
,Event
public class ElementEvent extends Object implements EntityEvent
This class represents an element event posted by the element service to allow all subscribers to this event to do something with that information. This may be updating timestamps, updating a search index, etc.- Author:
- ivol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface nl.gx.webmanager.services.event.Event
Event.Type
-
-
Constructor Summary
Constructors Constructor Description ElementEvent(Event.Type eventType, Element element, String eventAction, Object source)
Constructor of the element event.ElementEvent(Event.Type eventType, Element element, String eventAction, Object source, Class<? extends Element> scope)
Constructor of the element event.ElementEvent(Event.Type eventType, Element element, Element originalElement, String eventAction, Object source)
Constructor of the element event.ElementEvent(Event.Type eventType, Element element, Element originalElement, String eventAction, Object source, Class<? extends Element> scope)
Constructor of the element event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Element
getElement()
Returns the element associated with this event.Object
getEntity()
Return the (new) entity on which the action was performed.String
getEventAction()
Returns the action that has been performedEvent.Type
getEventType()
Type of event notification.Element
getOriginalElement()
Returns the original element associated with this event.Class<?>
getScope()
The scope of the object on which the action is performed.Object
getSource()
Returns the object that published the eventString
toString()
Returns String representing information on the event
-
-
-
Constructor Detail
-
ElementEvent
public ElementEvent(Event.Type eventType, Element element, String eventAction, Object source)
Constructor of the element event.- Parameters:
eventType
- The event type which can be either PRE or POST.element
- The element which is the result of the performed action.eventAction
- Event action, seeEntityEvent
.source
- The source object on which the event was published.
-
ElementEvent
public ElementEvent(Event.Type eventType, Element element, Element originalElement, String eventAction, Object source)
Constructor of the element event.- Parameters:
eventType
- The event type which can be either PRE or POST.element
- The element which is the result of the performed action.originalElement
- The element on which the action is performed. Useful in combination withEntityEvent.COPY
where element is not the same as original element.eventAction
- Event action, seeEntityEvent
.source
- The source object on which the event was published.
-
ElementEvent
public ElementEvent(Event.Type eventType, Element element, String eventAction, Object source, Class<? extends Element> scope)
Constructor of the element event.- Parameters:
eventType
- The event type which can be either PRE or POST.element
- The element which is the result of the performed action.eventAction
- Event action, seeEntityEvent
.source
- The source object on which the event was published.scope
- Scope of the event.
-
ElementEvent
public ElementEvent(Event.Type eventType, Element element, Element originalElement, String eventAction, Object source, Class<? extends Element> scope)
Constructor of the element event.- Parameters:
eventType
- The event type which can be either PRE or POST.element
- The element which is the result of the performed action.originalElement
- The element on which the action is performed. Useful in combination withEntityEvent.COPY
where element is not the same as original element.eventAction
- Event action, seeEntityEvent
.source
- The source object on which the event was published.scope
- Scope of the event.
-
-
Method Detail
-
getElement
public Element getElement()
Returns the element associated with this event.- Returns:
- element associated with this event.
-
getOriginalElement
public Element getOriginalElement()
Returns the original element associated with this event.- Returns:
- element associated with this event.
-
getEntity
public Object getEntity()
Description copied from interface:EntityEvent
Return the (new) entity on which the action was performed.- Specified by:
getEntity
in interfaceEntityEvent
- Returns:
- get the entity this event refers to.
-
getEventAction
public String getEventAction()
Description copied from interface:Event
Returns the action that has been performed- Specified by:
getEventAction
in interfaceEvent
- Returns:
- the action that has been performed.
-
getEventType
public Event.Type getEventType()
Description copied from interface:Event
Type of event notification. This can be either PRE or POST. A PRE event is thrown just before the action is performed, a POST event immediately after.- Specified by:
getEventType
in interfaceEvent
- Returns:
- type of event notification.
-
getScope
public Class<?> getScope()
Description copied from interface:Event
The scope of the object on which the action is performed. The scope indicates the object's type indicated by its Class
-
getSource
public Object getSource()
Description copied from interface:Event
Returns the object that published the event
-
-