Class UserManager


  • public final class UserManager
    extends java.lang.Object
    A class that manages the list of users connected to the engine.

    This class is thread safe, however it is recommended that the callee should synchronize over this object when inspecting a subset of the user list. The reason being that a user can connect or disconnect at any time.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList user_list
      The list of User objects that are currently connected to the database engine.
    • Constructor Summary

      Constructors 
      Constructor Description
      UserManager()
      Constructs the UserManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      User userAt​(int n)
      Returns the User object at index 'n' in the manager where 0 is the first user.
      int userCount()
      Returns the number of users that are logged in.
      (package private) void userLoggedIn​(User user)
      Called when a new user connects to the engine.
      (package private) void userLoggedOut​(User user)
      Called when the user logs out of the engine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • user_list

        private java.util.ArrayList user_list
        The list of User objects that are currently connected to the database engine.
    • Constructor Detail

      • UserManager

        UserManager()
        Constructs the UserManager.
    • Method Detail

      • userLoggedIn

        void userLoggedIn​(User user)
        Called when a new user connects to the engine.
      • userLoggedOut

        void userLoggedOut​(User user)
        Called when the user logs out of the engine.
      • userCount

        public int userCount()
        Returns the number of users that are logged in.
      • userAt

        public User userAt​(int n)
        Returns the User object at index 'n' in the manager where 0 is the first user.