Package org.mycore.ocfl
Class MCROCFLPersistenceTransaction
java.lang.Object
org.mycore.ocfl.MCROCFLPersistenceTransaction
- All Implemented Interfaces:
MCRPersistenceTransaction
- Author:
- Tobias Lenhardt [Hammer1279], Thomas Scheffler (yagee)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addClassficationEvent
(MCRCategoryID id, char type) Add Classifications to get Updated/Deleted once the Transaction gets Committedvoid
begin()
Start a transaction.void
commit()
Commit the current transaction, writing any unflushed changes to the backend.boolean
Determine whether the current transaction has been marked for rollback.boolean
isActive()
Indicate whether a transaction is in progress.boolean
isReady()
preconditions in the backend are met and this instance should be used for transactionsvoid
rollback()
Roll back the current transaction.
-
Constructor Details
-
MCROCFLPersistenceTransaction
public MCROCFLPersistenceTransaction()
-
-
Method Details
-
isReady
public boolean isReady()Description copied from interface:MCRPersistenceTransaction
preconditions in the backend are met and this instance should be used for transactions- Specified by:
isReady
in interfaceMCRPersistenceTransaction
- Returns:
- true if this instance is ready for transaction handling, e.g. underlaying database is configured
-
begin
public void begin()Description copied from interface:MCRPersistenceTransaction
Start a transaction.- Specified by:
begin
in interfaceMCRPersistenceTransaction
-
commit
public void commit()Description copied from interface:MCRPersistenceTransaction
Commit the current transaction, writing any unflushed changes to the backend.- Specified by:
commit
in interfaceMCRPersistenceTransaction
-
rollback
public void rollback()Description copied from interface:MCRPersistenceTransaction
Roll back the current transaction.- Specified by:
rollback
in interfaceMCRPersistenceTransaction
-
getRollbackOnly
public boolean getRollbackOnly()Description copied from interface:MCRPersistenceTransaction
Determine whether the current transaction has been marked for rollback.- Specified by:
getRollbackOnly
in interfaceMCRPersistenceTransaction
- Returns:
- boolean indicating whether the transaction has been marked for rollback
-
isActive
public boolean isActive()Description copied from interface:MCRPersistenceTransaction
Indicate whether a transaction is in progress.- Specified by:
isActive
in interfaceMCRPersistenceTransaction
- Returns:
- boolean indicating whether transaction is in progress
-
addClassficationEvent
Add Classifications to get Updated/Deleted once the Transaction gets Committed- Parameters:
id
- The ID of the Classificationtype
- 'A' for created, 'M' for modified, 'D' deleted
-