import org.mxchange.addressbook.model.addressbook.Addressbook;
import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
import org.mxchange.addressbook.model.shared.SharedAddressbooksSessionBeanRemote;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
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<ShareableAddressbook> allShares () {
// Is the user logged in?
import org.mxchange.addressbook.events.sharing.AddressbookSharingEvent;
import org.mxchange.addressbook.model.addressbook.Addressbook;
import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
import org.mxchange.jusercore.model.user.User;
/**
*/
void afterAdressbookShareStarted (final AddressbookSharingEvent event);
+ /**
+ * This method is called when a user has successfully logged in his/her
+ * account.
+ * <p>
+ * @param event
+ */
+ void afterLoginEvent (final UserLoggedInEvent event);
+
/**
* Returns a list of all address books the user is sharing with others.
* <p>