Class ActiveUserSessions

java.lang.Object
com.iizix.server.user.ActiveUserSessions

public class ActiveUserSessions extends Object
Handler class maintaining active user sessions.
Author:
Christopher Mindus
  • 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

      public UserSessions[] getUserSessions()
      Gets the user sessions open.
      Returns:
      The UserSessions array.
    • getUserSessions

      public ArrayList<UserSessions> getUserSessions(String appID, String userID)
      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

      public UserAuthenticationInfo getUserAuthentication(ClientParams params)
      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

      public AppSessionGyro getUserAppSession(VSViewerParams params)
      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, 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.
      clientParams - The client parameters. If a new session is started, the clientParams 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

      public AppSessionGyro getAppSessionGyro(ServerShell server, ClientParams clientParams)
      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

      public void onAppSessionUserChanged(AppSessionGyro appGyro)
      Called when the AppSessionGyro changes a user due to external login.
      Parameters:
      appGyro - The application session gyro instance.