org.apache.webdav.lib.methods

Class SubscribeMethod

Implemented Interfaces:
DepthSupport

public class SubscribeMethod
extends XMLResponseMethodBase
implements DepthSupport

Implements the SUBSCRIBE method.
See Also:
Reference

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase

XMLResponseMethodBase.OptionsResponse, XMLResponseMethodBase.Response, XMLResponseMethodBase.ResponseWithinMultistatus, XMLResponseMethodBase.SingleResponse

Field Summary

static String
TYPE_DELETE
static String
TYPE_MOVE
static String
TYPE_UPDATE
static String
TYPE_UPDATE_NEW_MEMBER

Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase

builder, decodeResponseHrefs, responseURLs

Fields inherited from interface org.apache.webdav.lib.methods.DepthSupport

DEPTH_0, DEPTH_1, DEPTH_INFINITY

Constructor Summary

SubscribeMethod()
SubscribeMethod(String path)

Method Summary

protected void
addRequestHeaders(HttpState state, HttpConnection conn)
String
getCallback()
int
getDepth()
Depth getter.
String
getName()
long
getNotificationDelay()
String
getNotificationType()
String
getResponsedContentLocation()
Returns the value of the content-location header of the response.
int
getResponsedSubscriptionId()
Returns the subscription ID responsed from the server.
long
getResponsedSubscriptionLifetime()
Returns the subscription lifetime responsed from the server.
long
getSubsciptionLifetime()
long
getSubscriptionId()
protected void
processResponseHeaders(HttpState state, HttpConnection conn)
void
recycle()
void
setCallback(String callback)
Sets the URI that's to be notified if the subscribed event does occur.
void
setDepth(int depth)
Sets the depth.
void
setNotificationDelay(long delay)
Sets the notification delay in seconds.
void
setNotificationType(String notificationType)
Sets the notification type, i.e.
void
setRequestHeader(String headerName, String headerValue)
Adds special checking of header values of the SUBSCRIBE method to the super class implementation.
void
setSubsciptionLifetime(long subsciptionLifetime)
Sets the duration of the subscription in seconds.
void
setSubscriptionId(int subscriptionId)
Sets the ID of a subscription to be refreshed.

Methods inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase

convertElementToProperty, generateRequestBody, getDebug, getRequestContentLength, getResponseDocument, getResponseHashtable, getResponseURLs, getResponses, parseResponse, parseXMLResponse, readResponseBody, recycle, setDebug, setDecodeResponseHrefs, setDocument, setResponseHashtable, writeRequestBody

Methods inherited from class org.apache.webdav.lib.methods.HttpRequestBodyMethodBase

getRequestContentLength, isRequestContentAlreadySet, readContinueCode, recycle, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody, writeRequestBody

Field Details

TYPE_DELETE

public static final String TYPE_DELETE

TYPE_MOVE

public static final String TYPE_MOVE

TYPE_UPDATE

public static final String TYPE_UPDATE

TYPE_UPDATE_NEW_MEMBER

public static final String TYPE_UPDATE_NEW_MEMBER

Constructor Details

SubscribeMethod

public SubscribeMethod()

SubscribeMethod

public SubscribeMethod(String path)

Method Details

addRequestHeaders

protected void addRequestHeaders(HttpState state,
                                 HttpConnection conn)
            throws IOException,
                   HttpException

getCallback

public String getCallback()

getDepth

public int getDepth()
Depth getter.
Specified by:
getDepth in interface DepthSupport
Returns:
int depth value

getName

public String getName()

getNotificationDelay

public long getNotificationDelay()

getNotificationType

public String getNotificationType()

getResponsedContentLocation

public String getResponsedContentLocation()
Returns the value of the content-location header of the response. This shall be used to the request uri for a POLL method querying this subscription.

getResponsedSubscriptionId

public int getResponsedSubscriptionId()
Returns the subscription ID responsed from the server.
Returns:
-1 if no subscription id was in the response

getResponsedSubscriptionLifetime

public long getResponsedSubscriptionLifetime()
Returns the subscription lifetime responsed from the server.
Returns:
-1 if no subscription lifetime was given in the response

getSubsciptionLifetime

public long getSubsciptionLifetime()

getSubscriptionId

public long getSubscriptionId()

processResponseHeaders

protected void processResponseHeaders(HttpState state,
                                      HttpConnection conn)

recycle

public void recycle()
Overrides:
recycle in interface XMLResponseMethodBase

setCallback

public void setCallback(String callback)
Sets the URI that's to be notified if the subscribed event does occur.

setDepth

public void setDepth(int depth)
Sets the depth.
Specified by:
setDepth in interface DepthSupport

setNotificationDelay

public void setNotificationDelay(long delay)
Sets the notification delay in seconds.

setNotificationType

public void setNotificationType(String notificationType)
Sets the notification type, i.e. determines the events that are subscribed.

setRequestHeader

public void setRequestHeader(String headerName,
                             String headerValue)
Adds special checking of header values of the SUBSCRIBE method to the super class implementation.

setSubsciptionLifetime

public void setSubsciptionLifetime(long subsciptionLifetime)
Sets the duration of the subscription in seconds.

setSubscriptionId

public void setSubscriptionId(int subscriptionId)
Sets the ID of a subscription to be refreshed.
Parameters:
subscriptionId -