Package org.apache.webdav.lib.methods
Class SubscribeMethod
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
org.apache.webdav.lib.methods.XMLResponseMethodBase
org.apache.webdav.lib.methods.SubscribeMethod
- All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod
,DepthSupport
Implements the SUBSCRIBE method.
- See Also:
-
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
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, decodeResponseHrefs, responseURLs
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
effectiveVersion, statusLine
Fields inherited from interface org.apache.webdav.lib.methods.DepthSupport
DEPTH_0, DEPTH_1, DEPTH_INFINITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRequestHeaders
(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) int
getDepth()
Depth getter.getName()
long
Returns the value of the content-location header of the response.int
Returns the subscription ID responsed from the server.long
Returns the subscription lifetime responsed from the server.long
long
protected void
processResponseHeaders
(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) void
recycle()
Reset the State of the class to its initial state, so that it can be used again.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, getResponses, getResponseURLs, parseResponse, parseXMLResponse, readResponseBody, setDebug, setDecodeResponseHrefs, setDocument, setResponseHashtable, writeRequestBody
Methods inherited from class org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
isRequestContentAlreadySet, readContinueCode, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processCookieHeaders, processResponseBody, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
-
Field Details
-
TYPE_UPDATE
- See Also:
-
TYPE_UPDATE_NEW_MEMBER
- See Also:
-
TYPE_DELETE
- See Also:
-
TYPE_MOVE
- See Also:
-
-
Constructor Details
-
SubscribeMethod
public SubscribeMethod() -
SubscribeMethod
-
-
Method Details
-
getCallback
-
setCallback
Sets the URI that's to be notified if the subscribed event does occur. -
getNotificationType
-
setNotificationType
Sets the notification type, i.e. determines the events that are subscribed.- See Also:
-
getSubsciptionLifetime
public long getSubsciptionLifetime() -
setSubsciptionLifetime
public void setSubsciptionLifetime(long subsciptionLifetime) Sets the duration of the subscription in seconds. -
getSubscriptionId
public long getSubscriptionId() -
setSubscriptionId
public void setSubscriptionId(int subscriptionId) Sets the ID of a subscription to be refreshed.- Parameters:
subscriptionId
-
-
setNotificationDelay
public void setNotificationDelay(long delay) Sets the notification delay in seconds. -
getNotificationDelay
public long getNotificationDelay() -
getDepth
public int getDepth()Description copied from interface:DepthSupport
Depth getter.- Specified by:
getDepth
in interfaceDepthSupport
- Returns:
- int depth value
-
setDepth
public void setDepth(int depth) Sets the depth.- Specified by:
setDepth
in interfaceDepthSupport
- Parameters:
depth
- New depth value
-
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
-
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. -
getName
- Specified by:
getName
in interfaceorg.apache.commons.httpclient.HttpMethod
- Specified by:
getName
in classorg.apache.commons.httpclient.HttpMethodBase
-
recycle
public void recycle()Description copied from class:XMLResponseMethodBase
Reset the State of the class to its initial state, so that it can be used again.- Specified by:
recycle
in interfaceorg.apache.commons.httpclient.HttpMethod
- Overrides:
recycle
in classXMLResponseMethodBase
-
addRequestHeaders
protected void addRequestHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException - Overrides:
addRequestHeaders
in classorg.apache.commons.httpclient.HttpMethodBase
- Throws:
IOException
org.apache.commons.httpclient.HttpException
-
setRequestHeader
Adds special checking of header values of the SUBSCRIBE method to the super class implementation.- Specified by:
setRequestHeader
in interfaceorg.apache.commons.httpclient.HttpMethod
- Overrides:
setRequestHeader
in classorg.apache.commons.httpclient.HttpMethodBase
-
processResponseHeaders
protected void processResponseHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) - Overrides:
processResponseHeaders
in classorg.apache.commons.httpclient.HttpMethodBase
-