From: Roland Haeder Date: Thu, 15 Oct 2015 17:34:44 +0000 (+0200) Subject: organized members X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fe2fee3185def77e3eb7d14b2287bdf270116d0f;p=addressbook-war.git organized members --- diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java index 7424e6fb..b97648e6 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -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 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 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 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 */