package org.mxchange.jjobs.beans.user;
import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
-import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.User;
/**
* <p>
* @param event User registration event
*/
- void afterRegistrationEvent (final UserRegisteredEvent event);
+ void afterUserRegistrationEvent (final UserRegisteredEvent event);
/**
- * Event observer for logged-in user
- * <p>
- * @param event Event instance
- */
- void afterUserLogin (final UserLoggedInEvent event);
-
- /**
- * Listens to fired event when user updated personal data
+ * Adds user instance to database by preparing a complete user instance and
+ * sending it to the EJB. The data set in the controller is being verified,
+ * e.g. if the user name or email address is not used yet.
* <p>
- * @param event Event being fired
+ * @return Redirect outcome
*/
- void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
+ String addUser ();
/**
- * Checks whether the given contact is a user
+ * Deletes given user account
* <p>
- * @param contact Contact to check
+ * @param user User instance to delete
* <p>
- * @return Whether the contact is a user
+ * @return Redirect outcome
*/
- boolean isContactFound (final Contact contact);
+ String deleteUserData (final User user);
/**
- * Checks whether a public user account is registered. This means that at
- * least one user profile has its flag "public user profile" enabled.
+ * Edits currently loaded user's data in database.
* <p>
- * @return Whether at least one user has a public profile
+ * @return Redirect outcome
*/
- boolean isVisibleUserFound ();
+ String editUserData ();
/**
- * Checks whether given user instance's name is used
+ * Locks selected user's account. This method makes sure that a lock reason
+ * is provided that th user later can read on login attempts.
* <p>
- * @param user User instance's name to check
+ * @param user User instance to be locked
* <p>
- * @return Whether it is already used
+ * @return Redirect outcome
*/
- boolean isUserNameRegistered (final User user);
+ String lockUserAccount (final User user);
/**
- * Tries to lookup user by given id number. If the user is not found or the
- * account status is not CONFIRMED proper exceptions are thrown.
- * <p>
- * @param userId User id
+ * Unlocks selected user's account. This method makes sure that the account
+ * is locked.
* <p>
- * @return User instance
+ * @param user User instance to be unlocked
* <p>
- * @throws UserNotFoundException If the user is not found
+ * @return Redirect outcome
*/
- User lookupUserById (final Long userId) throws UserNotFoundException;
+ String unlockUserAccount (final User user);
/**
- * All users
+ * Getter for user name
* <p>
- * @return A list of all public user profiles
+ * @return User name
*/
- List<User> allUsers ();
+ String getUserName ();
/**
- * All public user profiles
+ * Setter for user name
* <p>
- * @return A list of all public user profiles
+ * @param userName User name
*/
- List<User> allVisibleUsers ();
+ void setUserName (final String userName);
/**
- * Checks whether users are registered
+ * Getter for unencrypted user password
* <p>
- * @return Whether users are registered
+ * @return Unencrypted user password
*/
- boolean hasUsers ();
+ String getUserPassword ();
/**
- * Adds user instance to database by preparing a complete user instance and
- * sending it to the EJB. The data set in the controller is being verified,
- * e.g. if the user name or email address is not used yet.
+ * Setter for unencrypted user password
* <p>
- * @return Redirect outcome
+ * @param userPassword Unencrypted user password
*/
- String addUser ();
+ void setUserPassword (final String userPassword);
/**
- * Edits cuirrently loaded user's data in database.
+ * Getter for unencrypted user password repeated
* <p>
- * @return Redirect outcome
+ * @return Unencrypted user password repeated
*/
- String editUserData ();
+ String getUserPasswordRepeat ();
/**
- * Getter for user name
+ * Setter for unencrypted user password repeated
* <p>
- * @return User name
+ * @param userPasswordRepeat Unencrypted user password repeated
*/
- String getUserName ();
+ void setUserPasswordRepeat (final String userPasswordRepeat);
/**
- * Setter for user name
+ * Getter for flag if user needs to change password
* <p>
- * @param userName User name
+ * @return Flag if user needs to change password
*/
- void setUserName (final String userName);
+ Boolean getUserMustChangePassword ();
/**
- * Getter for unencrypted user password
+ * Setter for flag if user needs to change password
* <p>
- * @return Unencrypted user password
+ * @param userMustChangePassword Flag if user needs to change password
*/
- String getUserPassword ();
+ void setUserMustChangePassword (final Boolean userMustChangePassword);
/**
- * Setter for unencrypted user password
+ * Getter for user lock reason
* <p>
- * @param userPassword Unencrypted user password
+ * @return User lock reason
*/
- void setUserPassword (final String userPassword);
+ String getUserLockReason ();
/**
- * Getter for unencrypted user password repeated
+ * Setter for user lock reason
* <p>
- * @return Unencrypted user password repeated
+ * @param userLockReason User lock reason
*/
- String getUserPasswordRepeat ();
+ void setUserLockReason (final String userLockReason);
/**
- * Setter for unencrypted user password repeated
+ * Getter for user delete reason
* <p>
- * @param userPasswordRepeat Unencrypted user password repeated
+ * @return User delete reason
*/
- void setUserPasswordRepeat (final String userPasswordRepeat);
+ String getUserDeleteReason ();
/**
- * Returns a list of all selectable contacts for user creation. Contacts
- * from already existing users are excluded in this list.
+ * Setter for user delete reason
* <p>
- * @return A list of all selectable contacts
+ * @param userDeleteReason User delete reason
*/
- List<Contact> selectableContacts ();
+ void setUserDeleteReason (final String userDeleteReason);
}