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

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.jcr.observation.SubscriptionImpl
All Implemented Interfaces:
EventListener, org.apache.jackrabbit.webdav.observation.ObservationConstants, org.apache.jackrabbit.webdav.observation.Subscription, org.apache.jackrabbit.webdav.xml.XmlSerializable

public class SubscriptionImpl
extends Object
implements org.apache.jackrabbit.webdav.observation.Subscription, org.apache.jackrabbit.webdav.observation.ObservationConstants, EventListener

The Subscription class encapsulates a single subscription with the following responsibilities:


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationConstants
HEADER_SUBSCRIPTIONID, NAMESPACE, SUBSCRIPTIONDISCOVERY, XML_EVENT, XML_EVENTBUNDLE, XML_EVENTDISCOVERY, XML_EVENTTYPE, XML_EVENTUSERID, XML_FILTER, XML_NODETYPE_NAME, XML_NOLOCAL, XML_SUBSCRIPTION, XML_SUBSCRIPTIONID, XML_SUBSCRIPTIONINFO, XML_UUID
 
Constructor Summary
SubscriptionImpl(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info, org.apache.jackrabbit.webdav.observation.ObservationResource resource)
          Create a new Subscription with the given SubscriptionInfo and resource.
 
Method Summary
 String getSubscriptionId()
          Returns the id of this subscription.
 void onEvent(EventIterator events)
          Records the events passed as a new event bundle in order to make them available with the next #discoverEvents() request.
 Element toXml(Document document)
          Return the Xml representation of this Subscription as required for the SubscriptionDiscovery webdav property that in included in the response body of a sucessful SUBSCRIBE request or as part of a PROPFIND response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionImpl

public SubscriptionImpl(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info,
                        org.apache.jackrabbit.webdav.observation.ObservationResource resource)
Create a new Subscription with the given SubscriptionInfo and resource.

Parameters:
info -
resource -
Method Detail

getSubscriptionId

public String getSubscriptionId()
Returns the id of this subscription.

Specified by:
getSubscriptionId in interface org.apache.jackrabbit.webdav.observation.Subscription
Returns:
subscriptionId

toXml

public Element toXml(Document document)
Return the Xml representation of this Subscription as required for the SubscriptionDiscovery webdav property that in included in the response body of a sucessful SUBSCRIBE request or as part of a PROPFIND response.

Specified by:
toXml in interface org.apache.jackrabbit.webdav.xml.XmlSerializable
Parameters:
document -
Returns:
Xml representation
See Also:
XmlSerializable.toXml(Document)

onEvent

public void onEvent(EventIterator events)
Records the events passed as a new event bundle in order to make them available with the next #discoverEvents() request.

Specified by:
onEvent in interface EventListener
Parameters:
events - to be recorded.
See Also:
EventListener.onEvent(EventIterator), #discoverEvents()


Copyright © 2005-2006 . All Rights Reserved.