Package services

Class AuthService

    • Constructor Summary

      Constructors 
      Constructor Description
      AuthService()
      Constructs an instance of the AuthService class.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean authenticate​(User user, java.lang.String password)
      Authenticates the given user with the given password.
      abstract boolean login​(java.lang.String userID, java.lang.String password)
      Logs in a user with userID and password (for student and staff)
      boolean logout()
      Logs out the currently logged in user.
      • Methods inherited from class java.lang.Object

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

      • AuthService

        public AuthService()
        Constructs an instance of the AuthService class.
    • Method Detail

      • login

        public abstract boolean login​(java.lang.String userID,
                                      java.lang.String password)
        Description copied from interface: IAuthService
        Logs in a user with userID and password (for student and staff)
        Specified by:
        login in interface IAuthService
        Parameters:
        userID - user's userID
        password - user's password
        Returns:
        True if the user is authenticated successfully, False otherwise
      • logout

        public boolean logout()
        Description copied from interface: IAuthService
        Logs out the currently logged in user.
        Specified by:
        logout in interface IAuthService
        Returns:
        True if successfully log out, False otherwise.
      • authenticate

        protected boolean authenticate​(User user,
                                       java.lang.String password)
        Authenticates the given user with the given password.
        Parameters:
        user - the user to be authenticated
        password - the password to be used for authentication
        Returns:
        true if the user is authenticated successfully, false otherwise