Interface TccTransaction


public interface TccTransaction
TccTransaction - Interface for managing a TCC transaction
  • Field Details

  • Method Details

    • getTransactionUrl

      String getTransactionUrl()
      Get the current transaction internal url
      Returns:
      transaction URL
    • getTransactionId

      String getTransactionId()
      Get the current transaction id
      Returns:
      transaction ID
    • confirm

      Confirm the TCC transaction optionally adding additional participants

      This asks the transaction coordinator to confirm all the participants in the transaction including those added by this call.

      Parameters:
      request - optional list of TccParticipants to be included in the confirmation of the transaction
      Returns:
      returns the list of participants with their updated state
      Throws:
      TccException - some failure occurred communicating with the transaction coordinator
      TccUnknownTransactionException - transaction not found or unknown error at coordinator side
      TccHeuristicException - not all the participants confirmed
    • cancel

      Cancel the TCC transaction optionally adding additional participants

      This asks the transaction coordinator to cancel all the participants in the transaction including those added by this call.

      Parameters:
      request - optional list of TccParticipants to be included in the cancelling of the transaction
      Returns:
      CancelResponse includes participant and transaction status
      Throws:
      TccException - some failure occurred communicating with the transaction coordinator
      TccUnknownTransactionException - transaction not found or unknown error at coordinator side
      TccHeuristicException - not all the participants cancelled
    • getTransactionState

      Get the TCC transaction state

      This asks the transaction coordinator to return the status of the transaction along with participant status

      Returns:
      transaction state
      Throws:
      TccException - some failure occurred communicating with the transaction coordinator
      TccUnknownTransactionException - transaction not found or unknown error at coordinator side
    • addTccParticipant

      void addTccParticipant(TccParticipant tccParticipant)
      Add a participant to the current transaction
      Parameters:
      tccParticipant - TCC participant to be included in the transaction associated to the current thread
    • getTccParticipants

      List<TccParticipant> getTccParticipants()
      Get a list of participants in the current transaction
      Returns:
      list of participants
    • setTimeLimit

      void setTimeLimit(long timeLimit)
      Set the time limit in milliseconds for the current transaction
      Parameters:
      timeLimit - time limit in milliseconds
    • getTimeLimit

      long getTimeLimit()
      Get the time limit in milliseconds for the current transaction
      Returns:
      time limit in milliseconds