@Component public class TransactionServiceImpl extends AbstractService implements org.fcrepo.kernel.services.TransactionService
Transaction service which is able to
create/commit/rollback Transaction objects A Scheduled
annotation is used for removing timed out Transactionsorg.modeshape.jcr.api.JcrTools.BasicOperation, org.modeshape.jcr.api.JcrTools.BrowseContent, org.modeshape.jcr.api.JcrTools.CountNodes, org.modeshape.jcr.api.JcrTools.NodeOperation, org.modeshape.jcr.api.JcrTools.Operation, org.modeshape.jcr.api.JcrTools.PrintNodes, org.modeshape.jcr.api.JcrTools.Variable| Modifier and Type | Field and Description |
|---|---|
static long |
REAP_INTERVAL |
repo| Constructor and Description |
|---|
TransactionServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.fcrepo.kernel.Transaction |
beginTransaction(javax.jcr.Session sess,
String userName)
Create a new Transaction and add it to the currently open ones
|
org.fcrepo.kernel.Transaction |
commit(String txid)
Commit a
Transaction with the given id |
boolean |
exists(String txid)
Check if a Transaction exists
|
static String |
getCurrentTransactionId(javax.jcr.Session session)
Get the current Transaction ID for a session
|
org.fcrepo.kernel.Transaction |
getTransaction(javax.jcr.Session session)
Get the current Transaction for a session
|
org.fcrepo.kernel.Transaction |
getTransaction(String txid)
Retrieve an open
Transaction |
boolean |
isAssociatedWithUser(String txId,
String userName)
Checks if a user is bound to a
Transaction |
void |
removeAndRollbackExpired()
Every REAP_INTERVAL milliseconds, check for expired transactions.
|
org.fcrepo.kernel.Transaction |
rollback(String txid)
Roll a
Transaction back |
void |
setVersionService(org.fcrepo.kernel.services.VersionService versionService) |
exists, setRepositoryfindOrCreateChild, findOrCreateChild, findOrCreateNode, findOrCreateNode, findOrCreateNode, findOrCreateNode, getNode, getReadable, getStringValue, importContent, importContent, importContent, importContent, importContent, importContent, importContent, isDebug, onEachNode, onEachNodeBelow, print, printNode, printQuery, printQuery, printQuery, printQuery, printSubgraph, printSubgraph, printSubgraph, registerNodeTypes, removeAllChildren, removeAllChildren, repeatedlyWithSession, resourceUrl, uploadFile, uploadFile, uploadFile, uploadFileAndBlock, uploadFileAndBlock, uploadFileAndBlock, uploadFilesAndBlock, var, vars, withSessionpublic static final long REAP_INTERVAL
@Scheduled(fixedRate=1000L) public void removeAndRollbackExpired()
removeAndRollbackExpired in interface org.fcrepo.kernel.services.TransactionServicepublic org.fcrepo.kernel.Transaction beginTransaction(javax.jcr.Session sess,
String userName)
throws javax.jcr.RepositoryException
beginTransaction in interface org.fcrepo.kernel.services.TransactionServicesess - The session to use for this TransactionTransactionjavax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.Transaction getTransaction(String txid) throws org.fcrepo.kernel.exception.TransactionMissingException
TransactiongetTransaction in interface org.fcrepo.kernel.services.TransactionServicetxid - the Id of the TransactionTransactionorg.fcrepo.kernel.exception.TransactionMissingExceptionpublic org.fcrepo.kernel.Transaction getTransaction(javax.jcr.Session session)
throws org.fcrepo.kernel.exception.TransactionMissingException
getTransaction in interface org.fcrepo.kernel.services.TransactionServicesession - org.fcrepo.kernel.exception.TransactionMissingExceptionpublic static String getCurrentTransactionId(javax.jcr.Session session)
session - public boolean exists(String txid)
exists in interface org.fcrepo.kernel.services.TransactionServicetxid - the Id of the TransactionTransactionpublic org.fcrepo.kernel.Transaction commit(String txid) throws javax.jcr.RepositoryException
Transaction with the given idcommit in interface org.fcrepo.kernel.services.TransactionServicetxid - the id of the Transactionjavax.jcr.RepositoryExceptionpublic org.fcrepo.kernel.Transaction rollback(String txid) throws javax.jcr.RepositoryException
Transaction backrollback in interface org.fcrepo.kernel.services.TransactionServicetxid - the id of the TransactionTransaction objectjavax.jcr.RepositoryException - if the Transaction could not be foundpublic boolean isAssociatedWithUser(String txId, String userName)
TransactionisAssociatedWithUser in interface org.fcrepo.kernel.services.TransactionServicetxId - the id of the TransactionuserName - the name of the Principalpublic void setVersionService(org.fcrepo.kernel.services.VersionService versionService)
setVersionService in interface org.fcrepo.kernel.services.TransactionServiceversionService - the versionService to setCopyright © 2013–2014 DuraSpace, Inc.. All rights reserved.