Package org.fcrepo.kernel.impl
Class TransactionImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.TransactionImpl
-
- All Implemented Interfaces:
org.fcrepo.kernel.api.Transaction
public class TransactionImpl extends Object implements org.fcrepo.kernel.api.Transaction
The Fedora Transaction implementation- Author:
- mohideen
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTransactionImpl(String id, TransactionManagerImpl txManager, Duration sessionTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()voidcommitIfShortLived()voiddoInTx(Runnable runnable)voidensureCommitting()voidexpire()voidfail()InstantgetExpires()StringgetId()booleanhasExpired()booleanisCommitted()booleanisOpen()booleanisOpenLongRunning()booleanisReadOnly()booleanisRolledBack()booleanisShortLived()voidlockResource(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)voidlockResourceAndGhostNodes(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)If you create an object with ghost nodes above it, we need to lock those paths as well to ensure no other operation alters them while the current transaction is in process.voidlockResourceNonExclusive(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)voidrefresh()voidreleaseResourceLocksIfShortLived()voidrollback()voidsetBaseUri(String baseUri)voidsetShortLived(boolean shortLived)voidsetUserAgent(String userAgent)voidsuppressEvents()StringtoString()InstantupdateExpiry(Duration amountToAdd)
-
-
-
Constructor Detail
-
TransactionImpl
protected TransactionImpl(String id, TransactionManagerImpl txManager, Duration sessionTimeout)
-
-
Method Detail
-
commit
public void commit()
- Specified by:
commitin interfaceorg.fcrepo.kernel.api.Transaction
-
isCommitted
public boolean isCommitted()
- Specified by:
isCommittedin interfaceorg.fcrepo.kernel.api.Transaction
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceorg.fcrepo.kernel.api.Transaction
-
doInTx
public void doInTx(Runnable runnable)
- Specified by:
doInTxin interfaceorg.fcrepo.kernel.api.Transaction
-
fail
public void fail()
- Specified by:
failin interfaceorg.fcrepo.kernel.api.Transaction
-
isRolledBack
public boolean isRolledBack()
- Specified by:
isRolledBackin interfaceorg.fcrepo.kernel.api.Transaction
-
setShortLived
public void setShortLived(boolean shortLived)
- Specified by:
setShortLivedin interfaceorg.fcrepo.kernel.api.Transaction
-
isShortLived
public boolean isShortLived()
- Specified by:
isShortLivedin interfaceorg.fcrepo.kernel.api.Transaction
-
isOpenLongRunning
public boolean isOpenLongRunning()
- Specified by:
isOpenLongRunningin interfaceorg.fcrepo.kernel.api.Transaction
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceorg.fcrepo.kernel.api.Transaction
-
ensureCommitting
public void ensureCommitting()
- Specified by:
ensureCommittingin interfaceorg.fcrepo.kernel.api.Transaction
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceorg.fcrepo.kernel.api.Transaction
-
expire
public void expire()
- Specified by:
expirein interfaceorg.fcrepo.kernel.api.Transaction
-
hasExpired
public boolean hasExpired()
- Specified by:
hasExpiredin interfaceorg.fcrepo.kernel.api.Transaction
-
updateExpiry
public Instant updateExpiry(Duration amountToAdd)
- Specified by:
updateExpiryin interfaceorg.fcrepo.kernel.api.Transaction
-
getExpires
public Instant getExpires()
- Specified by:
getExpiresin interfaceorg.fcrepo.kernel.api.Transaction
-
commitIfShortLived
public void commitIfShortLived()
- Specified by:
commitIfShortLivedin interfaceorg.fcrepo.kernel.api.Transaction
-
refresh
public void refresh()
- Specified by:
refreshin interfaceorg.fcrepo.kernel.api.Transaction
-
lockResource
public void lockResource(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
- Specified by:
lockResourcein interfaceorg.fcrepo.kernel.api.Transaction
-
lockResourceNonExclusive
public void lockResourceNonExclusive(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
- Specified by:
lockResourceNonExclusivein interfaceorg.fcrepo.kernel.api.Transaction
-
lockResourceAndGhostNodes
public void lockResourceAndGhostNodes(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
If you create an object with ghost nodes above it, we need to lock those paths as well to ensure no other operation alters them while the current transaction is in process.- Specified by:
lockResourceAndGhostNodesin interfaceorg.fcrepo.kernel.api.Transaction- Parameters:
resourceId- the resource we are creating
-
releaseResourceLocksIfShortLived
public void releaseResourceLocksIfShortLived()
- Specified by:
releaseResourceLocksIfShortLivedin interfaceorg.fcrepo.kernel.api.Transaction
-
setBaseUri
public void setBaseUri(String baseUri)
- Specified by:
setBaseUriin interfaceorg.fcrepo.kernel.api.Transaction
-
setUserAgent
public void setUserAgent(String userAgent)
- Specified by:
setUserAgentin interfaceorg.fcrepo.kernel.api.Transaction
-
suppressEvents
public void suppressEvents()
- Specified by:
suppressEventsin interfaceorg.fcrepo.kernel.api.Transaction
-
-