@SessionScoped
public class AddressbookWebBean implements AddressbookWebController {
+ /**
+ * Map for count of user's shared addresses
+ */
+ private static ConcurrentMap<User, Integer> countSharesList;
+
/**
* Serial number
*/
*/
private User addressbookUser;
- /**
- * Map for count of user's shared addresses
- */
- private static ConcurrentMap<User, Integer> countSharesList;
-
/**
* Login controller
*/
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<Addressbook> allAddressbooks () {
// Is the user logged in?
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
*/