public interface FedoraSession
Modifier and Type | Method and Description |
---|---|
void |
addSessionData(String key,
String value)
Add session-specific 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
|
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
|
default 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
|
void expire()
void commit()
Instant updateExpiry(Duration amountToAdd)
amountToAdd
- the amount of time to addInstant getCreated()
Optional<Instant> getExpires()
String getUserId()
Map<String,String> getNamespaces()
void addSessionData(String key, String value)
key
- the keyvalue
- the value
Note: it is up to the particular implementation as to whether multi-valued session data
is allowed.Collection<String> getSessionData(String key)
key
- the keyvoid removeSessionData(String key, String value)
key
- the data keyvalue
- the data valuedefault void removeSessionData(String key)
key
- the data keyCopyright © 2013–2018 DuraSpace, Inc.. All rights reserved.