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
|
Instant |
getCreated()
Get the date this session was created
|
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
|
Map<String,String> |
getNamespaces()
Get a mapping of registered namespaces
|
Collection<String> |
getSessionData(String key)
Retrieve the session data for a given key
|
String |
getUserId()
Get the user identifier associated with this session
|
static Duration |
operationTimeout()
Retrieve the default operation timeout value
|
void |
removeSessionData(String key)
Remove all session data for a particular key
|
void |
removeSessionData(String key,
String value)
Remove a particular session key-value pair
|
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()
FedoraSessioncommit in interface FedoraSessionpublic void expire()
FedoraSessionexpire in interface FedoraSessionpublic Instant updateExpiry(Duration amountToAdd)
FedoraSessionupdateExpiry in interface FedoraSessionamountToAdd - the amount of time to addpublic Instant getCreated()
FedoraSessiongetCreated in interface FedoraSessionpublic Optional<Instant> getExpires()
FedoraSessiongetExpires in interface FedoraSessionpublic String getId()
FedoraSessiongetId in interface FedoraSessionpublic String getUserId()
FedoraSessiongetUserId in interface FedoraSessionpublic Map<String,String> getNamespaces()
FedoraSessiongetNamespaces in interface FedoraSessionpublic void addSessionData(String key, String value)
addSessionData in interface FedoraSessionkey - 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 Collection<String> getSessionData(String key)
FedoraSessiongetSessionData in interface FedoraSessionkey - the keypublic void removeSessionData(String key, String value)
FedoraSessionremoveSessionData in interface FedoraSessionkey - the data keyvalue - the data valuepublic void removeSessionData(String key)
FedoraSessionremoveSessionData in interface FedoraSessionkey - the data keypublic javax.jcr.Session getJcrSession()
public static javax.jcr.Session getJcrSession(FedoraSession session)
session - the FedoraSessionpublic static Duration operationTimeout()
Copyright © 2013–2017 DuraSpace, Inc.. All rights reserved.