public class FedoraSessionImpl extends Object implements FedoraSession
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TIMEOUT |
static String |
FCREPO_TX_ID
A key for looking up the transaction id in a session key-value pair
|
static String |
TIMEOUT_SYSTEM_PROPERTY |
Constructor and Description |
---|
FedoraSessionImpl(javax.jcr.Session session)
Create a Fedora session with a JCR session
|
Modifier and Type | Method and Description |
---|---|
void |
addSessionData(String key,
String value)
Add session data
|
void |
commit()
Commit any batch operations
|
void |
expire()
Expire the session
|
Optional<Instant> |
getExpires()
Get the date this session expires
|
String |
getId()
Get the session identifier
|
javax.jcr.Session |
getJcrSession()
Get the internal JCR session
|
static javax.jcr.Session |
getJcrSession(FedoraSession session)
Get the internal JCR session from an existing FedoraSession
|
URI |
getUserURI()
Get the user URI
|
static Duration |
operationTimeout()
Retrieve the default operation timeout value
|
Instant |
updateExpiry(Duration amountToAdd)
Update the expiry by the provided amount
|
public static final String DEFAULT_TIMEOUT
public static final String TIMEOUT_SYSTEM_PROPERTY
public static final String FCREPO_TX_ID
public FedoraSessionImpl(javax.jcr.Session session)
session
- the JCR sessionpublic void commit()
FedoraSession
commit
in interface FedoraSession
public void expire()
FedoraSession
expire
in interface FedoraSession
public Instant updateExpiry(Duration amountToAdd)
FedoraSession
updateExpiry
in interface FedoraSession
amountToAdd
- the amount of time to addpublic Optional<Instant> getExpires()
FedoraSession
getExpires
in interface FedoraSession
public String getId()
FedoraSession
getId
in interface FedoraSession
public URI getUserURI()
FedoraSession
getUserURI
in interface FedoraSession
public void addSessionData(String key, String value)
addSessionData
in interface FedoraSession
key
- the data keyvalue
- the data value
Note: while the FedoraSession interface permits multi-valued
session data, this implementation constrains that to be single-valued.
That is, calling obj.addSessionData("key", "value1") followed by
obj.addSessionData("key", "value2") will result in only "value2" being associated
with the given key.public javax.jcr.Session getJcrSession()
public static javax.jcr.Session getJcrSession(FedoraSession session)
session
- the FedoraSessionpublic static Duration operationTimeout()
Copyright © 2013–2019 DuraSpace, Inc.. All rights reserved.