package org.mxchange.jjobs.beans.user;
import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.model.user.User;
/**
public interface JobsAdminUserWebRequestController extends Serializable {
/**
- * 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.
+ * Event observer for new user registrations
* <p>
- * @param userId User id
+ * @param event User registration event
+ */
+ void afterUserRegistrationEvent (final UserRegisteredEvent event);
+
+ /**
+ * 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>
+ * @return Redirect outcome
+ */
+ String addUser ();
+
+ /**
+ * Deletes given user account
* <p>
- * @return User instance
+ * @param user User instance to delete
* <p>
- * @throws UserNotFoundException If the user is not found
+ * @return Redirect outcome
*/
- User lookupUserById (final Long userId) throws UserNotFoundException;
+ String deleteUserData (final User user);
/**
- * All users
+ * Edits currently loaded user's data in database.
* <p>
- * @return A list of all public user profiles
+ * @return Redirect outcome
*/
- List<User> allUsers ();
+ String editUserData ();
/**
- * Checks whether users are registered
+ * 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>
- * @return Whether users are registered
+ * @param user User instance to be locked
+ * <p>
+ * @return Redirect outcome
*/
- boolean hasUsers ();
+ String lockUserAccount (final User user);
/**
- * 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.
+ * Unlocks selected user's account. This method makes sure that the account
+ * is locked.
+ * <p>
+ * @param user User instance to be unlocked
+ * <p>
+ * @return Redirect outcome
*/
- void addUser ();
+ String unlockUserAccount (final User user);
/**
* Getter for user name
*/
void setUserPasswordRepeat (final String userPasswordRepeat);
+ /**
+ * Getter for flag if user needs to change password
+ * <p>
+ * @return Flag if user needs to change password
+ */
+ Boolean getUserMustChangePassword ();
+
+ /**
+ * Setter for flag if user needs to change password
+ * <p>
+ * @param userMustChangePassword Flag if user needs to change password
+ */
+ void setUserMustChangePassword (final Boolean userMustChangePassword);
+
+ /**
+ * Getter for user lock reason
+ * <p>
+ * @return User lock reason
+ */
+ String getUserLockReason ();
+
+ /**
+ * Setter for user lock reason
+ * <p>
+ * @param userLockReason User lock reason
+ */
+ void setUserLockReason (final String userLockReason);
+
+ /**
+ * Getter for user delete reason
+ * <p>
+ * @return User delete reason
+ */
+ String getUserDeleteReason ();
+
+ /**
+ * Setter for user delete reason
+ * <p>
+ * @param userDeleteReason User delete reason
+ */
+ void setUserDeleteReason (final String userDeleteReason);
+
}