Package com.storedobject.core
Class TransactionInformation
java.lang.Object
com.storedobject.core.TransactionInformation
A structure that encapsulates all the objects (including links) involved in a transaction.
get(BigInteger)
method is used to create a TransactionInformation
structure
populated with all involved objects.- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Class that encapsulates a link involved in a transaction.final class
Class that encapsulates an object involved in the transaction. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Dump the object and link details to a "String Builder".static TransactionInformation
get
(BigInteger transactionId) Get theTransactionInformation.TransactionLink
for a particular transaction.Get the involved object for the given Id.<O extends StoredObject>
TransactionInformation.TransactionObject<O> getObject
(O object) Get the involved object for the given object.Get the timestamp of this transaction.Get the transaction Id.getUser()
Get the user who created this transaction.Get the user's Id who created this transaction.boolean
Check whether this transaction is in progress or not.boolean
Check whether this is an abandoned transaction or not.objects()
Get the objects involved in this transaction.<O extends StoredObject>
Stream<TransactionInformation.TransactionObject<O>> Get a particular type of objects involved in this transaction.
-
Method Details
-
get
Get theTransactionInformation.TransactionLink
for a particular transaction.- Parameters:
transactionId
- Transaction Id- Returns:
- The Transaction Link if available, otherwise
null
is returned.
-
getTransactionId
-
getTimestamp
Get the timestamp of this transaction.- Returns:
- Transaction timestamp.
-
getUser
Get the user who created this transaction.- Returns:
- User. (This will return
null
if the transaction was aborted by the system).
-
getUserId
-
isAbandoned
public boolean isAbandoned()Check whether this is an abandoned transaction or not.- Returns:
- True or false.
-
inProgress
public boolean inProgress()Check whether this transaction is in progress or not.- Returns:
- True or false.
-
objects
Get the objects involved in this transaction.- Returns:
- Stream of
TransactionInformation.TransactionObject
s.
-
objects
public <O extends StoredObject> Stream<TransactionInformation.TransactionObject<O>> objects(Class<O> objectClass, boolean any) Get a particular type of objects involved in this transaction.- Type Parameters:
O
- Type of objects to return- Parameters:
objectClass
- Call typeany
- Whether to return inherited types of not- Returns:
- Stream of
TransactionInformation.TransactionObject
s.
-
getObject
Get the involved object for the given Id.- Parameters:
id
- Id of the object- Returns:
- Transaction object for the Id passed.
-
getObject
Get the involved object for the given object.- Type Parameters:
O
- Type of the object- Parameters:
object
- Object for which involved object to be retrieved- Returns:
- Transaction object for the object passed.
-
dump
Dump the object and link details to a "String Builder".- Parameters:
s
- "String Builder" to which output should be written.
-