Class EventDiscovery
java.lang.Object
org.apache.jackrabbit.webdav.observation.EventDiscovery
- All Implemented Interfaces:
ObservationConstants,XmlSerializable
EventDiscovery represents the request body of a successful
POLL request. It reveals all events that occurred since the last POLL. The
definition what events that particular subscription is interested in was
specified with the initial SUBSCRIPTION that started the event listening.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventBundle(EventBundle eventBundle) Add the Xml representation of an single 'eventBundle' listing the events that resulted from a change in the server, filtered by the restrictions present in the corresponding subscription.static EventDiscoverycreateFromXml(Element eventDiscoveryElement) Build aEventDiscoveryfrom the specified xml element.Returns an iterator over theevent bundlescurrently present on this discovery.booleanisEmpty()Returns true, if this event discovery does not report any events (thusgetEventBundles()would return an empty iterator.Returns the Xml representation of thisEventDiscoveryas being present in the POLL response body.
-
Constructor Details
-
EventDiscovery
public EventDiscovery()
-
-
Method Details
-
addEventBundle
Add the Xml representation of an single 'eventBundle' listing the events that resulted from a change in the server, filtered by the restrictions present in the corresponding subscription.- Parameters:
eventBundle-- See Also:
-
getEventBundles
Returns an iterator over theevent bundlescurrently present on this discovery.- Returns:
- iterator over event bundles present.
-
isEmpty
public boolean isEmpty()Returns true, if this event discovery does not report any events (thusgetEventBundles()would return an empty iterator.- Returns:
- true if
getEventBundles()would return an empty iterator, false otherwise.
-
toXml
Returns the Xml representation of thisEventDiscoveryas being present in the POLL response body.- Specified by:
toXmlin interfaceXmlSerializable- Parameters:
document-- Returns:
- Xml representation
- See Also:
-
createFromXml
Build aEventDiscoveryfrom the specified xml element.- Parameters:
eventDiscoveryElement-- Returns:
- new
EventDiscoveryinstance. - Throws:
IllegalArgumentException- if the given document isnullor does not provide the required element.
-