Package org.apache.webdav.lib.methods
Class UnlockMethod
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.UnlockMethod
- All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod
UNLOCK Method.
-
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 int
static final int
static final int
Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, decodeResponseHrefs, responseURLs
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
effectiveVersion, statusLine
-
Constructor Summary
ConstructorsConstructorDescriptionMethod constructor.UnlockMethod
(String path) Method constructor.UnlockMethod
(String path, String lockToken) Method constructor.UnlockMethod
(String path, String txHandle, int transactionStatus) Creates an unlock method that ends a transaction when server supports them in a MS like style. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestHeaders
(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) Generate additional headers needed by the request.protected String
DAV requests that contain a body must override this function to generate that body.getName()
int
Gets the parameter described insetTransactionStatus(int)
.protected void
processResponseBody
(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
setLockToken
(String lockToken) void
setRequestHeader
(String headerName, String headerValue) Set header, handling the special case of the lock-token header so that it callssetLockToken(java.lang.String)
instead.void
setTransactionStatus
(int transactionStatus) Sets the transaction status of this method when it is used to end a externally controlled transaction.Methods inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
convertElementToProperty, 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, processResponseHeaders, 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
-
NO_TRANSACTION
public static final int NO_TRANSACTION- See Also:
-
ABORT_TRANSACTION
public static final int ABORT_TRANSACTION- See Also:
-
COMMIT_TRANSACTION
public static final int COMMIT_TRANSACTION- See Also:
-
-
Constructor Details
-
UnlockMethod
Creates an unlock method that ends a transaction when server supports them in a MS like style. The transacion handle of transaction is stored as the lock token.
To start a transaction useLockMethod
.- Parameters:
path
- any path inside Slide's scopetxHandle
- lock token specifying transaction handletransactionStatus
- status of transaction as described insetTransactionStatus(int)
-
UnlockMethod
public UnlockMethod()Method constructor. -
UnlockMethod
Method constructor. -
UnlockMethod
Method constructor.
-
-
Method Details
-
setLockToken
-
getTransactionStatus
public int getTransactionStatus()Gets the parameter described insetTransactionStatus(int)
.- Returns:
- either
COMMIT_TRANSACTION
orABORT_TRANSACTION
as the real transaction status orNO_TRANSACTION
to indicate this method is not used for transaction control
-
setTransactionStatus
public void setTransactionStatus(int transactionStatus) Sets the transaction status of this method when it is used to end a externally controlled transaction.- Parameters:
transactionStatus
-COMMIT_TRANSACTION
to set the status to successful commit orABORT_TRANSACTION
to let the transaction abort discarding all changes associated to it.
-
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
-
setRequestHeader
Set header, handling the special case of the lock-token header so that it callssetLockToken(java.lang.String)
instead.- Specified by:
setRequestHeader
in interfaceorg.apache.commons.httpclient.HttpMethod
- Overrides:
setRequestHeader
in classorg.apache.commons.httpclient.HttpMethodBase
- Parameters:
headerName
- Header nameheaderValue
- Header value
-
addRequestHeaders
public void addRequestHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException Generate additional headers needed by the request.- Overrides:
addRequestHeaders
in classorg.apache.commons.httpclient.HttpMethodBase
- Parameters:
state
- HttpState tokenconn
- The connection being used to send the request.- Throws:
IOException
org.apache.commons.httpclient.HttpException
-
generateRequestBody
Description copied from class:XMLResponseMethodBase
DAV requests that contain a body must override this function to generate that body.The default behavior simply returns an empty body.
- Overrides:
generateRequestBody
in classXMLResponseMethodBase
-
processResponseBody
protected void processResponseBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) - Overrides:
processResponseBody
in classorg.apache.commons.httpclient.HttpMethodBase
-