]> git.mxchange.org Git - jfinancials-war.git/commitdiff
organized members
authorRoland Haeder <roland@mxchange.org>
Thu, 15 Oct 2015 17:34:44 +0000 (19:34 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 15 Oct 2015 17:34:44 +0000 (19:34 +0200)
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java

index 7424e6fb2be038c4f395ec5f34b24bc45cb51c46..b97648e66a900621643f4e90a04eb01ea4e1edc4 100644 (file)
@@ -54,6 +54,11 @@ import org.mxchange.jusercore.model.user.User;
 @SessionScoped
 public class AddressbookWebBean implements AddressbookWebController {
 
+       /**
+        * Map for count of user's shared addresses
+        */
+       private static ConcurrentMap<User, Integer> countSharesList;
+
        /**
         * Serial number
         */
@@ -84,11 +89,6 @@ public class AddressbookWebBean implements AddressbookWebController {
         */
        private User addressbookUser;
 
-       /**
-        * Map for count of user's shared addresses
-        */
-       private static ConcurrentMap<User, Integer> countSharesList;
-
        /**
         * Login controller
         */
@@ -198,6 +198,27 @@ public class AddressbookWebBean implements AddressbookWebController {
                this.setAddressbookCreated(addressbook.getAddressbookCreated());
        }
 
+       @Override
+       public void afterLoginEvent (final @Observes UserLoggedInEvent event) {
+               // Is the user logged in?
+               if (null == event) {
+                       // Is null
+                       throw new NullPointerException("event is null");
+               } else if (event.getUser() == null) {
+                       // user is null
+                       throw new NullPointerException("event.user is null");
+               } else if (!event.getUser().equals(this.loginController.getLoggedInUser())) {
+                       // Not matching
+                       throw new IllegalStateException("event.user and loginController.loggedInUser don't match.");
+               } else if (!this.loginController.isUserLoggedIn()) {
+                       // Not logged in
+                       throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
+               }
+
+               // Init user's address book list
+               this.initAddressbookList();
+       }
+
        @Override
        public List<Addressbook> allAddressbooks () {
                // Is the user logged in?
@@ -351,27 +372,6 @@ public class AddressbookWebBean implements AddressbookWebController {
                return isFound;
        }
 
-       @Override
-       public void afterLoginEvent (final @Observes UserLoggedInEvent event) {
-               // Is the user logged in?
-               if (null == event) {
-                       // Is null
-                       throw new NullPointerException("event is null");
-               } else if (event.getUser() == null) {
-                       // user is null
-                       throw new NullPointerException("event.user is null");
-               } else if (!event.getUser().equals(this.loginController.getLoggedInUser())) {
-                       // Not matching
-                       throw new IllegalStateException("event.user and loginController.loggedInUser don't match.");
-               } else if (!this.loginController.isUserLoggedIn()) {
-                       // Not logged in
-                       throw new FaceletException("This method can only be called as logged-in user."); //NOI18N
-               }
-
-               // Init user's address book list
-               this.initAddressbookList();
-       }
-
        /**
         * Initializes the user user's address book list
         */