Interface ResourceEvent<T extends Serializable>
-
- Type Parameters:
T
- the type of the resource concerned by this event.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractResourceEvent
,AttachmentEvent
,AttendeeLifeCycleEvent
,CalendarEventLifeCycleEvent
,CalendarEventOccurrenceLifeCycleEvent
,CalendarLifeCycleEvent
,CommentEvent
,ComponentInstanceEvent
,GroupEvent
,GroupUserLinkEvent
,NodeEvent
,PublicationEvent
,RelationShipEvent
,ReplacementEvent
,SpaceEvent
,UserEvent
,UserPreferenceEvent
,WysiwygEvent
public interface ResourceEvent<T extends Serializable> extends Serializable
A notification event on the change of the state of a given resource in Silverpeas. The resource can be either a contribution, a content, an organizational object or any bean managed or handled by Silverpeas.This event is on a change of the state of a resource in Silverpeas. A such change can be a creation (the resource is spawn to life), an update, a removing, a deletion and so on. A change is then manifested by a transition between two states of the related resource. Hence, the event is characterized by a type that indicates the nature of the change occurring on the resource, and by the state transition of the resource implied by this change. This state transition carries an instance of the resource as it was before the change and an instance of the resource as it is actually.
- Author:
- mmoquillon
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ResourceEvent.Type
It defines the more common type of notification in use in Silverpeas.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StateTransition<T>
getTransition()
Gets the state transition implying by a change on the resource.ResourceEvent.Type
getType()
Gets the type of the event.default boolean
isOnCreation()
Is the event on the creation of a resource?default boolean
isOnDeletion()
Is the event on the deletion of a resource?default boolean
isOnRecovery()
Is the event on the recovery of a removed resource?default boolean
isOnRemoving()
Is the event on the removing of a resource?default boolean
isOnUpdate()
Is the event on the update of a resource?
-
-
-
Method Detail
-
getType
ResourceEvent.Type getType()
Gets the type of the event. The type of the event carries the cause: a creation, an update, a removing or a deletion of the related resource. It defines then the state in the life-cycle of the resource.- Returns:
- the type of the event (creation, update, deletion, ...)
-
getTransition
StateTransition<T> getTransition()
Gets the state transition implying by a change on the resource. The transition carries two instances of the resource: the resource before the change at the origin of this event, the the resource after the change has occurred. According to the type of the event, one of the state can be null or the two instances can be identical:- for a creation, the instance before the transition is null whereas the instance after the transition is the created resource,
- for an update, the instance before the transition is the resource before the update whereas the instance after the transition is the resource after the update,
- for a removing, the two instances are identical (as the resource is existent and recoverable),
- for a deletion, the instance before the transition is the resource whereas the instance after the deletion is null.
- Returns:
- a state transition with two instances of the resource related by this event: one being the resource before the change, the second being the resource after the change.
-
isOnCreation
default boolean isOnCreation()
Is the event on the creation of a resource?- Returns:
- true if the event is about a resource creation. False otherwise.
-
isOnUpdate
default boolean isOnUpdate()
Is the event on the update of a resource?- Returns:
- true if the event is about a resource update. False otherwise.
-
isOnRemoving
default boolean isOnRemoving()
Is the event on the removing of a resource?- Returns:
- true if the event is about a resource removing. False otherwise.
-
isOnDeletion
default boolean isOnDeletion()
Is the event on the deletion of a resource?- Returns:
- true if the event is about a resource deletion. False otherwise.
-
isOnRecovery
default boolean isOnRecovery()
Is the event on the recovery of a removed resource?- Returns:
- true if the event is about a resource recovery. False otherwise.
-
-