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 true value * @param user User credentials * @return true if the User credentials are valid, false 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 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); }