+ @Override
+ public void afterRegistrationEvent (final @Observes UserRegisteredEvent event) {
+ // Trace message
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterRegistration: event={0} - CALLED!", event)); //NOI18N
+
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getRegisteredUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.user is null"); //NOI18N
+ } else if (event.getRegisteredUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.user.userId is null"); //NOI18N
+ } else if (event.getRegisteredUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N
+ }
+
+ // Get user instance
+ User registeredUser = event.getRegisteredUser();
+
+ // Debug message
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N
+ // Add user to local list
+ this.userList.add(registeredUser);
+
+ // Is the account public?
+ if (Objects.equals(registeredUser.getUserProfileMode(), ProfileMode.PUBLIC)) {
+ // Also add it to this list
+ this.visibleUserList.add(registeredUser);
+ }
+
+ // Add user name and email address
+ this.addUserNameEmailAddress(registeredUser);
+
+ // Clear all data
+ this.clear();
+
+ // Trace message
+ //* NOISY-DEBUG: */ System.out.println("AdminUserWebBean:afterRegistration: EXIT!"); //NOI18N
+ }
+
+ @Override
+ public void afterUserLogin (final @Observes UserLoggedInEvent event) {
+ // Trace message
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N
+
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getLoggedInUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.user is null"); //NOI18N
+ } else if (event.getLoggedInUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.user.userId is null"); //NOI18N
+ } else if (event.getLoggedInUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
+ }
+
+ // Re-initialize list
+ this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
+
+ // Trace message
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
+ }
+