/*
- * 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 {
*/
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>
*/
List<User> allVisibleUsers ();
- /**
- * Checks whether users are registered
- * <p>
- * @return Whether users are registered
- */
- boolean hasUsers ();
-
/**
* Checks whether the given contact is a user
* <p>
User lookupUserById (final Long userId) throws UserNotFoundException;
/**
- * Returns a list of all selectable contacts for user creation. Contacts
- * from already existing users are excluded in this list.
+ * Tries to lookup user by given email address. If the user is not found a
+ * proper exceptions is thrown.
+ * <p>
+ * @param emailAddress Email address
+ * <p>
+ * @return User instance
* <p>
- * @return A list of all selectable contacts
+ * @throws UserEmailAddressNotFoundException If the user's email address is not found
*/
- List<Contact> selectableContacts ();
+ User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;
/**
* Creates an instance from all properties
* <p>
+ * @param createContactData Whether contact data should be created
+ * <p>
* @return A user instance
*/
- User createUserInstance ();
+ User createUserInstance (final boolean createContactData);
+
+ /**
+ * Creates a user instance for login phase
+ * <p>
+ * @return User instance
+ */
+ User createUserLogin ();
/**
* Getter for user id
*/
String doChangePersonalData ();
+ /**
+ * Checks whether this application requires a user name to be entered.
+ * Otherwise a random name like "userXXXXX" is generated
+ * <p>
+ * @return Whether this application requires a user name
+ */
+ boolean isUserNameRequired ();
+
+ /**
+ * Checks wether public user profiles are enabled. This requires that user
+ * names are also enabled.
+ * <p>
+ * @return Whether public user profiles are enabled
+ */
+ boolean isPublicUserProfileEnabled ();
+
}