Package org.silverpeas.core.subscription
Class AbstractProfiledResourceSubscriptionListener<R extends Serializable,T extends ResourceEvent<R>>
- java.lang.Object
-
- org.silverpeas.core.notification.system.CDIResourceEventListener<T>
-
- org.silverpeas.core.subscription.AbstractProfiledResourceSubscriptionListener<R,T>
-
- All Implemented Interfaces:
ResourceEventListener<T>
- Direct Known Subclasses:
SubscriptionCalendarEventListener
,SubscriptionComponentInstEventListener
,SubscriptionNodeEventListener
,SubscriptionPublicationEventListener
public abstract class AbstractProfiledResourceSubscriptionListener<R extends Serializable,T extends ResourceEvent<R>> extends CDIResourceEventListener<T>
Abstract listener of events to remove all the subscriptions on a deleted resource or on a resource for which the subscription feature is disabled. It does really the unsubscription and delegates the getting of the subscription resource to the concrete implementors.- Author:
- mmoquillon
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.notification.system.CDIResourceEventListener
logger
-
-
Constructor Summary
Constructors Constructor Description AbstractProfiledResourceSubscriptionListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract SubscriptionResource
getSubscriptionResource(R resource)
protected SubscriptionService
getSubscriptionService()
protected abstract boolean
isSubscriptionEnabled(R resource)
void
onDeletion(T event)
An event on the deletion of a resource has be listened.void
onUpdate(T event)
An event on the update of a resource has be listened.-
Methods inherited from class org.silverpeas.core.notification.system.CDIResourceEventListener
onEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.notification.system.ResourceEventListener
dispatchEvent, isEnabled, onCreation, onMove, onRecovery, onRemoving, onUnlock
-
-
-
-
Method Detail
-
onDeletion
public void onDeletion(T event) throws Exception
Description copied from interface:ResourceEventListener
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.
-
onUpdate
public void onUpdate(T event) throws Exception
Description copied from interface:ResourceEventListener
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.
-
getSubscriptionService
protected SubscriptionService getSubscriptionService()
-
getSubscriptionResource
protected abstract SubscriptionResource getSubscriptionResource(R resource)
-
isSubscriptionEnabled
protected abstract boolean isSubscriptionEnabled(R resource)
-
-