public class LoginManager extends Object
Modifier and Type | Class and Description |
---|---|
private class |
LoginManager.LoginProfile
Description of the Class
|
Modifier and Type | Field and Description |
---|---|
static int |
ADMIN_ACCESS_LEVEL
A Class constant to signify an access level for a page or a wep app user.
|
static int |
AUTHORIZED_USER_ACCESS_LEVEL
A Class constant to signify an access level for a page or a wep app user.
|
private String |
columnDelimitor |
private Connection |
con |
private Hashtable |
currentLogins
Description of the Field
|
private String |
dbConnectString |
private String |
dbDriverName |
private String |
dbPassword |
private static String |
dbSchema |
private String |
dbUser |
static String |
DEFAULT_COLUMN_DELIMITOR |
private static String |
ENCRYPT_PASSPHRASE |
static int |
GUEST_ACCESS_LEVEL
A Class constant to signify an access level for a page or a wep app user.
|
private static String |
idPassTablename |
private Class |
jdbcDriver |
private static String |
QUOTE
Description of the Field
|
private static String |
SELECT_PASSWORD
Description of the Field
|
static int |
SUPER_USER_ACCESS_LEVEL
A Class constant to signify an access level for a page or a wep app user.
|
static String |
SYSTEM_FILE_SEPERATOR
A holder for this clients System File Separator.
|
static String |
SYSTEM_LINE_SEPERATOR
A holder for this clients System line termination separator.
|
Constructor and Description |
---|
LoginManager()
Constructor for the LoginManager object
|
Modifier and Type | Method and Description |
---|---|
boolean |
addUserID(UserCredentials credentials)
Description of the Method
|
boolean |
alreadyLoggedIn(UserCredentials credentials)
Description of the Method
|
boolean |
changePassword(UserCredentials credentials)
Description of the Method
|
private void |
connect()
Connects this classes JDBC connection.
|
boolean |
deleteUserID(UserCredentials credentials)
Deletes a user from the DB.
|
int |
getUserAccess(String userId)
Description of the Method
|
UserCredentials |
getUserID(String userId)
Description of the Method
|
boolean |
logout(UserCredentials credentials)
Description of the Method
|
static void |
main(String[] args)
Main
|
private ResultSet |
queryResultSet(String sql)
Executes a SQL statement onto the JDBC accessed databased defined by the
class driver and connection string and connection.
|
private int |
queryUpdate(String sql)
Executes a SQL statement onto the JDBC accessed databased defined by the
class driver and connection string and connection.
|
private void |
reConnect()
Reconnects this classes JDBC connection closing an existing one if needed.
|
String |
recoverUserPassword(String userId)
Returns a UserID's password.
|
boolean |
resetUserPassword(String userId)
Resets the users password to their employee ID number.
|
boolean |
resetUserPassword(String userId,
String pass)
Resets the users password to the passed in string (Encrypted).
|
int |
seedLoginDB(int deptId)
Seeds the db with ids for all employees in the specified Department.
|
boolean |
userExists(String userId) |
boolean |
validateLogin(UserCredentials credentials)
Description of the Method
|
public static final int SUPER_USER_ACCESS_LEVEL
public static final int ADMIN_ACCESS_LEVEL
public static final int AUTHORIZED_USER_ACCESS_LEVEL
public static final int GUEST_ACCESS_LEVEL
public static final String SYSTEM_FILE_SEPERATOR
public static final String SYSTEM_LINE_SEPERATOR
public static final String DEFAULT_COLUMN_DELIMITOR
private String columnDelimitor
private String dbPassword
private String dbDriverName
private String dbConnectString
private static String idPassTablename
private Class jdbcDriver
private Connection con
private static final String ENCRYPT_PASSPHRASE
private static final String SELECT_PASSWORD
private static final String QUOTE
private Hashtable currentLogins
public LoginManager() throws Exception
Exception
- Description of the Exceptionpublic boolean alreadyLoggedIn(UserCredentials credentials)
credentials
- Description of the Parameterpublic boolean logout(UserCredentials credentials)
credentials
- Description of the Parameterpublic boolean validateLogin(UserCredentials credentials) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic boolean changePassword(UserCredentials credentials) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic boolean resetUserPassword(String userId, String pass) throws SQLException
userId
- The userId to resetpass
- The new password to useSQLException
- Description of the Exceptionpublic boolean resetUserPassword(String userId) throws SQLException
userId
- The userId to resetSQLException
- Description of the Exceptionpublic String recoverUserPassword(String userId)
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic boolean addUserID(UserCredentials credentials) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic boolean deleteUserID(UserCredentials credentials) throws SQLException
credentials
- The user object to deleteSQLException
- Description of the Exceptionpublic int seedLoginDB(int deptId) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic boolean userExists(String userId)
public UserCredentials getUserID(String userId) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionpublic int getUserAccess(String userId) throws SQLException
credentials
- Description of the ParameterSQLException
- Description of the Exceptionprivate void connect() throws SQLException
SQLException
private void reConnect() throws SQLException
SQLException
private int queryUpdate(String sql)
sql
- is the SQL to executeprivate ResultSet queryResultSet(String sql)
sql
- is the SQL to executeWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses