Class SubscriptionRegistry
java.lang.Object
org.somda.sdc.dpws.soap.wseventing.helper.SubscriptionRegistry
- All Implemented Interfaces:
Subscriptions
Thread-safe provision of a set of a subscription managers plus tracking mechanism.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubscription(SourceSubscriptionManager subscriptionManager) Adds a subscription to the subscription registry.Gets a specific subscription.getAll()Returns an immutable map of all active subscriptions.getSubscription(String subscriptionId) Gets a subscription from the subscription registry.Returns a copied snapshot of all available subscription managers.voidregisterObserver(Object observer) Registers anEventBusobserver to enable tracking of subscription insertion and deletion.removeSubscription(String subscriptionId) Removes a subscription from the subscription registry.voidunregisterObserver(Object observer) Removes an observer formerly registered viaregisterObserver(Object).
-
Method Details
-
addSubscription
Adds a subscription to the subscription registry.- Parameters:
subscriptionManager- the subscription manager to add to the registry.
-
removeSubscription
Removes a subscription from the subscription registry.- Parameters:
subscriptionId- the identifier of the subscription to remove.- Returns:
- the removed
SourceSubscriptionManagerinstance if found, otherwiseOptional.empty().
-
getSubscription
Gets a subscription from the subscription registry.- Parameters:
subscriptionId- the identifier of the subscription to retrieve.- Returns:
- the
SourceSubscriptionManagerinstance if found, otherwiseOptional.empty().
-
getSubscriptions
Returns a copied snapshot of all available subscription managers.- Returns:
- all subscription managers as a copy.
-
registerObserver
Registers anEventBusobserver to enable tracking of subscription insertion and deletion.- Parameters:
observer- an observer withSubscribeannotated methods and the first argument of typeSubscriptionAddedMessageorSubscriptionRemovedMessage.- See Also:
-
EventBus.register(Object)
-
unregisterObserver
Removes an observer formerly registered viaregisterObserver(Object).- Parameters:
observer- the observer to unregister.- See Also:
-
EventBus.unregister(Object)
-
get
Description copied from interface:SubscriptionsGets a specific subscription.- Specified by:
getin interfaceSubscriptions- Parameters:
subscriptionId- the identifier of the subscription to retrieve.- Returns:
- the
SourceSubscriptionManagerinstance if found, otherwiseOptional.empty().
-
getAll
Description copied from interface:SubscriptionsReturns an immutable map of all active subscriptions.- Specified by:
getAllin interfaceSubscriptions- Returns:
- all subscription managers.
-