org.apache.webdav.lib.methods

Class UnlockMethod


public class UnlockMethod
extends XMLResponseMethodBase

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

static int
ABORT_TRANSACTION
static int
COMMIT_TRANSACTION
static int
NO_TRANSACTION

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

builder, decodeResponseHrefs, responseURLs

Constructor Summary

UnlockMethod()
Method 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

void
addRequestHeaders(HttpState state, HttpConnection conn)
Generate additional headers needed by the request.
protected String
generateRequestBody()
String
getName()
int
getTransactionStatus()
Gets the parameter described in setTransactionStatus(int).
protected void
processResponseBody(HttpState state, HttpConnection conn)
void
recycle()
void
setLockToken(String lockToken)
void
setRequestHeader(String headerName, String headerValue)
Set header, handling the special case of the lock-token header so that it calls setLockToken(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, 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

ABORT_TRANSACTION

public static final int ABORT_TRANSACTION
Field Value:
0

COMMIT_TRANSACTION

public static final int COMMIT_TRANSACTION
Field Value:
1

NO_TRANSACTION

public static final int NO_TRANSACTION
Field Value:
-1

Constructor Details

UnlockMethod

public UnlockMethod()
Method constructor.

UnlockMethod

public UnlockMethod(String path)
Method constructor.

UnlockMethod

public UnlockMethod(String path,
                    String lockToken)
Method constructor.

UnlockMethod

public UnlockMethod(String path,
                    String txHandle,
                    int transactionStatus)
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 use LockMethod.
Parameters:
path - any path inside Slide's scope
txHandle - lock token specifying transaction handle
transactionStatus - status of transaction as described in setTransactionStatus(int)

Method Details

addRequestHeaders

public void addRequestHeaders(HttpState state,
                              HttpConnection conn)
            throws IOException,
                   HttpException
Generate additional headers needed by the request.
Parameters:
state - HttpState token
conn - The connection being used to send the request.

generateRequestBody

protected String generateRequestBody()
Overrides:
generateRequestBody in interface XMLResponseMethodBase

getName

public String getName()

getTransactionStatus

public int getTransactionStatus()
Returns:
either COMMIT_TRANSACTION or ABORT_TRANSACTION as the real transaction status or NO_TRANSACTION to indicate this method is not used for transaction control

processResponseBody

protected void processResponseBody(HttpState state,
                                   HttpConnection conn)

recycle

public void recycle()
Overrides:
recycle in interface XMLResponseMethodBase

setLockToken

public void setLockToken(String lockToken)

setRequestHeader

public void setRequestHeader(String headerName,
                             String headerValue)
Parameters:
headerName - Header name
headerValue - Header value

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 or ABORT_TRANSACTION to let the transaction abort discarding all changes associated to it.