@Transactional public class SessionBean extends java.lang.Object implements ISession
ISession
. Is merely a wrapper around the
SessionManager
Spring-singleton.Constructor and Description |
---|
SessionBean(SessionManager mgr,
Executor ex,
CurrentDetails cd,
LightAdminPrivileges adminPrivileges) |
Modifier and Type | Method and Description |
---|---|
int |
closeSession(Session session)
Closes session and releases all resources.
|
Session |
createSession(Principal principal,
java.lang.String credentials)
Creates a new session and returns it to the user.
|
Session |
createSessionWithTimeout(Principal principal,
long milliseconds)
|
Session |
createSessionWithTimeouts(Principal principal,
long timeToLiveMilliseconds,
long timeToIdleMilliseconds)
|
Session |
createUserSession(long timeToLiveMs,
long timeToIdleMs,
java.lang.String defaultGroup)
Allows a user to open up another session for him/herself with the given
defaults without needing to re-enter password.
|
java.lang.Object |
getInput(java.lang.String session,
java.lang.String key)
Retrieves an entry from the given
session's input
environment. |
java.util.Set<java.lang.String> |
getInputKeys(java.lang.String session)
Retrieves all keys in the
session's input environment. |
java.util.Map<java.lang.String,java.lang.Object> |
getInputs(java.lang.String session)
Retrieves all inputs from the given
session's input
environment. |
java.util.List<Session> |
getMyOpenAgentSessions(java.lang.String agent)
Like
ISession.getMyOpenSessions() but returns only those sessions
with the given agent string. |
java.util.List<Session> |
getMyOpenClientSessions()
Like
ISession.getMyOpenSessions() but returns only those sessions
started by official OMERO clients. |
java.util.List<Session> |
getMyOpenSessions()
Returns a list of open sessions for the current user.
|
java.lang.Object |
getOutput(java.lang.String session,
java.lang.String key)
Retrieves an entry from the
session's output environment. |
java.util.Set<java.lang.String> |
getOutputKeys(java.lang.String session)
Retrieves all keys in the
sesson's output environment. |
java.util.Map<java.lang.String,java.lang.Object> |
getOutputs(java.lang.String session)
Retrieves all outputs from the given
session's input
environment. |
int |
getReferenceCount(java.lang.String sessionUuid)
Retrieves the current reference count for the given uuid.
|
java.lang.Class<? extends ServiceInterface> |
getServiceInterface() |
Session |
getSession(java.lang.String sessionUuid)
Retrieves the session associated with this uuid, updating the last access
time as well.
|
void |
setInput(java.lang.String session,
java.lang.String key,
java.lang.Object object)
Places an entry in the given
session's input environment. |
void |
setOutput(java.lang.String session,
java.lang.String key,
java.lang.Object object)
Places an entry in the given
session's output
environment. |
Session |
updateSession(Session session) |
public SessionBean(SessionManager mgr, Executor ex, CurrentDetails cd, LightAdminPrivileges adminPrivileges)
public java.lang.Class<? extends ServiceInterface> getServiceInterface()
public Session createUserSession(long timeToLiveMs, long timeToIdleMs, java.lang.String defaultGroup)
ISession
createUserSession
in interface ISession
public Session createSessionWithTimeout(Principal principal, long milliseconds)
ISession
createSessionWithTimeout
in interface ISession
principal
- Non-null Principal
with the target user's namemilliseconds
- The time that this Session
has until destruction. This
is useful to override the server default so that an initial
delay before the user is given the token will not be construed
as idle time. A value less than 1 will cause the default max
timeToLive to be used; but timeToIdle will be disabled.public Session createSessionWithTimeouts(Principal principal, long timeToLiveMilliseconds, long timeToIdleMilliseconds)
ISession
createSessionWithTimeouts
in interface ISession
principal
- Non-null Principal
with the target user's nametimeToLiveMilliseconds
- The time that this Session
has until destruction.
Setting the value to 0 will prevent destruction unless the
session remains idle.timeToIdleMilliseconds
- The time that this Session
can remain idle before
being destroyed. Setting the value to 0 will prevent idleness
based destruction.public Session createSession(Principal principal, java.lang.String credentials)
ISession
createSession
in interface ISession
public Session getSession(java.lang.String sessionUuid)
ISession
RemovedSessionException
if not present, or
a SessionTimeoutException
if expired.
This method can be used as a Session
ping.getSession
in interface ISession
public int getReferenceCount(java.lang.String sessionUuid)
ISession
ISession.getSession(String)
.getReferenceCount
in interface ISession
public int closeSession(Session session)
ISession
closeSession
in interface ISession
public java.util.List<Session> getMyOpenSessions()
ISession
getMyOpenSessions
in interface ISession
public java.util.List<Session> getMyOpenAgentSessions(java.lang.String agent)
ISession
ISession.getMyOpenSessions()
but returns only those sessions
with the given agent string.getMyOpenAgentSessions
in interface ISession
public java.util.List<Session> getMyOpenClientSessions()
ISession
ISession.getMyOpenSessions()
but returns only those sessions
started by official OMERO clients.getMyOpenClientSessions
in interface ISession
public java.lang.Object getInput(java.lang.String session, java.lang.String key)
ISession
session's
input
environment.public java.lang.Object getOutput(java.lang.String session, java.lang.String key)
ISession
session's
output environment.public void setInput(java.lang.String session, java.lang.String key, java.lang.Object object)
ISession
session's
input environment.
If the value is null, the key will be removed.public void setOutput(java.lang.String session, java.lang.String key, java.lang.Object object)
ISession
session's
output
environment. If the value is null, the key will be removed.public java.util.Set<java.lang.String> getInputKeys(java.lang.String session)
ISession
session's
input environment.getInputKeys
in interface ISession
Set
of keyspublic java.util.Set<java.lang.String> getOutputKeys(java.lang.String session)
ISession
sesson's
output environment.getOutputKeys
in interface ISession
public java.util.Map<java.lang.String,java.lang.Object> getInputs(java.lang.String session)
ISession
session's
input
environment.public java.util.Map<java.lang.String,java.lang.Object> getOutputs(java.lang.String session)
ISession
session's
input
environment.getOutputs
in interface ISession
Version: 5.4.10-ice35-b105
Copyright © 2019 The University of Dundee & Open Microscopy Environment. All Rights Reserved.