org.apache.jackrabbit.webdav.observation
Class SubscriptionInfo

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.observation.SubscriptionInfo
All Implemented Interfaces:
ObservationConstants

public class SubscriptionInfo
extends Object
implements ObservationConstants

SubscriptionInfo class encapsulates the subscription info that forms the request body of a SUBSCRIBE request.

See Also:
ObservationConstants.XML_SUBSCRIPTIONINFO

Field Summary
 
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationConstants
EVENT_NODEADDED, EVENT_NODEREMOVED, EVENT_PROPERTYADDED, EVENT_PROPERTYCHANGED, EVENT_PROPERTYREMOVED, 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
SubscriptionInfo(org.jdom.Element reqInfo, long timeout, boolean isDeep)
          Create a new SubscriptionInfo
 
Method Summary
 List getEventTypes()
          Return list of event types Xml elements present in the subscription info.
 String[] getFilters(String name)
          Return array of filters with the specified name.
 long getTimeOut()
          Return the timeout as retrieved from the request.
 boolean isDeep()
          Returns true if the depths header defined a depth other than '0'.
 boolean isNoLocal()
          Returns true if the ObservationConstants.XML_NOLOCAL element is present in this subscription info.
 void setTimeOut(long timeout)
          Set the timeout.
 org.jdom.Element[] toXml()
          Xml representation of this SubscriptionInfo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionInfo

public SubscriptionInfo(org.jdom.Element reqInfo,
                        long timeout,
                        boolean isDeep)
Create a new SubscriptionInfo

Parameters:
reqInfo - Xml element present in the request body.
timeout - as defined by the timeout header.
isDeep - as defined by the depth header.
Throws:
IllegalArgumentException - if the reqInfo element does not contain the mandatory elements.
Method Detail

getEventTypes

public List getEventTypes()
Return list of event types Xml elements present in the subscription info. NOTE: the elements need to be detached in order to be added as content to any other Xml element.

Returns:
List of Xml elements defining which events this subscription should listen to.

getFilters

public String[] getFilters(String name)
Return array of filters with the specified name.

Parameters:
name - the filter elments must provide.
Returns:
array containing the text of the filter elements with the given name.

isNoLocal

public boolean isNoLocal()
Returns true if the ObservationConstants.XML_NOLOCAL element is present in this subscription info.

Returns:
if ObservationConstants.XML_NOLOCAL element is present.

isDeep

public boolean isDeep()
Returns true if the depths header defined a depth other than '0'.

Returns:
true if this subscription info was created with isDeep true.

getTimeOut

public long getTimeOut()
Return the timeout as retrieved from the request.

Returns:
timeout.

setTimeOut

public void setTimeOut(long timeout)
Set the timeout. NOTE: no validation is made.

Parameters:
timeout - as defined by the DavConstants.HEADER_TIMEOUT.

toXml

public org.jdom.Element[] toXml()
Xml representation of this SubscriptionInfo.

Returns:
Xml representation


Copyright © 2005 . All Rights Reserved.