Package org.jboss.jbossts.star.client
Interface SRAApi
-
public interface SRAApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SRAInfobeginTransaction(Long timeout, TimeUnit unit)Begin a new SRA.SRAInfocancelTransaction(String txId)Cancel a SRASRAInfocommitTransaction(String txId)Commit a SRAjavax.ws.rs.core.ResponsedeleteParticipant(String enlistmentId)Performing DELETE on participant's recovery URL removes participant from the transaction.javax.ws.rs.core.ResponseenlistParticipant(String linkHeader, String txId, String content)Register a participant in a txjavax.ws.rs.core.ResponseenlistVolatileParticipant(String linkHeader, String txId)Register a volatile participant in a txList<SRAInfo>getAllTransactions()List of all transaction URIs known to the coordinator (active and in recovery)javax.ws.rs.core.ResponsegetTransactionExtStatus(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.TransactionManagerElementgetTransactionManagerInfo()Return extended information about the transaction-manager resource such as how long it has been up and all transaction-coordinator URIs.TransactionStatisticsElementgetTransactionStatistics()Return statistics for the transaction manager: number of active, prepared, committed, and aborted transactions are returned.StringgetTransactionStatus(String id)Get the current status for a transactionSRAInfogetTransactionURIs(String id)Obtain the transaction terminator and participant enlistment URIs for the specified transaction id.javax.ws.rs.core.ResponselookupParticipant(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.javax.ws.rs.core.ResponsepostParticipant(String enlistmentId)javax.ws.rs.core.ResponsereplaceParticipant(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.
-
-
-
Method Detail
-
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
javax.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
javax.ws.rs.core.Response enlistParticipant(String linkHeader, String txId, String content)
Register a participant in a tx- Parameters:
linkHeader- link headertxId- id of transactioncontent- 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
javax.ws.rs.core.Response enlistVolatileParticipant(String linkHeader, String txId)
Register a volatile participant in a tx- Parameters:
linkHeader- link headertxId- id of transaction- Returns:
- HTTP status code
-
lookupParticipant
javax.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 toenlistmentId- the resource reference- Returns:
- the participant url
-
replaceParticipant
javax.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 linkstxId- transaction id that this recovery url belongs toenlistmentId- id by the participant is known- Returns:
- http status code
-
postParticipant
javax.ws.rs.core.Response postParticipant(String enlistmentId)
-
deleteParticipant
javax.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
-
-