Package com.iizix.server.user
Class ActiveUserSessions
java.lang.Object
com.iizix.server.user.ActiveUserSessions
Handler class maintaining active user sessions.
- Author:
- Christopher Mindus
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionaddUser
(ServerShell server, SessionInfo appSessionInfo, ThreadGroup appThreadGroup, ClientParams clientParams) Requests adding a UserIdentifier as active session.getAppSessionGyro
(ServerShell server, ClientParams clientParams) Gets the AppSessionGyro from an existing session.int
Gets the current count of active application sessions.int
Gets the currently open client session count.int
Gets the current amount of different users connected.int
Gets the peak count of active application sessions.int
Gets the peak open client session count.int
Gets the peak amount of different users.getUserAppSession
(VSViewerParams params) Gets the application gyro for an application, user and session ID for the VS Viewer.getUserAuthentication
(ClientParams params) Authenticate the session ID information without checking the password.Gets the user sessions open.getUserSessions
(String appID, String userID) Gets the user session for a client session.void
onAppSessionUserChanged
(AppSessionGyro appGyro) Called when the AppSessionGyro changes a user due to external login.
Constructor Details
ActiveUserSessions
public ActiveUserSessions()Constructor.
Method Details
getCurrentUserCount
public int getCurrentUserCount()Gets the current amount of different users connected. Each user may have several sessions open.- Returns:
- The number of concurrent users connected.
getPeakUserCount
public int getPeakUserCount()Gets the peak amount of different users. Each user may have several sessions open.- Returns:
- The number of peak concurrent users.
getCurrentSessionCount
public int getCurrentSessionCount()Gets the currently open client session count.- Returns:
- The count of the currently open sessions to the server, regardless of the same user.
getPeakSessionCount
public int getPeakSessionCount()Gets the peak open client session count.- Returns:
- The count of the peak open sessions to the server, regardless of the same user.
getCurrentAppSessionCount
public int getCurrentAppSessionCount()Gets the current count of active application sessions. The same user may run several apps and/or sessions at the same time.- Returns:
- The current amount of concurrent application sessions.
getPeakAppSessionCount
public int getPeakAppSessionCount()Gets the peak count of active application sessions. The same user may run several apps and/or sessions at the same time.- Returns:
- The peak amount of concurrent application sessions.
getUserSessions
Gets the user sessions open.- Returns:
- The UserSessions array.
getUserSessions
Gets the user session for a client session.- Parameters:
appID
- The application ID, or null for all application IDs.userID
- The user ID, or null for all user IDs.- Returns:
- A new list of user sessions.
getUserAuthentication
Authenticate the session ID information without checking the password.- Parameters:
params
- The client parameters.- Returns:
- null If the user session is not found, otherwise the authentication result.
getUserAppSession
Gets the application gyro for an application, user and session ID for the VS Viewer.- Parameters:
params
- The VS Viewer parameters.- Returns:
- The application gyro or null if not found.
addUser
public AppSessionGyro addUser(ServerShell server, SessionInfo appSessionInfo, ThreadGroup appThreadGroup, ClientParams clientParams) throws UserException Requests adding a UserIdentifier as active session. This can fail for the following reasons:- Parallel sessions are not allowed,
- Multiple independent sessions not allowed,
- FUTURE: User not allowed to run more than one application (not implemented yet).
It is assumed that the access of the UserIdentifier has been verified previously, i.e. this method does NOT verify User ID and Password.
- Parameters:
server
- The server.appSessionInfo
- The application session information.appThreadGroup
- The application thread group.clientParams
- The client parameters. If a new session is started, theclientParams
session user identifier is updated to reflect the new session ID.- Returns:
- A new or existing Gyro instance for the application session.
- Throws:
UserException
- If the user is not allowed access.
getAppSessionGyro
Gets the AppSessionGyro from an existing session.- Parameters:
server
- The server instance.clientParams
- The client parameters.- Returns:
- The AppSession Gyro found, or null for none.
onAppSessionUserChanged
Called when the AppSessionGyro changes a user due to external login.- Parameters:
appGyro
- The application session gyro instance.