From: Roland Haeder Date: Mon, 15 Feb 2016 19:26:58 +0000 (+0100) Subject: sorted members X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=355cd653360587ee84033046c38b83e640229694;p=addressbook-war.git sorted members --- diff --git a/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionBean.java index 433a7446..e6329bf4 100644 --- a/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionBean.java @@ -154,6 +154,21 @@ public class SharesWebSessionBean implements SharesWebSessionController { this.sharedAddressbooks.add(event.getShareableAddressbook()); } + @Override + public void afterLoginEvent (final @Observes UserLoggedInEvent event) { + // Is the user logged in? + if (null == event) { + // Is null + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getUser() == null) { + // user is null + throw new NullPointerException("event.user is null"); //NOI18N + } + + // Init share list + this.sharedAddressbooks = this.shareBean.allSharedAddressbooks(event.getUser()); + } + @Override public List allShares () { // Is the user logged in? @@ -185,21 +200,6 @@ public class SharesWebSessionBean implements SharesWebSessionController { this.shareeUserId = shareeUserId; } - @Override - public void afterLoginEvent (final @Observes UserLoggedInEvent event) { - // Is the user logged in? - if (null == event) { - // Is null - throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUser() == null) { - // user is null - throw new NullPointerException("event.user is null"); //NOI18N - } - - // Init share list - this.sharedAddressbooks = this.shareBean.allSharedAddressbooks(event.getUser()); - } - @PostConstruct public void init () { } diff --git a/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionController.java b/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionController.java index 0e9eacdb..d2a96f5c 100644 --- a/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionController.java @@ -45,6 +45,14 @@ public interface SharesWebSessionController extends Serializable { */ void afterAdressbookShareStarted (final AddressbookSharingEvent event); + /** + * This method is called when a user has successfully logged in his/her + * account. + *

+ * @param event + */ + void afterLoginEvent (final UserLoggedInEvent event); + /** * Returns a list of all address books the user is sharing with others. *

@@ -110,12 +118,4 @@ public interface SharesWebSessionController extends Serializable { * @return Redirect target */ String startSharing (final User user, final Addressbook addressbook); - - /** - * This method is called when a user has successfully logged in his/her - * account. - *

- * @param event - */ - void afterLoginEvent (final UserLoggedInEvent event); }