Revision 1 -
(download)
(annotate)
Wed Jul 28 10:05:51 2010 UTC
(13 years, 9 months ago)
by dgarcia File size: 1502 byte(s)
First code commit
package eu.smartlm.abs.portal.security.login.service;
import java.util.List;
import eu.smartlm.abs.portal.security.login.model.User;
/**
* Specifies the basic interface that should complain any implementation of the login procedure
* @author David García Pérez - CESGA
*/
public interface LoginService {
public int USER_SUCCESSFULLY_ADDED = 100;
public int USER_ALREADY_EXISTS = 200;
public int WRONG_USERNAME = 300;
public int WRONG_PASSWORD = 400;
public int USER_SUCCESSFULLY_EDITED = 500;
/**
* If the user has valid credentials it gives back a <code>true</code> value
* @param user User credentials
* @return <code>true</code> if the User credentials are valid, <code>false</code> otherwise
*/
public boolean isValidLogin(User user);
/**
* Gets a list of all users that can log in into the server
* @return a list of all users
*/
public List<User> getUsers();
/**
* Adds a user to the database
* @param user user to be added
* @return code if a user was successfully added or the error message
*/
public int addUser(User user);
/**
* Gets user by username
* @param username
* @return
*/
public User getUser(String username);
/**
* Edits the data of an specific user
* @param user username of the user to be edit
* @return code if a user was succesfully edited or the error message
*/
public int editUser(User user);
/**
* Removew a user vi its username
* @param username
*/
public void removeUser(String username);
}