com.ontheedgesc.choices.data
Interface UserDataServiceInterface

All Known Implementing Classes:
UserDataService

public interface UserDataServiceInterface

This is the interface specification for all the User Data Services.

 

Method Summary
 boolean addUser(User user)
          Add a new User in the data repository.
 boolean checkUserExists(java.lang.String username, java.lang.String password)
          Check if User exists in the data repository.
 User getUserById(java.lang.String id)
          Find User by ID and Group in the data repository.
 User getUserByUsername(java.lang.String username, java.lang.String password)
          Find User by Username and Password in the data repository.
 boolean isStartupOk()
          Return if startup without errors or exceptions.
 boolean updateUser(User user)
          Update a User in the data repository.
 

Method Detail

isStartupOk

boolean isStartupOk()
Return if startup without errors or exceptions.

Returns:
True if OK to access data repository else return false;

addUser

boolean addUser(User user)
                throws DataRepositoryException
Add a new User in the data repository.

Parameters:
user - User to add.
Returns:
True if success else False
Throws:
DataRepositoryException - Thrown if exception from repository.

updateUser

boolean updateUser(User user)
                   throws DataRepositoryException
Update a User in the data repository.

Parameters:
user - User to update.
Returns:
True if success else False
Throws:
DataRepositoryException - Thrown if exception from repository.

getUserById

User getUserById(java.lang.String id)
                 throws DataRepositoryException
Find User by ID and Group in the data repository.

Parameters:
id - User ID to search for.
Returns:
A User (as a User bean).
Throws:
DataRepositoryException - Thrown if exception from repository.

getUserByUsername

User getUserByUsername(java.lang.String username,
                       java.lang.String password)
                       throws DataRepositoryException
Find User by Username and Password in the data repository.

Parameters:
username - User Name to search for.
password - User Password to search for.
Returns:
A User (as a User bean).
Throws:
DataRepositoryException - Thrown if exception from repository.

checkUserExists

boolean checkUserExists(java.lang.String username,
                        java.lang.String password)
                        throws DataRepositoryException
Check if User exists in the data repository.

Parameters:
username - User Name to search for.
password - User Password to search for.
Returns:
True if User exists else false if User does not exist.
Throws:
DataRepositoryException - Thrown if exception from repository.