/** * Retrieve the {@link org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery} * object for the given resource. Note, that the discovery object will be empty * if there are no subscriptions present.<br> * Note that all subscriptions present on the given resource are returned. * However, the subscription id will not be visible in order to avoid abuse * by clients not having registered the subscription originally. * * @param resource */ public SubscriptionDiscovery getSubscriptionDiscovery(ObservationResource resource) { Subscription[] subsForResource = subscriptions.getByPath(resource.getLocator()); return new SubscriptionDiscovery(subsForResource); }
/** * Returns the Xml representation of the subscription discovery. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ public Element toXml(Document document) { Element elem = getName().toXml(document); for (int i = 0; i < subscriptions.length; i++) { elem.appendChild(subscriptions[i].toXml(document)); } return elem; }
SubscriptionDiscovery sd = SubscriptionDiscovery.createFromXml(sde); if (((Subscription[]) sd.getValue()).length > 0) { return sd; } else {
.getValue(); if (subs.length == 1) { this.remoteServerProvidesNodeTypes = subs[0].eventsProvideNodeTypeInformation();
SubscriptionDiscovery sd = SubscriptionDiscovery.createFromXml(sde); if (((Subscription[]) sd.getValue()).length > 0) { return sd; } else {
.getValue(); if (subs.length == 1) { this.remoteServerProvidesNodeTypes = subs[0].eventsProvideNodeTypeInformation();
return new SubscriptionDiscovery((Subscription[]) subscriptions.toArray(new Subscription[subscriptions.size()]));
/** * Returns the Xml representation of the subscription discovery. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ @Override public Element toXml(Document document) { Element elem = getName().toXml(document); for (Subscription subscription : subscriptions) { elem.appendChild(subscription.toXml(document)); } return elem; }
return new SubscriptionDiscovery(subscriptions.toArray(new Subscription[subscriptions.size()]));
/** * Returns the Xml representation of the subscription discovery. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ @Override public Element toXml(Document document) { Element elem = getName().toXml(document); for (Subscription subscription : subscriptions) { elem.appendChild(subscription.toXml(document)); } return elem; }
return new SubscriptionDiscovery(subscriptions.toArray(new Subscription[subscriptions.size()]));
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }
/** * * @param subscription * @throws IOException * @see org.apache.jackrabbit.webdav.observation.ObservationDavServletResponse#sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription) */ public void sendSubscriptionResponse(Subscription subscription) throws IOException { String id = subscription.getSubscriptionId(); if (id != null) { Header h = new CodedUrlHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, id); httpResponse.setHeader(h.getHeaderName(), h.getHeaderValue()); } DavPropertySet propSet = new DavPropertySet(); propSet.add(new SubscriptionDiscovery(subscription)); sendXmlResponse(propSet, SC_OK); }