Package oracle.tmm.tcc
Interface TccTransaction
public interface TccTransaction
TccTransaction - Interface for managing a TCC transaction
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTccParticipant
(TccParticipant tccParticipant) Add a participant to the current transactioncancel
(CancelRequest request) Cancel the TCC transaction optionally adding additional participantsconfirm
(ConfirmRequest request) Confirm the TCC transaction optionally adding additional participantsGet a list of participants in the current transactionlong
Get the time limit in milliseconds for the current transactionGet the current transaction idGet the TCC transaction stateGet the current transaction internal urlvoid
setTimeLimit
(long timeLimit) Set the time limit in milliseconds for the current transaction
-
Field Details
-
APPLICATION_TCC_JSON
TCC coordinator endpoints media type- See Also:
-
HEADER_TCC_LINK_REL_VAL
- See Also:
-
HEADER_TCC_PARTICIPANT_REL_VAL
- See Also:
-
HEADER_TCC_TIME_LIMIT_PARAM_VAL
- See Also:
-
-
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
ConfirmResponse confirm(ConfirmRequest request) throws TccException, TccUnknownTransactionException, TccHeuristicException Confirm the TCC transaction optionally adding additional participantsThis 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 coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants confirmed
-
cancel
CancelResponse cancel(CancelRequest request) throws TccException, TccUnknownTransactionException, TccHeuristicException Cancel the TCC transaction optionally adding additional participantsThis 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 coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants cancelled
-
getTransactionState
Get the TCC transaction stateThis 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 coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator side
-
addTccParticipant
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
-