public final class TransactionImpl extends Object implements Transaction, View
Transaction.Transaction.Status| Constructor and Description |
|---|
TransactionImpl(String id,
UUID repositoryId,
Revision headRevision) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Map<Resource,Transaction.Status> |
getChangeSet()
|
Revision |
getHeadRevision()
|
String |
getId()
Returns the identifier of the
Transaction (unique for each
Repository. |
UUID |
getRepositoryId()
|
int |
hashCode() |
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). |
Transaction.Status |
status(Resource resource) |
String |
toString() |
public Map<Resource,Transaction.Status> getChangeSet()
TransactiongetChangeSet in interface TransactionMap of Resources and their Transaction.Statuspublic Revision getHeadRevision()
ViewgetHeadRevision in interface ViewRevision supported by this Viewpublic String getId()
TransactionTransaction (unique for each
Repository.getId in interface TransactionTransactionpublic UUID getRepositoryId()
ViewgetRepositoryId in interface ViewUUID of the Repositorypublic void invalidate()
TransactionRepository.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) insteadinvalidate in interface Transactionpublic boolean isActive()
TransactionTransaction can still be used. It cannot
be used after Repository.commit(Transaction, String, boolean) or
Repository.rollback(Transaction) where called.isActive in interface Transactiontrue if the Transaction can still be used
otherwise falsepublic boolean isChangeSetEmpty()
TransactionResources that are affected by the
Transaction.isChangeSetEmpty in interface Transactiontrue if there are no Resources affected by the
Transaction, otherwise falsepublic boolean register(Resource resource, Transaction.Status status)
TransactionTransaction the specified Resource will be
affected during Repository.commit(Transaction, String, boolean).
For internal usage only. Use the methods from Repository insteadregister in interface Transactionresource - Resource to register to the Transactionstatus - Transaction.Status of the registered Resourcetrue if the registration modified the change set,
otherwise falsepublic Transaction.Status status(Resource resource)
Copyright © 2013–2017 shadowhunt. All rights reserved.