public interface Transaction extends View
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. |
void |
invalidate()
After
Repository.commit(Transaction, String, boolean) or
Repository.rollback(Transaction) the Transaction is
invalidated. |
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, boolean). |
getHeadRevision, getRepositoryIdMap<Resource,Transaction.Status> getChangeSet()
Map of Resources and their Transaction.StatusString getId()
Transaction (unique for each
Repository.Transactionvoid invalidate()
Repository.commit(Transaction, String, boolean) or
Repository.rollback(Transaction) the Transaction is
invalidated.
For internal usage only. Use
Repository.commit(Transaction, String, boolean) or
Repository.rollback(Transaction) insteadboolean isActive()
Transaction can still be used. It cannot
be used after Repository.commit(Transaction, String, boolean) or
Repository.rollback(Transaction) where called.true if the Transaction can still be used
otherwise falseboolean isChangeSetEmpty()
Resources that are affected by the
Transaction.true 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, boolean).
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–2017 shadowhunt. All rights reserved.