Search in sources :

Example 1 with SubscriptionInfo

use of org.apache.jackrabbit.webdav.observation.SubscriptionInfo in project jackrabbit by apache.

the class AbstractWebdavServlet method doSubscribe.

/**
     * The SUBSCRIBE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
protected void doSubscribe(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException {
    if (!(resource instanceof ObservationResource)) {
        response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
        return;
    }
    SubscriptionInfo info = request.getSubscriptionInfo();
    if (info == null) {
        response.sendError(DavServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
        return;
    }
    Subscription subs = ((ObservationResource) resource).subscribe(info, request.getSubscriptionId());
    response.sendSubscriptionResponse(subs);
}
Also used : ObservationResource(org.apache.jackrabbit.webdav.observation.ObservationResource) SubscriptionInfo(org.apache.jackrabbit.webdav.observation.SubscriptionInfo) Subscription(org.apache.jackrabbit.webdav.observation.Subscription)

Aggregations

ObservationResource (org.apache.jackrabbit.webdav.observation.ObservationResource)1 Subscription (org.apache.jackrabbit.webdav.observation.Subscription)1 SubscriptionInfo (org.apache.jackrabbit.webdav.observation.SubscriptionInfo)1