/** * 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); }
return new SubscriptionDiscovery((Subscription[]) subscriptions.toArray(new Subscription[subscriptions.size()]));
return new SubscriptionDiscovery(subscriptions.toArray(new Subscription[subscriptions.size()]));
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); }