import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.LoginUser;
}
}
+ @Override
+ public void afterUserLogin (final @Observes UserLoggedInEvent event) {
+ // Trace message
+ System.out.println(MessageFormat.format("UserWebBean: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.getUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.user is null"); //NOI18N
+ } else if (event.getUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.user.userId is null"); //NOI18N
+ } else if (event.getUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N
+ }
+
+ // Re-initialize list
+ this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
+
+ // Trace message
+ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
+ }
+
@Override
public void afterRegistrationEvent (final @Observes UserRegisteredEvent event) {
// Trace message
import org.mxchange.jcontacts.contact.gender.Gender;
import org.mxchange.jcountry.data.Country;
import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.model.user.User;
*/
void afterRegistrationEvent (final UserRegisteredEvent event);
+ /**
+ * Event observer for logged-in user
+ * <p>
+ * @param event Event instance
+ */
+ void afterUserLogin (final UserLoggedInEvent event);
+
/**
* All public user profiles
* <p>