public class SubscriptionManagerImpl extends Object implements SubscriptionManager, TransactionListener
SubscriptionManager collects all subscriptions requested, handles
 the subscription timeout and provides METHODS to discover subscriptions
 present on a given resource as well as events for an specific subscription.| Constructor and Description | 
|---|
| SubscriptionManagerImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | afterCommit(TransactionResource resource,
           String lockToken,
           boolean success)This method is called after the commit has been executed. | 
| void | beforeCommit(TransactionResource resource,
            String lockToken)This method is called right before a transaction is committed. | 
| SubscriptionDiscovery | getSubscriptionDiscovery(ObservationResource resource)Retrieve the  SubscriptionDiscoveryobject for the given resource. | 
| EventDiscovery | poll(String subscriptionId,
    long timeout,
    ObservationResource resource)Retrieve all event bundles accumulated since for the subscription specified
 by the given id. | 
| Subscription | subscribe(SubscriptionInfo info,
         String subscriptionId,
         ObservationResource resource)Create a new  Subscriptionor update an existingSubscriptionand add it as eventlistener to theObservationManager. | 
| void | unsubscribe(String subscriptionId,
           ObservationResource resource)Unsubscribe the  Subscriptionwith the given id and remove it
 from theObservationManageras well as
 from the internal map. | 
public SubscriptionDiscovery getSubscriptionDiscovery(ObservationResource resource)
SubscriptionDiscovery
 object for the given resource. Note, that the discovery object will be empty
 if there are no subscriptions present.getSubscriptionDiscovery in interface SubscriptionManagerresource - public Subscription subscribe(SubscriptionInfo info, String subscriptionId, ObservationResource resource) throws DavException
Subscription or update an existing Subscription
 and add it as eventlistener to the ObservationManager.subscribe in interface SubscriptionManagerinfo - subscriptionId - resource - Subscription that has been added to the ObservationManagerDavException - if the subscription failspublic void unsubscribe(String subscriptionId, ObservationResource resource) throws DavException
Subscription with the given id and remove it
 from the ObservationManager as well as
 from the internal map.unsubscribe in interface SubscriptionManagersubscriptionId - resource - DavExceptionpublic EventDiscovery poll(String subscriptionId, long timeout, ObservationResource resource) throws DavException
poll in interface SubscriptionManagersubscriptionId - timeout - timeout in millisecondsresource - DavExceptionpublic void beforeCommit(TransactionResource resource, String lockToken)
beforeCommit in interface TransactionListenerresource - the transaction resource which will be committed.lockToken - the lock tokenpublic void afterCommit(TransactionResource resource, String lockToken, boolean success)
afterCommit in interface TransactionListenerresource - the transaction resource which had been committed.lockToken - the lock token.success - if the commit was successful.Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.