|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.webdav.jcr.observation.SubscriptionImpl
public class SubscriptionImpl
The Subscription class encapsulates a single subscription with
the following responsibilities:
| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationConstants |
|---|
HEADER_POLL_TIMEOUT, HEADER_SUBSCRIPTIONID, NAMESPACE, SUBSCRIPTIONDISCOVERY, XML_EVENT, XML_EVENT_TRANSACTION_ID, 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(SubscriptionInfo info,
ObservationResource resource)
Create a new Subscription with the given SubscriptionInfo
and resource. |
|
| Method Summary | |
|---|---|
static EventType |
getEventType(int jcrEventType)
Static utility method to convert the type defined by a JCR event into an EventType
object. |
static int |
getJcrEventType(EventType eventType)
Static utility method to convert an EventType as present in
the Xml body into the corresponding JCR event constant defined by
Event. |
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(long) 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 |
|---|
public SubscriptionImpl(SubscriptionInfo info,
ObservationResource resource)
throws DavException
Subscription with the given SubscriptionInfo
and resource.
info - resource -
DavException - if resource is not based on a JCR repository or
the repository does not support observation.| Method Detail |
|---|
public String getSubscriptionId()
getSubscriptionId in interface Subscriptionpublic Element toXml(Document document)
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.
toXml in interface XmlSerializabledocument -
XmlSerializable.toXml(Document)public void onEvent(EventIterator events)
discoverEvents(long) request. If this
subscription is expired it will remove itself as listener from the
observation manager.
onEvent in interface EventListenerevents - to be recorded.EventListener.onEvent(EventIterator),
discoverEvents(long)public static EventType getEventType(int jcrEventType)
JCR event into an EventType
object.
jcrEventType -
EventType representation of the given JCR event type.
IllegalArgumentException - if the given int does not represent a
valid type constants as defined by Event.
public static int getJcrEventType(EventType eventType)
throws DavException
EventType as present in
the Xml body into the corresponding JCR event constant defined by
Event.
eventType -
Event.DavException - if the given event type does not define a valid
JCR event type, such as returned by getEventType(int).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||