public class TransactionImpl extends Object implements Transaction
Transaction.State
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT |
static String |
TIMEOUT_SYSTEM_PROPERTY |
Constructor and Description |
---|
TransactionImpl(javax.jcr.Session session,
String userName)
Create a transaction for the given Session
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
"Commit" the transaction by saving the backing-session
|
void |
expire()
End the session, and mark for reaping
|
Date |
getCreated()
Get the date this transaction was created
|
Date |
getExpires()
Get the Date when this transaction is expired and can be
garbage-collected
|
String |
getId()
Get the transaction identifier
|
javax.jcr.Session |
getSession()
Get the transaction-aware session
|
Transaction.State |
getState()
Get the state of this transaction
|
boolean |
isAssociatedWithUser(String userName)
Checks if this transaction is associated with a specific user.
|
void |
rollback()
Discard all unpersisted changes and expire
|
void |
updateExpiryDate()
Roll forward the expiration date for recent activity
|
public static final long DEFAULT_TIMEOUT
public static final String TIMEOUT_SYSTEM_PROPERTY
public TransactionImpl(javax.jcr.Session session, String userName)
session
- public javax.jcr.Session getSession()
Transaction
getSession
in interface Transaction
public Date getCreated()
Transaction
getCreated
in interface Transaction
public String getId()
Transaction
getId
in interface Transaction
public Transaction.State getState() throws javax.jcr.RepositoryException
Transaction
getState
in interface Transaction
javax.jcr.RepositoryException
public Date getExpires()
Transaction
getExpires
in interface Transaction
public void commit()
Transaction
commit
in interface Transaction
public void expire()
Transaction
expire
in interface Transaction
public boolean isAssociatedWithUser(String userName)
Transaction
isAssociatedWithUser
in interface Transaction
userName
- the userpublic void rollback()
Transaction
rollback
in interface Transaction
public void updateExpiryDate()
Transaction
updateExpiryDate
in interface Transaction
Copyright © 2013-2015 DuraSpace, Inc.. All Rights Reserved.