Class LoginStat

java.lang.Object
org.bgerp.app.servlet.user.LoginStat

public class LoginStat extends Object
List of logged in user sessions.
  • Method Details

    • instance

      public static LoginStat instance()
    • userLoggedIn

      public void userLoggedIn(javax.servlet.http.HttpSession session, User user, String ip)
      Registers user session after auth.
      Parameters:
      session - HTTP session.
      user - user.
      ip - IP address.
    • sessionClosed

      public void sessionClosed(javax.servlet.http.HttpSession session)
      Unregister user session.
      Parameters:
      session - HTTP session.
    • actionWasCalled

      public void actionWasCalled(javax.servlet.http.HttpSession session)
      Updates session last activity time.
      Parameters:
      session - HTTP session.
    • isSessionValid

      public boolean isSessionValid(javax.servlet.http.HttpSession session)
      Checks if session is not timed out.
      Parameters:
      session - HTTP session.
      Returns:
      last activity time is not older as timeout.
    • loggedUsers

      public List<User> loggedUsers()
      Returns:
      logged in users ordered by first session login time.
    • loggedUsersWithSessions

      public LinkedHashMap<User,List<UserSession>> loggedUsersWithSessions()
      Returns:
      logged in users with their sessions.