public interface Transaction
Transaction allows the application to define units of work, it can be created via Repository.createTransaction()| Modifier and Type | Interface and Description |
|---|---|
static class |
Transaction.Status
Defines the status of each
Resource that is part of the current active Transaction |
| Modifier and Type | Method and Description |
|---|---|
Map<Resource,Transaction.Status> |
getChangeSet()
|
String |
getId()
Returns the identifier of the
Transaction (unique for each Repository |
UUID |
getRepositoryId()
|
void |
invalidate()
After
Repository.commit(Transaction, String) or Repository.rollback(Transaction) the Transaction is invalidated
For internal usage only. |
boolean |
isActive()
Determines whether the
Transaction can still be used. |
boolean |
isChangeSetEmpty()
Whether there are any
Resources that are affected by the Transaction |
boolean |
register(Resource resource,
Transaction.Status status)
Tell the
Transaction the specified Resource will be affected during Repository.commit(Transaction, String)
For internal usage only. |
Map<Resource,Transaction.Status> getChangeSet()
Map of Resources and their Transaction.StatusString getId()
Transaction (unique for each RepositoryTransactionvoid invalidate()
Repository.commit(Transaction, String) or Repository.rollback(Transaction) the Transaction is invalidated
For internal usage only. Use Repository.commit(Transaction, String) or Repository.rollback(Transaction) insteadboolean isActive()
Transaction can still be used. It cannot be used after Repository.commit(Transaction, String) or Repository.rollback(Transaction) where calledtrue if the Transaction can still be used otherwise falseboolean isChangeSetEmpty()
Resources that are affected by the Transactiontrue if there are no Resources affected by the Transaction, otherwise falseboolean register(Resource resource, Transaction.Status status)
Transaction the specified Resource will be affected during Repository.commit(Transaction, String)
For internal usage only. Use the methods from Repository insteadresource - Resource to register to the Transactionstatus - Transaction.Status of the registered Resourcetrue if the registration modified the change set, otherwise falseNullPointerException - if any parameter is nullCopyright © 2013–2014 shadowhunt. All rights reserved.