userManager
Class UserManager
java.lang.Object
userManager.UserManager
- All Implemented Interfaces:
- UserManagerInterface
public class UserManager
- extends Object
- implements UserManagerInterface
The UserManager class facilitates user contents and database management.
It uses the User class, Authenticate class and the Active class to
service requests.
Constructor Summary |
UserManager()
CONSTRUCTOR - Will construct the UserManager Class using a singleton
pattern. |
Method Summary |
static Active |
active()
|
boolean |
authenticate(String username,
String password)
This method will verify that a given username and password matches
a registered user in the system. |
void |
logout(String username)
This method will logout the user from the system by removing it from
active users table and marks user status field as 0 - for inactive. |
user
public User user
UserManager
public UserManager()
- CONSTRUCTOR - Will construct the UserManager Class using a singleton
pattern. Constructor will initialize the DBManager class, Active class
Authenticate class and the User class.
authenticate
public boolean authenticate(String username,
String password)
- This method will verify that a given username and password matches
a registered user in the system. If a match is found it returns true,
else, it returns false.
If it returns true, the method will construct a User object and adds
it to ActiveInterface table.
- Specified by:
authenticate
in interface UserManagerInterface
- Parameters:
String
- userName username value to be authenticated.String
- password password value to be authenticated.
- Returns:
- Boolean Authentication result.
logout
public void logout(String username)
- This method will logout the user from the system by removing it from
active users table and marks user status field as 0 - for inactive.
- Specified by:
logout
in interface UserManagerInterface
active
public static Active active()