/*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
import java.io.Serializable;
import java.util.List;
import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
+import org.mxchange.jusercore.events.user.update.AdminUpdatedUserDataEvent;
import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
+import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
/**
* An interface for user beans
* <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
*/
public interface PizzaUserWebSessionController extends Serializable {
*/
public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
+ /**
+ * Event observer for newly added users by adminstrator
+ * <p>
+ * @param event Event being fired
+ */
+ void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
+
+ /**
+ * Event observer for updated user data by administrator
+ * <p>
+ * @param event Event being updated
+ */
+ void afterAdminUpdatedUserDataEvent (final AdminUpdatedUserDataEvent event);
+
+ /**
+ * Event observer when user confirmed account.
+ * <p>
+ * @param event Event being fired
+ */
+ void afterUserConfirmedAccount (final UserConfirmedAccountEvent event);
+
+ /**
+ * Method being call after user's password has been updated (and history
+ * entry has been created).
+ * <p>
+ * @param event Event being observed
+ */
+ void afterUserUpdatedPasswordEvent (final UpdatedUserPasswordEvent event);
+
+ /**
+ * Listens to fired event when user updated personal data
+ * <p>
+ * @param event Event being fired
+ */
+ void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
+
+ /**
+ * Event observer for new user registrations
+ * <p>
+ * @param event User registration event
+ */
+ void afterRegistrationEvent (final UserRegisteredEvent event);
+
+ /**
+ * Event observer for logged-in user
+ * <p>
+ * @param event Event instance
+ */
+ void afterUserLogin (final UserLoggedInEvent event);
+
/**
* All users
* <p>
List<User> allUsers ();
/**
- * Checks whether users are registered
+ * All public user profiles
* <p>
- * @return Whether users are registered
+ * @return A list of all public user profiles
*/
- boolean hasUsers ();
+ List<User> allVisibleUsers ();
/**
* Checks whether the given contact is a user
boolean isContactFound (final Contact contact);
/**
- * Listens to fired event when user updated personal data
+ * Checks whether a public user account is registered. This means that at
+ * least one user profile has its flag "public user profile" enabled.
* <p>
- * @param event Event being fired
+ * @return Whether at least one user has a public profile
*/
- void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
-
- void updateList (final User user);
+ boolean isVisibleUserFound ();
/**
- * Returns a list of all selectable contacts for user creation. Contacts
- * from already existing users are excluded in this list.
+ * Checks whether given user instance's name is used
* <p>
- * @return A list of all selectable contacts
+ * @param user User instance's name to check
+ * <p>
+ * @return Whether it is already used
*/
- List<Contact> selectableContacts ();
+ boolean isUserNameRegistered (final User user);
/**
* Tries to lookup user by given id number. If the user is not found or the
User lookupUserById (final Long userId) throws UserNotFoundException;
/**
- * Event observer for newly added users by an administrator
+ * Tries to lookup user by given email address. If the user is not found a
+ * proper exceptions is thrown.
* <p>
- * @param event Event being fired
- */
- void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
-
- /**
- * Event observer for new user registrations
+ * @param emailAddress Email address
* <p>
- * @param event User registration event
- */
- void afterRegistrationEvent (final UserRegisteredEvent event);
-
- /**
- * Event observer for logged-in user
+ * @return User instance
* <p>
- * @param event Event instance
+ * @throws UserEmailAddressNotFoundException If the user's email address is not found
*/
- void afterUserLogin (final UserLoggedInEvent event);
+ User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;
/**
- * All public user profiles
+ * Creates an instance from all properties
* <p>
- * @return A list of all public user profiles
+ * @param createContactData Whether contact data should be created
+ * <p>
+ * @return A user instance
*/
- List<User> allVisibleUsers ();
+ User createUserInstance (final boolean createContactData);
/**
- * Creates an instance from all properties
+ * Creates a user instance for login phase
* <p>
- * @return A user instance
+ * @return User instance
*/
- User createUserInstance ();
+ User createUserLogin ();
/**
* Getter for user id
boolean isSamePasswordEntered ();
/**
- * Checks whether given user instance's name is used
- * <p>
- * @param user User instance's name to check
+ * Checks if the user id is empty
* <p>
- * @return Whether it is already used
+ * @return Whether the user id is empty
*/
- boolean isUserNameRegistered (final User user);
+ boolean isUserIdEmpty ();
/**
- * Checks whether a public user account is registered. This means that at
- * least one user profile has its flag "public user profile" enabled.
+ * Changes logged-in user's personal data if the current password matches
+ * and TAC + privacy statement has been accepted.
* <p>
- * @return Whether at least one user has a public profile
+ * @return New target page
*/
- boolean isVisibleUserFound ();
+ String doChangePersonalData ();
/**
- * Checks if the user id is empty
+ * Checks whether this application requires a user name to be entered.
+ * Otherwise a random name like "userXXXXX" is generated
* <p>
- * @return Whether the user id is empty
+ * @return Whether this application requires a user name
*/
- boolean isUserIdEmpty ();
+ boolean isUserNameRequired ();
/**
- * Changes logged-in user's personal data if the current password matches
- * and TAC + privacy statement has been accepted.
+ * Checks wether public user profiles are enabled. This requires that user
+ * names are also enabled.
* <p>
- * @return New target page
+ * @return Whether public user profiles are enabled
*/
- String doChangePersonalData ();
+ boolean isPublicUserProfileEnabled ();
}