public interface SubscriptionRegistry
Different subscription registries know how to to store different kind of subscriptions. Each registry is specialized in one type of subscriptions and knows how to quickly find all potentially interesting subscriptions so that a particular NotificationDetector can do his job the quickest way possible.
This interface is generic only for subscription purposes because the Subscriber component simply tries to register a new subscription to all available subscription registries.
Normally a subscription registry manages only a set of topic expression prefixes, but this interface doesn't force the Subscriber to know this information; instead the subscription registry itself will decide whether to accept the subscription or not.
Since many subscription registries may accept the same subscription, the identifier is preallocated by the Subscriber, since the subscription is only one, and even if we give the possibility for several detectors to detect it from different sources only one event will be generated.
| Modifier and Type | Method and Description |
|---|---|
Collection<ResourceStateSubscription> |
listMatchingSubscriptions(String prefix,
String type,
String resId)
return all subscriptions matching a given prefix and a given type.
|
Collection<ResourceStateSubscription> |
listSubscriptions()
return all subscriptions.
|
String |
registerSubscription(SubscriptionRequest subscription)
register a subscription.
|
boolean |
removeSubscription(String subscriptionId)
removes a particular subscription.
|
boolean |
unsubscribe(String subId)
Unsubscribe a subscription if it exists.
|
String registerSubscription(SubscriptionRequest subscription) throws eu.dnetlib.enabling.is.sn.rmi.SubscriptionRequestRejectedException
subscription - subscription requesteu.dnetlib.enabling.is.sn.rmi.SubscriptionRequestRejectedExceptionboolean unsubscribe(String subId)
subId - subscription identifierCollection<ResourceStateSubscription> listMatchingSubscriptions(String prefix, String type, String resId)
prefix - prefixtype - concrete typeresId - resource identifierCollection<ResourceStateSubscription> listSubscriptions()
boolean removeSubscription(String subscriptionId)
subscriptionId - identifierCopyright © 2017. All rights reserved.