]> git.mxchange.org Git - addressbook-war.git/blobdiff - src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java
Fixed JNDI names + converter
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / user / AddressbookUserWebSessionController.java
index 414e8ceea4a28933edfc0640dfac23795633a5bc..c5eb1ade23deb4268b92ec834cfafbc71ba32e75 100644 (file)
@@ -18,8 +18,13 @@ package org.mxchange.addressbook.beans.user;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
 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.update.AdminUpdatedUserDataEvent;
+import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
@@ -37,16 +42,25 @@ public interface AddressbookUserWebSessionController extends Serializable {
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
        /**
-        * 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 newly added users by adminstrator
         * <p>
-        * @param userId User id
+        * @param event Event being fired
+        */
+       void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
+
+       /**
+        * Event observer for updated user data by administrator
         * <p>
-        * @return User instance
+        * @param event Event being updated
+        */
+       void afterAdminUpdatedUserDataEvent (final AdminUpdatedUserDataEvent event);
+
+       /**
+        * Listens to fired event when user updated personal data
         * <p>
-        * @throws UserNotFoundException If the user is not found
+        * @param event Event being fired
         */
-       User lookupUserById (final Long userId) throws UserNotFoundException;
+       void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
 
        /**
         * Event observer for new user registrations
@@ -62,6 +76,13 @@ public interface AddressbookUserWebSessionController extends Serializable {
         */
        void afterUserLogin (final UserLoggedInEvent event);
 
+       /**
+        * All users
+        * <p>
+        * @return A list of all public user profiles
+        */
+       List<User> allUsers ();
+
        /**
         * All public user profiles
         * <p>
@@ -69,6 +90,67 @@ public interface AddressbookUserWebSessionController extends Serializable {
         */
        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>
+        * @param contact Contact to check
+        * <p>
+        * @return Whether the contact is a user
+        */
+       boolean isContactFound (final Contact contact);
+
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedContact (final AdminAddedContactEvent event);
+
+       /**
+        * Checks whether a public user account is registered. This means that at
+        * least one user profile has its flag "public user profile" enabled.
+        * <p>
+        * @return Whether at least one user has a public profile
+        */
+       boolean isVisibleUserFound ();
+
+       /**
+        * Checks whether given user instance's name is used
+        * <p>
+        * @param user User instance's name to check
+        * <p>
+        * @return Whether it is already used
+        */
+       boolean isUserNameRegistered (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
+        * <p>
+        * @return User instance
+        * <p>
+        * @throws UserNotFoundException If the user is not found
+        */
+       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.
+        * <p>
+        * @return A list of all selectable contacts
+        */
+       List<Contact> selectableContacts ();
+
        /**
         * Creates an instance from all properties
         * <p>
@@ -76,6 +158,13 @@ public interface AddressbookUserWebSessionController extends Serializable {
         */
        User createUserInstance ();
 
+       /**
+        * Creates a user instance for login phase
+        * <p>
+        * @return User instance
+        */
+       User createUserLogin ();
+
        /**
         * Getter for user id
         * <p>
@@ -167,23 +256,6 @@ public interface AddressbookUserWebSessionController extends Serializable {
         */
        boolean isSamePasswordEntered ();
 
-       /**
-        * Checks whether given user instance's name is used
-        * <p>
-        * @param user User instance's name to check
-        * <p>
-        * @return Whether it is already used
-        */
-       boolean isUserNameRegistered (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.
-        * <p>
-        * @return Whether at least one user has a public profile
-        */
-       boolean isVisibleUserFound ();
-
        /**
         * Checks if the user id is empty
         * <p>