Interface ResourceEventListener<T extends ResourceEvent<?>>
-
- All Known Implementing Classes:
AbstractNotifier
,AbstractProfiledResourceSubscriptionListener
,AbstractResourceEventListener
,AttachmentSharingListener
,AttachmentWebdavListener
,CalendarComponentNotifier
,CalendarEventNotifier
,CalendarEventOccurrenceNotifier
,CalendarUserEventListener
,CDIAfterSuccessfulTransactionResourceEventListener
,CDIResourceEventListener
,ChatGroupUserLinkEventListener
,ChatUserEventListener
,CommentUserNotificationService
,ContributionEventProcessor
,JMSResourceEventListener
,MyLinksUserEventListener
,NodeSharingListener
,NotificationUserEventListener
,PdcGroupEventListener
,PdcNodeEventListener
,PdcUserEventListener
,PersonalizationSpaceEventListener
,PublicationSharingListener
,PublicationTemplateUserEventListener
,RegistrationUserEventListener
,RelationShipListener
,ReplacementNotifier
,SocialNetworkUserListener
,SubscriptionCalendarEventListener
,SubscriptionComponentInstEventListener
,SubscriptionGroupEventListener
,SubscriptionNodeEventListener
,SubscriptionPublicationEventListener
,SubscriptionUserEventListener
,UserPreferenceEventListener
,UserPreferenceReminderListener
,UserReminderListener
public interface ResourceEventListener<T extends ResourceEvent<?>>
A resource event listener. This interface defines the common properties all listeners should implement. The event dispatching method is already implemented here so that the implementers have just to override one of the following method to perform their task:org.silverpeas.core.notification.system.ResourceEventListener#onCreation (ResourceEvent
to receive events about the creation of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onUpdate (ResourceEvent
to receive events about the update of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onRemoving (ResourceEvent
to receive events about the removing of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onDeletion (ResourceEvent
to receive events about the deletion of a resource,
- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
dispatchEvent(T event)
Dispatches the treatment of the specified event to the correct method according to its type:org.silverpeas.core.notification.system.ResourceEventListener#onCreation (ResourceEvent
for events about the creation of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onUpdate (ResourceEvent
for events about the update of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onRemoving (ResourceEvent
for events about the removing of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onDeletion (ResourceEvent
for events about the deletion of a resource,default boolean
isEnabled()
Is this listener enabled?default void
onCreation(T event)
An event on the creation of a resource has be listened.default void
onDeletion(T event)
An event on the deletion of a resource has be listened.default void
onMove(T event)
An event on the move of a resource has be listened.default void
onRecovery(T event)
An event on the recovery of a removed resource has be listened.default void
onRemoving(T event)
An event on the removing of a resource has be listened.default void
onUnlock(T event)
An event on the unlock of a resource has be listened.default void
onUpdate(T event)
An event on the update of a resource has be listened.
-
-
-
Method Detail
-
onDeletion
default void onDeletion(T event) throws Exception
An event on the deletion of a resource has be listened. A deleted resource is nonexistent and nonrecoverable. By default, this method does nothing.- Parameters:
event
- the event on the deletion of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onRemoving
default void onRemoving(T event) throws Exception
An event on the removing of a resource has be listened. A removed resource is again existent and it is recoverable; it is usually put in a trash. By default, this method does nothing.- Parameters:
event
- the event on the removing of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onRecovery
default void onRecovery(T event) throws Exception
An event on the recovery of a removed resource has be listened. By default, this method does nothing.- Parameters:
event
- the event on the removing of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onUpdate
default void onUpdate(T event) throws Exception
An event on the update of a resource has be listened. By default, this method does nothing.- Parameters:
event
- the event on the update of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onMove
default void onMove(T event) throws Exception
An event on the move of a resource has be listened. By default, this method does nothing.- Parameters:
event
- the event on the move of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onCreation
default void onCreation(T event) throws Exception
An event on the creation of a resource has be listened. By default, this method does nothing.- Parameters:
event
- the event on the creation of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
onUnlock
default void onUnlock(T event) throws Exception
An event on the unlock of a resource has be listened. By default, this method does nothing.- Parameters:
event
- the event on the unlock of a resource.- Throws:
Exception
- if an error occurs while treating the event.
-
dispatchEvent
default void dispatchEvent(T event) throws Exception
Dispatches the treatment of the specified event to the correct method according to its type:org.silverpeas.core.notification.system.ResourceEventListener#onCreation (ResourceEvent
for events about the creation of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onUpdate (ResourceEvent
for events about the update of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onRemoving (ResourceEvent
for events about the removing of a resource,org.silverpeas.core.notification.system.ResourceEventListener#onDeletion (ResourceEvent
for events about the deletion of a resource,
This method shouldn't be overridden as the dispatch mechanism is already implemented here.
- Parameters:
event
- the event to dispatch.- Throws:
Exception
- if an error occurs while treating the event.
-
isEnabled
default boolean isEnabled()
Is this listener enabled? When a listener is enabled, it processes then all the incoming events it listens for. Otherwise, nothing the event isn't consumed.By default, the listener is enabled. If the listener has to be enabled according to some conditions, then overrides this method.
- Returns:
- true if this listener has to consume the events it listens for. False otherwise. Returns true by default.
-
-