Public Member Functions | |
DBAccess () throws Exception | |
boolean | testConnection () |
void | connect () throws SQLException |
void | terminateConnection () |
UserInfo | validateUser (String username, String password) throws SQLException |
boolean | addNewTask (String owner_id, String description, String state) |
List | getTasks () |
List | getTasks (String user_id) |
boolean | changeTask (String ownerId, String description, String state, String taskId) |
boolean | markTaskDone (String task_id) |
boolean | markTasksUpToDate (String userId) |
boolean | deleteTask (String taskId, String ownerId) |
List | getTaskUsers () |
List | smsUsers () |
List | getAllUsers () |
boolean | checkCurrentPassword (String currentPw, String userId) |
boolean | changePassword (String newPw, String userId) |
List | getGroups () |
boolean | addNewUser (String login, String password, String mobile, String group) |
boolean | changeUser (String login, String pw, String mobile, String groupId, String userId) |
boolean | deleteUser (String userId) |
|
The constructor opens a connection to the MySQL database.
|
|
Adds a new task to the database, for a single user.
|
|
This function adds a new user account in to the database.
|
|
Changes the user's password.
|
|
Changes a single tasks attributes.
|
|
This function changes the users settings.
|
|
Does a check on the users current password.
|
|
This function gets a new connection to the database.
|
|
Removes a task from the database.
|
|
This function removes the specified user from the database.
|
|
Returns a list of all users in the database. The administrator needs to see all users so that he can change everyones attributes.
|
|
Returns a list of all available user groups.
|
|
Retrieves the tasks for a single user.
|
|
Retrieves tasks for all users from the database.
|
|
Returns a list of users that can have tasks, retrieved from the database. This list comprises of worker and manager users, since administrators can't have any tasks.
|
|
Marks a task done in the database.
|
|
Marks the users tasks as up to date.
|
|
Returns a list of users that do not have their tasks up to date. This list is used in sending SMS messages to those users that do not have their tasks up to date.
|
|
Terminates the connection to the database. |
|
This function tests if the connection is still alive. MySQL disconnects all connections after they've idled for 8 hours so we must test that the connection is still alive before making actual queries.
|
|
Validates the user's username and password from the database.
|