corelib.security
Interface UserManager


public interface UserManager

This interface defines the methods used to manage User instances. To can get a UserManager instance by asking it at your SecurityManager.

Since:
0.3.6
Author:
Dominique Liard
See Also:
SecurityManager, JdbcSecurityManager, User

Method Summary
 User checkCredentials(java.lang.String userLogin, java.lang.String userPassword)
          Check if the pair login/password represents an autorized user for the considered application.
 void deleteUser(User user)
          Delete the specified user from the security system.
 java.lang.String encryptPassword(java.lang.String clearPassword)
          Defines the algorithm used for encode password.
 User getUserById(int userId)
          TODO Note: a user instance is not authentified.
 User insertUser(java.lang.String login, java.lang.String password)
          Insert a new user in the security system.
 void updateUser(User user)
          Update informations, in the security system, for the specified user.
 

Method Detail

checkCredentials

User checkCredentials(java.lang.String userLogin,
                      java.lang.String userPassword)
                      throws AccountDisabledException,
                             BadCredentialsException
Check if the pair login/password represents an autorized user for the considered application. If the identity is rejected, an exception will thrown. If the identity is accepted, the connection number of the considered user is increased.

Parameters:
userLogin - The login for the considered user.
userPassword - The password for the considered user.
Returns:
The considered user instance.
Throws:
AccountDisabledException - Thrown when the provided account informations there invalid.
BadCredentialsException - Thrown if the identity is rejected.

getUserById

User getUserById(int userId)
TODO Note: a user instance is not authentified. For get a authentified user, prefer the checkCredentials method. Note: password is not returned into the selected user TODO remove password save for User and and it for AuthentifiedUser

Parameters:
userId - The user identifier (the primary key into the security database).
Returns:
The selected user instance.

insertUser

User insertUser(java.lang.String login,
                java.lang.String password)
                throws UserAlreadyRegisteredException,
                       SecurityManagerException
Insert a new user in the security system. The new used has the specified login and the specified password.

Parameters:
login - The login for the considered user.
password - The password for the considered user. The specified password is automaticly encoded by this method.
Returns:
The new user instance.
Throws:
SecurityManagerException - Thrown if the new user cannot be inserted in the security system.
UserAlreadyRegisteredException - Thrown if the specified login is already registered in the security system.

updateUser

void updateUser(User user)
                throws SecurityManagerException
Update informations, in the security system, for the specified user.

Parameters:
user - The user instance to update.
Throws:
SecurityManagerException - Thrown if this manager cannot update the user informations.

deleteUser

void deleteUser(User user)
                throws SecurityManagerException
Delete the specified user from the security system.

Parameters:
user - The user to delete.
Throws:
SecurityManagerException - Thrown if this manager cannot remove the user.

encryptPassword

java.lang.String encryptPassword(java.lang.String clearPassword)
                                 throws SecurityManagerException
Defines the algorithm used for encode password. User password is stored in encoded format.

Parameters:
clearPassword - A password (in clear).
Returns:
The encoded password.
Throws:
SecurityManagerException - Thrown if password encription failed.


CAUTION: Ellipse is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of Ellipse Framework.

Copyright 2012 Infini Software - All Rights Reserved.