Package org.bgerp.app.servlet.user

# Class LoginStat

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

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `actionWasCalled(javax.servlet.http.HttpSession session)`
  Updates session last activity time.
  `static LoginStat`
  `instance()`
  `boolean`
  `isSessionValid(javax.servlet.http.HttpSession session)`
  Checks if session is not timed out.
  `List<User>`
  `loggedUsers()`
  `LinkedHashMap<User,List<UserSession>>`
  `loggedUsersWithSessions()`
  `void`
  `sessionClosed(javax.servlet.http.HttpSession session)`
  Unregister user session.
  `void`
  `userLoggedIn(javax.servlet.http.HttpSession session, User user, String ip)`
  Registers user session after auth.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.