public class SecurityManager.SessionSecurityManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<SecuritySession> |
listOfSess
List of sessions.
|
private int |
nextUserSessionID
Next available, unique user session ID.
|
| Constructor and Description |
|---|
SessionSecurityManager() |
| Modifier and Type | Method and Description |
|---|---|
private SecuritySession |
addSession(java.lang.Object sid,
java.lang.String uid,
SecurityCache sc,
SecurityContext cxt)
Create a new session object, add it to the session list and return it.
|
SecuritySession |
addSessionDetails(java.lang.String uuid,
java.lang.String relatedUuid,
java.lang.String osUserName,
long pid,
java.lang.String driverName,
int webPort,
java.lang.String sessionDescription,
java.lang.String browserWebSocket)
Sets the uuid of the current session and the uuid of the original session (when forked).
|
(package private) SessionInfo[] |
getActiveSessions(java.lang.String jar,
java.lang.String iface)
Get the list of all active sessions which have executed API(s)
associated to this jar.
|
private int |
getNextUserSessionID()
Retrieve a unique user session ID to assign to a new security context.
|
SessionInfo |
getSessionDescriptor(SecuritySession session)
Obtain a descriptor for the given session.
|
java.lang.Integer |
getSessionId()
Get the number which uniquely identifies the current context, or
null if there is no current context. |
(package private) SessionInfo[] |
getSessionReport()
Creates a report of all current user and process sessions.
|
SessionToken |
getSessionToken()
Get the session token which uniquely identifies the current context, or
null if there is no current context. |
void |
killSession(int sid)
Forcibly terminates (closes) the socket in use for the given session.
|
(package private) SecuritySession |
locateSession(SecurityContext context)
Locates the session in the list of sessions with matching security context.
|
(package private) SecuritySession |
locateSessionById(java.lang.Object sessionId)
Locates the session in the list of sessions with matching session id.
|
private SecuritySession |
removeSession(SecurityContext key)
Remove the session (which is associated with the given context) from the
master session list.
|
private SecuritySession |
removeSessionById(java.lang.Object sessionId)
Remove the session (which is associated with the given session id) from the
master session list.
|
private void |
removeSessionWorker(SecuritySession session)
Remove the given session from the session list.
|
void |
terminateSession(java.lang.Object key)
Destroys the security context associated with the given key.
|
void |
terminateSessionById(java.lang.Object sessionId)
Destroys the security context associated with the session id.
|
(package private) void |
terminateSessions(java.lang.String jar,
java.lang.String iface)
Terminate all active sessions which have invoked the given APIs in the
given jar.
|
private void |
terminateSessionWorker(SecuritySession session)
Destroys the security context associated with the given session.
|
private void |
trackUserSession(java.lang.String uid,
boolean add)
Maintain tracking state for interactive user sessions.
|
private java.util.List<SecuritySession> listOfSess
private int nextUserSessionID
public java.lang.Integer getSessionId()
null if there is no current context.public SecuritySession addSessionDetails(java.lang.String uuid, java.lang.String relatedUuid, java.lang.String osUserName, long pid, java.lang.String driverName, int webPort, java.lang.String sessionDescription, java.lang.String browserWebSocket) throws RestrictedUseException
uuid - The uuid of the session.relatedUuid - The uuid of the original related session.osUserName - The OS username.pid - The pid.driverName - The client driver name.webPort - The web client http port.sessionDescription - The session description from SsoAuthenticator.browserWebSocket - The browser WebSocket address.RestrictedUseExceptionpublic SessionToken getSessionToken()
null if there is no current context.SessionInfo[] getActiveSessions(java.lang.String jar, java.lang.String iface)
jar - The name of the target jar file.iface - The interface for which we need the sessions;
if null, search through the entire jar.SecuritySession locateSession(SecurityContext context)
context - security context to look forSession associated with the security
contextSecuritySession locateSessionById(java.lang.Object sessionId)
sessionId - session idSession associated with the session idSessionInfo[] getSessionReport()
public SessionInfo getSessionDescriptor(SecuritySession session)
session - The session on which to report. Must not be null.null will be returned if the session cannot be
inspected.java.lang.NullPointerException - If the given session is null.public void killSession(int sid)
throws RestrictedUseException
sid - Session ID to terminate.java.lang.IllegalStateException - If the given session id is invalid, is associated with a
virtual session or if it is associated with the current
session being used.RestrictedUseExceptionpublic void terminateSession(java.lang.Object key)
throws RestrictedUseException
Restricted use. This method checks the caller to be:
key - The security context.RestrictedUseException - If called improperly from unauthorized code.public void terminateSessionById(java.lang.Object sessionId)
throws RestrictedUseException
Restricted use. This method checks the caller to be:
sessionId - The session id.RestrictedUseException - If called improperly from unauthorized code.void terminateSessions(java.lang.String jar,
java.lang.String iface)
null, terminate all active
tracked sessions.
This method guarantees that all session termination listeners have been
executed.jar - The jar name; if null, terminate all active
tracked sessions.iface - The interface for which we need to terminate the sessions;
if null, terminate all sessions for the given
jar.private void terminateSessionWorker(SecuritySession session) throws RestrictedUseException
session - The session to terminate.RestrictedUseException - If called improperly from unauthorized code.private SecuritySession removeSession(SecurityContext key)
key - The security context.private SecuritySession removeSessionById(java.lang.Object sessionId)
sessionId - The session id.private void removeSessionWorker(SecuritySession session)
session - The session to remove.private int getNextUserSessionID()
private SecuritySession addSession(java.lang.Object sid, java.lang.String uid, SecurityCache sc, SecurityContext cxt)
sid - The unique session identifier object.uid - If not null this is an interactive user session which must be tracked.sc - The current security cache.cxt - The context to associate with this session.private void trackUserSession(java.lang.String uid,
boolean add)
uid - The userid of the interactive accountadd - true for adding a new session and false for removing a session.