org.apache.jackrabbit.webdav.jcr.observation
Class SubscriptionManagerImpl

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.jcr.observation.SubscriptionManagerImpl
All Implemented Interfaces:
org.apache.jackrabbit.webdav.observation.SubscriptionManager

public class SubscriptionManagerImpl
extends Object
implements org.apache.jackrabbit.webdav.observation.SubscriptionManager

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 Summary
SubscriptionManagerImpl()
           
 
Method Summary
 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, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionManagerImpl

public SubscriptionManagerImpl()
Method Detail

getSubscriptionDiscovery

public org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery getSubscriptionDiscovery(org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Retrieve the SubscriptionDiscovery object for the given resource. Note, that the discovery object will be empty if there are no subscriptions present.

Specified by:
getSubscriptionDiscovery in interface org.apache.jackrabbit.webdav.observation.SubscriptionManager
Parameters:
resource -

subscribe

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
Create a new Subscription or update an existing Subscription and add it as eventlistener to the ObservationManager.

Specified by:
subscribe in interface org.apache.jackrabbit.webdav.observation.SubscriptionManager
Parameters:
info -
subscriptionId -
resource -
Returns:
Subscription that has been added to the ObservationManager
Throws:
org.apache.jackrabbit.webdav.DavException - if the subscription fails

unsubscribe

public void unsubscribe(String subscriptionId,
                        org.apache.jackrabbit.webdav.observation.ObservationResource resource)
                 throws org.apache.jackrabbit.webdav.DavException
Unsubscribe the Subscription with the given id and remove it from the ObservationManager as well as from the internal map.

Specified by:
unsubscribe in interface org.apache.jackrabbit.webdav.observation.SubscriptionManager
Parameters:
subscriptionId -
resource -
Throws:
org.apache.jackrabbit.webdav.DavException

poll

public org.apache.jackrabbit.webdav.observation.EventDiscovery poll(String subscriptionId,
                                                                    org.apache.jackrabbit.webdav.observation.ObservationResource resource)
                                                             throws org.apache.jackrabbit.webdav.DavException
Retrieve all event bundles accumulated since for the subscription specified by the given id.

Specified by:
poll in interface org.apache.jackrabbit.webdav.observation.SubscriptionManager
Parameters:
subscriptionId -
resource -
Returns:
object encapsulating the events.
Throws:
org.apache.jackrabbit.webdav.DavException


Copyright © 2005-2006 . All Rights Reserved.