Class SubscriptionInfo
java.lang.Object
org.apache.jackrabbit.webdav.observation.SubscriptionInfo
- All Implemented Interfaces:
ObservationConstants,XmlSerializable
SubscriptionInfo class encapsulates the subscription info
that forms the request body of a SUBSCRIBE request.The following xml layout is defined for the subscription info:
<!ELEMENT subscriptioninfo ( eventtype, nolocal?, filter? ) > <!ELEMENT eventtype ANY > ANY defines any sequence of elements where at least one defines a valid eventtype. Note that a single eventtype must not occur multiple times. <!ELEMENT nolocal EMPTY > <!ELEMENT filter ANY > ANY: any sequence of elements identifying a filter for event listening but at least a single element.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationConstants
HEADER_POLL_TIMEOUT, HEADER_SUBSCRIPTIONID, N_EVENT, N_EVENTBUNDLE, N_EVENTDATE, N_EVENTDISCOVERY, N_EVENTINFO, N_EVENTMIXINNODETYPE, N_EVENTPRIMARYNODETYPE, N_EVENTTYPE, N_EVENTUSERDATA, N_EVENTUSERID, NAMESPACE, SUBSCRIPTIONDISCOVERY, XML_EVENT, XML_EVENT_LOCAL, XML_EVENT_TRANSACTION_ID, XML_EVENTBUNDLE, XML_EVENTDATE, XML_EVENTDISCOVERY, XML_EVENTIDENTIFIER, XML_EVENTINFO, XML_EVENTMIXINNODETYPE, XML_EVENTPRIMARNODETYPE, XML_EVENTSWITHLOCALFLAG, XML_EVENTSWITHTYPES, XML_EVENTTYPE, XML_EVENTUSERDATA, XML_EVENTUSERID, XML_FILTER, XML_NODETYPE_NAME, XML_NOLOCAL, XML_SUBSCRIPTION, XML_SUBSCRIPTIONID, XML_SUBSCRIPTIONINFO, XML_UUID -
Constructor Summary
ConstructorsConstructorDescriptionSubscriptionInfo(EventType[] eventTypes, boolean isDeep, long timeout) Create a newSubscriptionInfoSubscriptionInfo(EventType[] eventTypes, Filter[] filters, boolean noLocal, boolean isDeep, long timeout) Create a newSubscriptionInfoSubscriptionInfo(Element reqInfo, long timeout, boolean isDeep) -
Method Summary
Modifier and TypeMethodDescriptionReturn array of event type names present in the subscription info.Filter[]Return all filters defined for thisSubscriptionInfoFilter[]getFilters(String localName, Namespace namespace) Return array of filters with the specified name.longReturn the timeout as retrieved from the request.booleanisDeep()Returns true if thedepths headerdefined a depth other than '0'.booleanReturns true if theObservationConstants.XML_NOLOCALelement is present in this subscription info.Xml representation of thisSubscriptionInfo.
-
Constructor Details
-
SubscriptionInfo
Create a newSubscriptionInfo- Parameters:
eventTypes-isDeep-timeout-
-
SubscriptionInfo
public SubscriptionInfo(EventType[] eventTypes, Filter[] filters, boolean noLocal, boolean isDeep, long timeout) Create a newSubscriptionInfo- Parameters:
eventTypes-filters-noLocal-isDeep-timeout-
-
SubscriptionInfo
Create a newSubscriptionInfofrom the given Xml element and from additional information that is transported within the request header:- Parameters:
reqInfo- Xml element present in the request body.timeout- as defined in thetimeout header.isDeep- as defined in thedepth header.- Throws:
IllegalArgumentException- if the reqInfo element does not contain the mandatory elements.DavException
-
-
Method Details
-
getEventTypes
Return array of event type names present in the subscription info.- Returns:
- array of String defining the names of the events this subscription should listen to.
-
getFilters
Return all filters defined for thisSubscriptionInfo- Returns:
- all filters or an empty Filter array.
-
getFilters
Return array of filters with the specified name.- Parameters:
localName- the filter elements must provide.namespace-- Returns:
- array containing the text of the filter elements with the given name.
-
isNoLocal
public boolean isNoLocal()Returns true if theObservationConstants.XML_NOLOCALelement is present in this subscription info.- Returns:
- if
ObservationConstants.XML_NOLOCALelement is present.
-
isDeep
public boolean isDeep()Returns true if thedepths headerdefined a depth other than '0'.- Returns:
- true if this subscription info was created with
isDeeptrue.
-
getTimeOut
public long getTimeOut()Return the timeout as retrieved from the request.- Returns:
- timeout.
-
toXml
Xml representation of thisSubscriptionInfo.- Specified by:
toXmlin interfaceXmlSerializable- Parameters:
document-- Returns:
- Xml representation
- See Also:
-