public class SubscriptionManagerImpl extends Object implements org.apache.jackrabbit.webdav.observation.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(org.apache.jackrabbit.webdav.transaction.TransactionResource resource,
String lockToken,
boolean success)
This method is called after the commit has been executed.
|
void |
beforeCommit(org.apache.jackrabbit.webdav.transaction.TransactionResource resource,
String lockToken)
This method is called right before a transaction is committed.
|
org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery |
getSubscriptionDiscovery(org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Retrieve the
SubscriptionDiscovery
object for the given resource. |
org.apache.jackrabbit.webdav.observation.EventDiscovery |
poll(String subscriptionId,
long timeout,
org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Retrieve all event bundles accumulated since for the subscription specified
by the given id.
|
org.apache.jackrabbit.webdav.observation.Subscription |
subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info,
String subscriptionId,
org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Create a new
Subscription or update an existing Subscription
and add it as eventlistener to the ObservationManager. |
void |
unsubscribe(String subscriptionId,
org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Unsubscribe the
Subscription with the given id and remove it
from the ObservationManager as well as
from the internal map. |
public org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery getSubscriptionDiscovery(org.apache.jackrabbit.webdav.observation.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 org.apache.jackrabbit.webdav.observation.SubscriptionManagerresource - public org.apache.jackrabbit.webdav.observation.Subscription subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info,
String subscriptionId,
org.apache.jackrabbit.webdav.observation.ObservationResource resource)
throws org.apache.jackrabbit.webdav.DavException
Subscription or update an existing Subscription
and add it as eventlistener to the ObservationManager.subscribe in interface org.apache.jackrabbit.webdav.observation.SubscriptionManagerinfo - subscriptionId - resource - Subscription that has been added to the ObservationManagerorg.apache.jackrabbit.webdav.DavException - if the subscription failspublic void unsubscribe(String subscriptionId, org.apache.jackrabbit.webdav.observation.ObservationResource resource) throws org.apache.jackrabbit.webdav.DavException
Subscription with the given id and remove it
from the ObservationManager as well as
from the internal map.unsubscribe in interface org.apache.jackrabbit.webdav.observation.SubscriptionManagersubscriptionId - resource - org.apache.jackrabbit.webdav.DavExceptionpublic org.apache.jackrabbit.webdav.observation.EventDiscovery poll(String subscriptionId, long timeout, org.apache.jackrabbit.webdav.observation.ObservationResource resource) throws org.apache.jackrabbit.webdav.DavException
poll in interface org.apache.jackrabbit.webdav.observation.SubscriptionManagersubscriptionId - timeout - timeout in millisecondsresource - org.apache.jackrabbit.webdav.DavExceptionpublic void beforeCommit(org.apache.jackrabbit.webdav.transaction.TransactionResource resource,
String lockToken)
beforeCommit in interface TransactionListenerresource - the transaction resource which will be committed.lockToken - the lock tokenpublic void afterCommit(org.apache.jackrabbit.webdav.transaction.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-2014 The Apache Software Foundation. All Rights Reserved.