public class UserFacadeBean extends java.lang.Object implements UserFacadeRemote
Constructor and Description |
---|
UserFacadeBean() |
Modifier and Type | Method and Description |
---|---|
UserJPA |
activateUser(UserJPA user)
Activates an existing user.
|
UserJPA |
addUser(UserJPA newUser)
Adds a new user.
|
java.lang.Boolean |
deleteUser(UserJPA currentUser)
Delete user.
|
UserJPA |
doLogin(java.lang.String userName,
java.lang.String userPass)
Login user.
|
UserJPA |
getUserByActionToken(java.lang.String actionToken)
Reads the user identified by the provided action token.
|
UserJPA |
getUserByIdentifier(java.lang.String userIdentifier)
Reads the user identified by the provided identifier.
|
UserJPA |
initiateResetPassword(UserJPA user)
Initiates password reset for the user.
|
UserJPA |
resetPassword(UserJPA user)
Resets the password of the user identified by the actionToken.
|
void |
sendActivationMail(UserJPA user,
java.lang.String serverString)
Method responsible for sending a email to the user, including a link to
activate his user account.
|
void |
sendPasswordResetMail(UserJPA user,
java.lang.String serverString)
Sends the user a link to reset the password.
|
UserJPA |
updateUser(UserJPA currentUser)
Update user.
|
public UserJPA doLogin(java.lang.String userName, java.lang.String userPass) throws CustomWrapperException
doLogin
in interface UserFacadeRemote
userName
- , userPassword User to add.userPass
- the user passCustomWrapperException
- the custom wrapper exceptionpublic UserJPA addUser(UserJPA newUser) throws CustomWrapperException
addUser
in interface UserFacadeRemote
newUser
- the new userCustomWrapperException
- the custom wrapper exceptionpublic UserJPA updateUser(UserJPA currentUser) throws java.lang.Exception
UserFacadeRemote
updateUser
in interface UserFacadeRemote
currentUser
- the current userjava.lang.Exception
- the exceptionpublic UserJPA getUserByActionToken(java.lang.String actionToken) throws UserNotFoundException
getUserByActionToken
in interface UserFacadeRemote
actionToken
- the action token identifying the userUserNotFoundException
- if no user could be foundpublic UserJPA activateUser(UserJPA user) throws UserNotFoundException
activateUser
in interface UserFacadeRemote
user
- the user to activateUserNotFoundException
- if the user could not be foundpublic UserJPA getUserByIdentifier(java.lang.String userIdentifier) throws UserNotFoundException
getUserByIdentifier
in interface UserFacadeRemote
userIdentifier
- the identifier identifying the userUserNotFoundException
- if no user could be foundpublic void sendActivationMail(UserJPA user, java.lang.String serverString) throws CannotSendMailException
sendActivationMail
in interface UserFacadeRemote
user
- User the activation mail should be sent toserverString
- Name and port of the server the user was added.CannotSendMailException
- if the mail could not be sentpublic UserJPA resetPassword(UserJPA user) throws UserNotFoundException
resetPassword
in interface UserFacadeRemote
user
- the userUserNotFoundException
- if the user could not be foundpublic UserJPA initiateResetPassword(UserJPA user)
initiateResetPassword
in interface UserFacadeRemote
user
- the userpublic void sendPasswordResetMail(UserJPA user, java.lang.String serverString) throws CannotSendMailException
sendPasswordResetMail
in interface UserFacadeRemote
user
- the userserverString
- host and port of the serverCannotSendMailException
- if the password reset mail could not be sentpublic java.lang.Boolean deleteUser(UserJPA currentUser) throws java.lang.Exception
UserFacadeRemote
deleteUser
in interface UserFacadeRemote
currentUser
- the current userjava.lang.Exception
- the exception