Class UnlockMethod

java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod

public class UnlockMethod extends XMLResponseMethodBase
UNLOCK Method.
  • Field Details

  • Constructor Details

    • 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)
    • UnlockMethod

      public UnlockMethod()
      Method constructor.
    • UnlockMethod

      public UnlockMethod(String path)
      Method constructor.
    • UnlockMethod

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

    • setLockToken

      public void setLockToken(String lockToken)
    • getTransactionStatus

      public int getTransactionStatus()
      Gets the parameter described in setTransactionStatus(int).
      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
    • 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.
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.commons.httpclient.HttpMethod
      Specified by:
      getName in class org.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 interface org.apache.commons.httpclient.HttpMethod
      Overrides:
      recycle in class XMLResponseMethodBase
    • setRequestHeader

      public void setRequestHeader(String headerName, String headerValue)
      Set header, handling the special case of the lock-token header so that it calls setLockToken(java.lang.String) instead.
      Specified by:
      setRequestHeader in interface org.apache.commons.httpclient.HttpMethod
      Overrides:
      setRequestHeader in class org.apache.commons.httpclient.HttpMethodBase
      Parameters:
      headerName - Header name
      headerValue - 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 class org.apache.commons.httpclient.HttpMethodBase
      Parameters:
      state - HttpState token
      conn - The connection being used to send the request.
      Throws:
      IOException
      org.apache.commons.httpclient.HttpException
    • generateRequestBody

      protected String 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 class XMLResponseMethodBase
    • processResponseBody

      protected void processResponseBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn)
      Overrides:
      processResponseBody in class org.apache.commons.httpclient.HttpMethodBase