org.apache.webdav.lib.methods
Class SubscribeMethod

java.lang.Object
  extended byorg.apache.commons.httpclient.HttpMethodBase
      extended byorg.apache.webdav.lib.methods.HttpRequestBodyMethodBase
          extended byorg.apache.webdav.lib.methods.XMLResponseMethodBase
              extended byorg.apache.webdav.lib.methods.SubscribeMethod
All Implemented Interfaces:
DepthSupport, HttpMethod

public class SubscribeMethod
extends XMLResponseMethodBase
implements DepthSupport

Implements the SUBSCRIBE method.

See Also:
Reference

Nested Class Summary
 
Nested classes inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
XMLResponseMethodBase.OptionsResponse, XMLResponseMethodBase.Response, XMLResponseMethodBase.ResponseWithinMultistatus, XMLResponseMethodBase.SingleResponse
 
Field Summary
static java.lang.String TYPE_DELETE
           
static java.lang.String TYPE_MOVE
           
static java.lang.String TYPE_UPDATE
           
static java.lang.String TYPE_UPDATE_NEW_MEMBER
           
 
Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, responseURLs
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Fields inherited from interface org.apache.webdav.lib.methods.DepthSupport
DEPTH_0, DEPTH_1, DEPTH_INFINITY
 
Constructor Summary
SubscribeMethod()
           
SubscribeMethod(java.lang.String path)
           
 
Method Summary
protected  void addRequestHeaders(HttpState state, HttpConnection conn)
           
 java.lang.String getCallback()
           
 int getDepth()
          Depth getter.
 java.lang.String getName()
           
 long getNotificationDelay()
           
 java.lang.String getNotificationType()
           
 java.lang.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()
          Reset the State of the class to its initial state, so that it can be used again.
 void setCallback(java.lang.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(java.lang.String notificationType)
          Sets the notification type, i.e. determines the events that are subscribed.
 void setRequestHeader(java.lang.String headerName, java.lang.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, 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
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, fakeResponse, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getMethodRetryHandler, getPath, getProxyAuthenticationRealm, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isConnectionCloseForced, isHttp11, isStrictMode, processResponseBody, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setPath, setQueryString, setQueryString, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UPDATE

public static final java.lang.String TYPE_UPDATE
See Also:
Constant Field Values

TYPE_UPDATE_NEW_MEMBER

public static final java.lang.String TYPE_UPDATE_NEW_MEMBER
See Also:
Constant Field Values

TYPE_DELETE

public static final java.lang.String TYPE_DELETE
See Also:
Constant Field Values

TYPE_MOVE

public static final java.lang.String TYPE_MOVE
See Also:
Constant Field Values
Constructor Detail

SubscribeMethod

public SubscribeMethod()

SubscribeMethod

public SubscribeMethod(java.lang.String path)
Method Detail

getCallback

public java.lang.String getCallback()

setCallback

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


getNotificationType

public java.lang.String getNotificationType()

setNotificationType

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

See Also:
TYPE_DELETE, TYPE_MOVE, TYPE_UPDATE, TYPE_UPDATE_NEW_MEMBER

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 interface DepthSupport
Returns:
int depth value

setDepth

public void setDepth(int depth)
Sets the depth.

Specified by:
setDepth in interface DepthSupport
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

public java.lang.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.


getName

public java.lang.String getName()
Specified by:
getName in interface HttpMethod

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 interface HttpMethod
Overrides:
recycle in class XMLResponseMethodBase

addRequestHeaders

protected void addRequestHeaders(HttpState state,
                                 HttpConnection conn)
                          throws java.io.IOException,
                                 HttpException
Throws:
java.io.IOException
HttpException

setRequestHeader

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

Specified by:
setRequestHeader in interface HttpMethod

processResponseHeaders

protected void processResponseHeaders(HttpState state,
                                      HttpConnection conn)