Examples of EventDiscovery


Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

     *                are present currently.
     * @return object listing all events that were recorded.
     * @see #onEvent(EventIterator)
     */
    synchronized EventDiscovery discoverEvents(long timeout) {
        EventDiscovery ed = new EventDiscovery();
        if (eventBundles.isEmpty() && timeout > 0) {
            try {
                wait(timeout);
            } catch (InterruptedException e) {
                // continue and possibly return empty event discovery
            }
        }
        for (EventBundle eb : eventBundles) {
            ed.addEventBundle(eb);
        }
        // clear list
        eventBundles.clear();
        return ed;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        try {
            method = new PollMethod(uri, subscriptionId, timeout);
            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

            EventDiscovery disc = method.getResponseAsEventDiscovery();
            EventBundle[] events;
            if (disc.isEmpty()) {
                events = new EventBundle[0];
            } else {
                Element discEl = disc.toXml(DomUtil.createDocument());
                ElementIterator it = DomUtil.getChildren(discEl,
                        ObservationConstants.XML_EVENTBUNDLE,
                        ObservationConstants.NAMESPACE);
                List<EventBundle> bundles = new ArrayList<EventBundle>();
                while (it.hasNext()) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        EventDiscovery ed = ((ObservationResource) resource).poll(request.getSubscriptionId());
        response.sendPollResponse(ed);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

     *
     * @return object listing all events that were recorded.
     * @see #onEvent(EventIterator)
     */
    synchronized EventDiscovery discoverEvents() {
        EventDiscovery ed = new EventDiscovery();
        Iterator it = eventBundles.iterator();
        while (it.hasNext()) {
            EventBundle eb = (EventBundle) it.next();
            ed.addEventBundle(eb);
        }
        // clear list
        eventBundles.clear();
        return ed;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        try {
            method = new PollMethod(uri, subscriptionId, timeout);
            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

            EventDiscovery disc = method.getResponseAsEventDiscovery();
            EventBundle[] events;
            if (disc.isEmpty()) {
                events = new EventBundle[0];
            } else {
                Element discEl = disc.toXml(domFactory);
                ElementIterator it = DomUtil.getChildren(discEl,
                        ObservationConstants.XML_EVENTBUNDLE,
                        ObservationConstants.NAMESPACE);
                List<EventBundle> bundles = new ArrayList<EventBundle>();
                while (it.hasNext()) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        try {
            method = new PollMethod(uri, subscriptionId, timeout);
            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

            EventDiscovery disc = method.getResponseAsEventDiscovery();
            EventBundle[] events;
            if (disc.isEmpty()) {
                events = new EventBundle[0];
            } else {
                Element discEl = disc.toXml(domFactory);
                ElementIterator it = DomUtil.getChildren(discEl,
                        ObservationConstants.XML_EVENTBUNDLE,
                        ObservationConstants.NAMESPACE);
                List bundles = new ArrayList();
                while (it.hasNext()) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

     *                are present currently.
     * @return object listing all events that were recorded.
     * @see #onEvent(EventIterator)
     */
    synchronized EventDiscovery discoverEvents(long timeout) {
        EventDiscovery ed = new EventDiscovery();
        if (eventBundles.isEmpty() && timeout > 0) {
            try {
                wait(timeout);
            } catch (InterruptedException e) {
                // continue and possibly return empty event discovery
            }
        }
        Iterator it = eventBundles.iterator();
        while (it.hasNext()) {
            EventBundle eb = (EventBundle) it.next();
            ed.addEventBundle(eb);
        }
        // clear list
        eventBundles.clear();
        return ed;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

      * @param root
      * @return
      */
     private boolean buildDiscoveryFromRoot(Element root) {
         if (DomUtil.matches(root, XML_EVENTDISCOVERY, ObservationConstants.NAMESPACE)) {
             eventDiscovery = new EventDiscovery();
             ElementIterator it = DomUtil.getChildren(root, XML_EVENTBUNDLE, ObservationConstants.NAMESPACE);
             while (it.hasNext()) {
                 final Element ebElement = it.nextElement();
                 EventBundle eb = new EventBundle() {
                     public Element toXml(Document document) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        EventDiscovery ed = ((ObservationResource) resource).poll(
                request.getSubscriptionId(), request.getPollTimeout());
        response.sendPollResponse(ed);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.observation.EventDiscovery

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        EventDiscovery ed = ((ObservationResource) resource).poll(
                request.getSubscriptionId(), request.getPollTimeout());
        response.sendPollResponse(ed);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.