Interface SRAApi


public interface SRAApi
  • Method Details

    • getAllTransactions

      List<SRAInfo> getAllTransactions()
      List of all transaction URIs known to the coordinator (active and in recovery)
    • getTransactionManagerInfo

      TransactionManagerElement getTransactionManagerInfo()
      Return extended information about the transaction-manager resource such as how long it has been up and all transaction-coordinator URIs.
    • getTransactionStatistics

      TransactionStatisticsElement getTransactionStatistics()
      Return statistics for the transaction manager: number of active, prepared, committed, and aborted transactions are returned.
      Returns:
      TransactionStatisticsElement
    • getTransactionURIs

      SRAInfo getTransactionURIs(String id)
      Obtain the transaction terminator and participant enlistment URIs for the specified transaction id.
      Parameters:
      id - URL template parameter for the transaction id
      Returns:
    • getTransactionStatus

      String getTransactionStatus(String id)
      Get the current status for a transaction
      Parameters:
      id - the id of the transaction
      Returns:
      content representing the status of the transaction
    • getTransactionExtStatus

      jakarta.ws.rs.core.Response getTransactionExtStatus(String id)
      Performing a GET on the transaction URL with media type application/txstatusext+xml returns extended information about the transaction, such as its status, number of participants, and their individual URIs.
      Parameters:
      id - the id of the transaction
      Returns:
      HTTP response representing extended transaction status information
    • beginTransaction

      SRAInfo beginTransaction(Long timeout, TimeUnit unit) throws GenericSRAException
      Begin a new SRA.
      Parameters:
      timeout - the number of milliseconds after which the transaction is eligible for being timed out.
      Returns:
      SRA info
      Throws:
      GenericSRAException
    • commitTransaction

      SRAInfo commitTransaction(String txId)
      Commit a SRA
      Parameters:
      txId - id of the SRA to commit
      Returns:
      SRA status
    • cancelTransaction

      SRAInfo cancelTransaction(String txId)
      Cancel a SRA
      Parameters:
      txId - id of the SRA to cancel
      Returns:
      SRA status
    • enlistParticipant

      jakarta.ws.rs.core.Response enlistParticipant(String linkHeader, String txId, String content)
      Register a participant in a tx
      Parameters:
      linkHeader - link header
      txId - id of transaction
      content - body of request containing URI for driving the participant through completion (the URI should be unique within the scope of txId)
      Returns:
      unique resource ref for the participant
    • enlistVolatileParticipant

      jakarta.ws.rs.core.Response enlistVolatileParticipant(String linkHeader, String txId)
      Register a volatile participant in a tx
      Parameters:
      linkHeader - link header
      txId - id of transaction
      Returns:
      HTTP status code
    • lookupParticipant

      jakarta.ws.rs.core.Response lookupParticipant(String txId, String enlistmentId)
      Get the participant url (registered during enlistParticipant) corresponding to a resource reference if the coordinator crashes - the participant list will be empty but this is ok if commit hasn't been called since the TM uses presumed abort semantics.
      Parameters:
      txId - transaction id that this recovery url belongs to
      enlistmentId - the resource reference
      Returns:
      the participant url
    • replaceParticipant

      jakarta.ws.rs.core.Response replaceParticipant(String linkHeader, String txId, String enlistmentId)
      PUT /recovery-coordinator/_RecCoordId_/_new participant URL_ - overwrite the old participant URL with new participant URL (as with JTS, this will also trigger off a recovery attempt on the associated transaction) A participant may use this url to notifiy the coordinator that he has moved to a new location.
      Parameters:
      linkHeader - link header containing participant links
      txId - transaction id that this recovery url belongs to
      enlistmentId - id by the participant is known
      Returns:
      http status code
    • postParticipant

      jakarta.ws.rs.core.Response postParticipant(String enlistmentId)
    • deleteParticipant

      jakarta.ws.rs.core.Response deleteParticipant(String enlistmentId)
      Performing DELETE on participant's recovery URL removes participant from the transaction.
      Parameters:
      enlistmentId - The resource reference
      Returns:
      HTTP status code