Class 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:
    • Providing access to the subscription info,
    • Recording events this subscription is interested in,
    • Providing access to the events.
    • 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 
      Constructor Description
      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.
    • Constructor Detail

      • SubscriptionImpl

        public SubscriptionImpl​(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info,
                                org.apache.jackrabbit.webdav.observation.ObservationResource resource)
                         throws org.apache.jackrabbit.webdav.DavException
        Create a new Subscription with the given SubscriptionInfo and resource.
        Parameters:
        info -
        resource -
        Throws:
        org.apache.jackrabbit.webdav.DavException - if resource is not based on a JCR repository or the repository does not support observation.
    • 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
      • eventsProvideNodeTypeInformation

        public boolean eventsProvideNodeTypeInformation()
        Specified by:
        eventsProvideNodeTypeInformation in interface org.apache.jackrabbit.webdav.observation.Subscription
      • eventsProvideNoLocalFlag

        public boolean eventsProvideNoLocalFlag()
        Specified by:
        eventsProvideNoLocalFlag in interface org.apache.jackrabbit.webdav.observation.Subscription
      • 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 successful 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)
      • getAllEventTypes

        public static org.apache.jackrabbit.webdav.observation.EventType[] getAllEventTypes()
        Returns:
        The DAV event type representation for all known JCR event types.
      • serializeInfoMap

        protected static void serializeInfoMap​(Element eventElem,
                                               Session session,
                                               Map<?,​?> map)