com.silverpeas.subscribe.service
Class AbstractResourceSubscriptionService

java.lang.Object
  extended by com.silverpeas.subscribe.service.AbstractResourceSubscriptionService
All Implemented Interfaces:
ResourceSubscriptionService
Direct Known Subclasses:
DefaultResourceSubscriptionService

public abstract class AbstractResourceSubscriptionService
extends Object
implements ResourceSubscriptionService

Author:
Yohann Chastagnier

Constructor Summary
AbstractResourceSubscriptionService()
           
 
Method Summary
protected abstract  String getHandledComponentName()
          Gets the name of the component that the implementation handles.
protected  NodeBm getNodeBm()
           
 SubscriptionSubscriberList getSubscribersOfComponent(String componentInstanceId)
          Gets all subscribers registered on a component.
 SubscriptionSubscriberList getSubscribersOfComponentAndTypedResource(String componentInstanceId, SubscriptionResourceType resourceType, String resourceId)
          Gets all subscribers concerned by a specified resource represented by the given resource type and identifier.
 SubscriptionSubscriberList getSubscribersOfSubscriptionResource(SubscriptionResource subscriptionResource)
          Gets all subscribers concerned by a specified subscription resource.
protected  void register()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceSubscriptionService

public AbstractResourceSubscriptionService()
Method Detail

register

@PostConstruct
protected final void register()

getHandledComponentName

protected abstract String getHandledComponentName()
Gets the name of the component that the implementation handles.

Returns:
the name of the component handled by the implementation.

getSubscribersOfComponent

public SubscriptionSubscriberList getSubscribersOfComponent(String componentInstanceId)
Description copied from interface: ResourceSubscriptionService
Gets all subscribers registered on a component.
This service does not look at resources handled by the component but just explicit component subscriptions.

Specified by:
getSubscribersOfComponent in interface ResourceSubscriptionService
Parameters:
componentInstanceId - the identifier of the component instance from which subscription are requested.
Returns:
an instance of SubscriptionSubscriberList that represents a collection of SubscriptionSubscriber decorated with useful tool methods.

getSubscribersOfSubscriptionResource

public SubscriptionSubscriberList getSubscribersOfSubscriptionResource(SubscriptionResource subscriptionResource)
Description copied from interface: ResourceSubscriptionService
Gets all subscribers concerned by a specified subscription resource.
The inheritance of subscription is handled by this method. So if the aimed subscription resource has a parent subscription resource, subscribers of both of them are returned.

Specified by:
getSubscribersOfSubscriptionResource in interface ResourceSubscriptionService
Parameters:
subscriptionResource - the instance of subscription resource.
Returns:
an instance of SubscriptionSubscriberList that represents a collection of SubscriptionSubscriber decorated with useful tool methods.

getSubscribersOfComponentAndTypedResource

public SubscriptionSubscriberList getSubscribersOfComponentAndTypedResource(String componentInstanceId,
                                                                            SubscriptionResourceType resourceType,
                                                                            String resourceId)
Description copied from interface: ResourceSubscriptionService
Gets all subscribers concerned by a specified resource represented by the given resource type and identifier.
The inheritance of subscription is handled by this method. So if the aimed subscription resource has a parent subscription resource, subscribers of both of them are returned.

Specified by:
getSubscribersOfComponentAndTypedResource in interface ResourceSubscriptionService
Parameters:
componentInstanceId - the identifier of the component instance from which subscription are requested.
resourceType - the type of the aimed resource.
resourceId - the identifier of the aime resource.
Returns:
an instance of SubscriptionSubscriberList that represents a collection of SubscriptionSubscriber decorated with useful tool methods.

getNodeBm

protected NodeBm getNodeBm()


Copyright © 2016 Silverpeas. All Rights Reserved.