com.silverpeas.subscribe.service
Class ResourceSubscriptionProvider

java.lang.Object
  extended by com.silverpeas.subscribe.service.ResourceSubscriptionProvider

public class ResourceSubscriptionProvider
extends Object

This common subscription provider can return results from a default ResourceSubscriptionService implementations that compute basic operations or from an implementation provided by the component itself in order to compute a result that takes into account specific component rules.

Author:
Yohann Chastagnier

Constructor Summary
ResourceSubscriptionProvider()
           
 
Method Summary
static SubscriptionSubscriberList getSubscribersOfComponent(String componentInstanceId)
          Gets all subscribers registered on a component.
static SubscriptionSubscriberList getSubscribersOfComponentAndTypedResource(String componentInstanceId, SubscriptionResourceType resourceType, String resourceId)
          Gets all subscribers concerned by a specified resource represented by the given resource type and identifier.
static SubscriptionSubscriberList getSubscribersOfSubscriptionResource(SubscriptionResource subscriptionResource)
          Gets all subscribers concerned by a specified subscription resource.
static void registerResourceSubscriptionService(AbstractResourceSubscriptionService service)
          Registers a new implementation of ResourceSubscriptionService to manage and to provide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceSubscriptionProvider

public ResourceSubscriptionProvider()
Method Detail

registerResourceSubscriptionService

public static void registerResourceSubscriptionService(AbstractResourceSubscriptionService service)
Registers a new implementation of ResourceSubscriptionService to manage and to provide.

Parameters:
service - the service instance to register.

getSubscribersOfComponent

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

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.

getSubscribersOfComponentAndTypedResource

public static SubscriptionSubscriberList getSubscribersOfComponentAndTypedResource(String componentInstanceId,
                                                                                   SubscriptionResourceType resourceType,
                                                                                   String resourceId)
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.

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.

getSubscribersOfSubscriptionResource

public static SubscriptionSubscriberList getSubscribersOfSubscriptionResource(SubscriptionResource subscriptionResource)
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.

Parameters:
subscriptionResource - the instance of subscription resource.
Returns:
an instance of SubscriptionSubscriberList that represents a collection of SubscriptionSubscriber decorated with useful tool methods.


Copyright © 2016 Silverpeas. All Rights Reserved.