]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 20 Apr 2017 15:53:23 +0000 (17:53 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 20 Apr 2017 18:25:34 +0000 (20:25 +0200)
- removed event-observing methods from interfaces as they should not be called
  from other beans, but only invoked when the specific event has been fired.
- remember these guide-lines:
  1) Use interface for type-hinting objects, not direct class name.
  2) All methods in interface are considered as callable (by you)
  3) If you still need public methods (like it is needed for @PostConstruct or
     @Observes) don't add that method to interface.
  4) This way, the interface is clean and simple (KISS), no exceptions (of,
     course thrown ...)!

Signed-off-by: Roland Häder <roland@mxchange.org>
30 files changed:
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java
src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java
src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java
src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java
src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java
src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java
src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java
src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java
src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java
src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java
src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java
src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java

index 2ead9fac4cee7c6653cced27a43abb4ffe217987..4e4557cd3cebf1ee4979771031a685f4fc459bf7 100644 (file)
@@ -40,8 +40,6 @@ import org.mxchange.jcontacts.contact.utils.ContactUtils;
 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.deleted.ObservableAdminDeletedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
 import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
@@ -255,7 +253,12 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.emailAddresses = new LinkedList<>();
        }
 
-       @Override
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) {
                // The event must be valid
                if (null == event) {
@@ -282,7 +285,11 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.selectableContacts.add(event.getAddedContact());
        }
 
-       @Override
+       /**
+        * Event observer for newly added users by adminstrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -303,7 +310,11 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for deleted contact instance by administrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminDeletedContactEvent (@Observes final ObservableAdminDeletedContactEvent event) {
                // event should not be null
                if (null == event) {
@@ -328,7 +339,12 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.clear();
        }
 
-       @Override
+       /**
+        * Observes events being fired when an administrator has linked a new user
+        * with existing contact data.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -355,55 +371,73 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.clear();
        }
 
-       @Override
-       public void afterAdminUnlinkedFaxContactDataEvent (@Observes final ObservableAdminUnlinkedFaxNumberEvent event) {
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
+       public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
                // event should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUnlinkedFaxNumber() == null) {
+               } else if (event.getUpdatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.unlinkedFaxNumber is null"); //NOI18N
-               } else if (event.getUnlinkedFaxNumber().getPhoneId() == null) {
+                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() == null) {
                        // userId is null
-                       throw new NullPointerException("event.unlinkedFaxNumber.contactId is null"); //NOI18N
-               } else if (event.getUnlinkedFaxNumber().getPhoneId() < 1) {
+                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() < 1) {
                        // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUnlinkedFaxNumber(), event.getUnlinkedFaxNumber().getPhoneId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
                }
 
-               // Remove it from list
-               this.removeFromContacts(event.getUnlinkedFaxNumber());
+               // Add contact instance only once
+               this.uniqueAddContact(event.getUpdatedContact());
 
-               // Clear all data
-               this.clear();
+               // Add email address to list
+               this.emailAddresses.add(event.getUpdatedContact().getContactEmailAddress());
        }
 
-       @Override
-       public void afterAdminUnlinkedLandLineContactDataEvent (@Observes final ObservableAdminUnlinkedLandLineNumberEvent event) {
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event User registration event
+        */
+       public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
                // event should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUnlinkedLandLineNumber() == null) {
+               } else if (event.getRegisteredUser() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.unlinkedLandLineNumber is null"); //NOI18N
-               } else if (event.getUnlinkedLandLineNumber().getPhoneId() == null) {
+                       throw new NullPointerException("event.registeredUser is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() == null) {
                        // userId is null
-                       throw new NullPointerException("event.unlinkedLandLineNumber.contactId is null"); //NOI18N
-               } else if (event.getUnlinkedLandLineNumber().getPhoneId() < 1) {
+                       throw new NullPointerException("event.registeredUser.userId is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() < 1) {
                        // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUnlinkedLandLineNumber(), event.getUnlinkedLandLineNumber().getPhoneId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N
                }
 
-               // Remove it from list
-               this.removeFromContacts(event.getUnlinkedLandLineNumber());
+               // Get user instance
+               Contact registeredContact = event.getRegisteredUser().getUserContact();
+
+               // Copy all data from registered->user
+               this.copyContact(registeredContact);
+
+               // Add user name and email address
+               this.addUserNameEmailAddress(registeredContact);
 
                // Clear all data
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for unlinked mobile contact by administrators
+        * <p>
+        * @param event Unlinked mobile contact event
+        */
        public void afterAdminUnlinkedMobileContactDataEvent (@Observes final ObservableAdminUnlinkedMobileNumberEvent event) {
                // event should not be null
                if (null == event) {
@@ -427,32 +461,12 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.clear();
        }
 
-       @Override
-       public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUpdatedContact() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
-               } else if (event.getUpdatedContact().getContactId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
-               } else if (event.getUpdatedContact().getContactId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
-               }
-
-               // Add contact instance only once
-               this.uniqueAddContact(event.getUpdatedContact());
-
-               // Add email address to list
-               this.emailAddresses.add(event.getUpdatedContact().getContactEmailAddress());
-       }
-
-       @Override
-       public void afterUserConfirmedAccountEventEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterUserConfirmedAccount (@Observes final ObservableUserConfirmedAccountEvent event) {
                // event should not be null
                if (null == event) {
                        // Throw NPE
@@ -472,7 +486,11 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.uniqueAddContact(event.getConfirmedUser().getUserContact());
        }
 
-       @Override
+       /**
+        * Event observer for logged-in user
+        * <p>
+        * @param event Event instance
+        */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
                // event should not be null
                if (null == event) {
@@ -493,51 +511,15 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.copyContact(event.getLoggedInUser().getUserContact());
        }
 
-       @Override
-       public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // 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.registeredUser is null"); //NOI18N
-               } else if (event.getRegisteredUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.registeredUser.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
-               Contact registeredContact = event.getRegisteredUser().getUserContact();
-
-               // Copy all data from registered->user
-               this.copyContact(registeredContact);
-
-               // Add user name and email address
-               this.addUserNameEmailAddress(registeredContact);
-
-               // Clear all data
-               this.clear();
-       }
-
        @Override
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<Contact> allContacts () {
-               // Debug message
-               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactController.allContacts: contactList.size()={0} - EXIT!", this.contactList.size()));
-
                // Return un-modified list
                return this.contacts;
        }
 
        @Override
        public Contact createContactInstance () {
-               // User message
-               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: CALLED!", this.getClass().getSimpleName()));
-
                // Is all required data set?
                if (!this.isRequiredPersonalDataSet()) {
                        // No, then abort here
@@ -561,8 +543,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                contact.setContactBirthday(this.getBirthday());
                contact.setContactComment(this.getComment());
 
-               // Debug message
-               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: this.emailAddress={1}", this.getClass().getSimpleName(), this.getEmailAddress()));
                // Don't set null or wrong references
                if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
                        // Now the number must be given
@@ -620,8 +600,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                        contact.setContactMobileNumber(mobile);
                }
 
-               // Trace message
-               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: contact={1} - EXIT!", this.getClass().getSimpleName(), contact));
                // Return it
                return contact;
        }
@@ -1036,7 +1014,11 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                return localContact;
        }
 
-       @Override
+       /**
+        * Event observer when a list with unused mobile numbers is being created
+        * <p>
+        * @param event Event being fired
+        */
        public void removeMobileNumberFromListEvent (@Observes final AdminRemoveMobileNumberFromListEvent event) {
                // event should not be null
                if (null == event) {
index 4257510d1b50770f5d30891c5b3e75198243133d..0da470abb43313560898ee945a7e5c20e9dd153b 100644 (file)
@@ -24,19 +24,7 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.events.mobile.remove.AdminRemoveMobileNumberFromListEvent;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
-import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.deleted.ObservableAdminDeletedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 
 /**
  * An interface for user beans
@@ -53,55 +41,6 @@ public interface JobsContactWebSessionController extends Serializable {
         */
        List<Contact> allContacts ();
 
-       /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event);
-
-       /**
-        * Event observer for deleted contact instance by administrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminDeletedContactEvent (final ObservableAdminDeletedContactEvent event);
-
-       /**
-        * Event observer for unlinked fax contact by administrators
-        * <p>
-        * @param event Unlinked fax contact event
-        */
-       void afterAdminUnlinkedFaxContactDataEvent (final ObservableAdminUnlinkedFaxNumberEvent event);
-
-       /**
-        * Event observer for unlinked land-line contact by administrators
-        * <p>
-        * @param event Unlinked land-line contact event
-        */
-       void afterAdminUnlinkedLandLineContactDataEvent (final ObservableAdminUnlinkedLandLineNumberEvent event);
-
-       /**
-        * Event observer for unlinked mobile contact by administrators
-        * <p>
-        * @param event Unlinked mobile contact event
-        */
-       void afterAdminUnlinkedMobileContactDataEvent (final ObservableAdminUnlinkedMobileNumberEvent event);
-
-       /**
-        * Event observer when user confirmed account.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserConfirmedAccountEventEvent (final ObservableUserConfirmedAccountEvent event);
-
-       /**
-        * Event observer when a list with unused mobile numbers is being created
-        * <p>
-        * @param event Event being fired
-        */
-       void removeMobileNumberFromListEvent(final AdminRemoveMobileNumberFromListEvent event);
-
        /**
         * Updates all data from bean in given contact instance
         * <p>
@@ -121,43 +60,6 @@ public interface JobsContactWebSessionController extends Serializable {
         */
        Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
 
-       /**
-        * Event observer for new user registrations
-        * <p>
-        * @param event User registration event
-        */
-       void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event);
-
-       /**
-        * Observes events being fired when an administrator has added a new
-        * contact.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event);
-
-       /**
-        * Observes events being fired when an administrator has linked a new user
-        * with existing contact data.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event);
-
-       /**
-        * Event observer for updated contact data by administrators
-        * <p>
-        * @param event Updated contact data event
-        */
-       void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event);
-
-       /**
-        * Event observer for logged-in user
-        * <p>
-        * @param event Event instance
-        */
-       void afterUserLoginEvent (final ObservableUserLoggedInEvent event);
-
        /**
         * Creates an instance from all properties
         * <p>
index 3f20b39c1dbac19380fbc0d5aa3740256f81708f..557c4c59a525278c15aa2cd88c9545ce0320f44b 100644 (file)
@@ -28,15 +28,24 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
 import org.mxchange.jcontacts.events.fax.linked.AdminLinkedFaxNumberEvent;
+import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
 import org.mxchange.jcontacts.events.fax.unlinked.AdminUnlinkedFaxNumberEvent;
+import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
 import org.mxchange.jcontacts.events.landline.linked.AdminLinkedLandLineNumberEvent;
+import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
 import org.mxchange.jcontacts.events.landline.unlinked.AdminUnlinkedLandLineNumberEvent;
+import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
 import org.mxchange.jcontacts.events.mobile.linked.AdminLinkedMobileNumberEvent;
+import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
 import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent;
+import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
@@ -48,15 +57,6 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
-import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 
 /**
  * An administrative contact phone controller (bean)
@@ -156,7 +156,12 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController impl
                }
        }
 
-       @Override
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) {
                // The event must be valid
                if (null == event) {
@@ -177,7 +182,11 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController impl
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -198,7 +207,11 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController impl
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
                // event should not be null
                if (null == event) {
index d35718bf8d6927766f6566c9bb74f6c6c5e10f3f..8a12b61c84b30f03fee8483a3519797286f4fe36 100644 (file)
@@ -20,9 +20,6 @@ package org.mxchange.jjobs.beans.contact.phone;
 import java.io.Serializable;
 import javax.ejb.Local;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
 
 /**
  * An interface for user beans
@@ -54,29 +51,7 @@ public interface JobsAdminContactPhoneWebRequestController extends Serializable
        String unlinkMobileContactData ();
 
        /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event);
-
-       /**
-        * Observes events being fired when an administrator has added a new
-        * contact.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event);
-
-       /**
-        * Event observer for updated contact data by administrators
-        * <p>
-        * @param event Updated contact data event
-        */
-       void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event);
-
-       /**
-        * Links given contact instance with setted fax number or entered data. If
+        * Links given contact instance with set fax number or entered data. If
         * both is set, a proper exception is thrown as this is an invalid state.
         * <p>
         * @param contact Contact instance to link with existing/new data
@@ -86,7 +61,7 @@ public interface JobsAdminContactPhoneWebRequestController extends Serializable
        String doLinkAddFaxNumber (final Contact contact);
 
        /**
-        * Links given contact instance with setted land-line number or entered
+        * Links given contact instance with set land-line number or entered
         * data. If both is set, a proper exception is thrown as this is an invalid
         * state.
         * <p>
@@ -97,7 +72,7 @@ public interface JobsAdminContactPhoneWebRequestController extends Serializable
        String doLinkAddLandLineNumber (final Contact contact);
 
        /**
-        * Links given contact instance with setted mobile or entered data. If both
+        * Links given contact instance with set mobile or entered data. If both
         * is set, a proper exception is thrown as this is an invalid state.
         * <p>
         * @param contact Contact instance to link with existing/new data
index 7a55240b9389d0afd5c8d6a937acb40c62890fbf..ee524e2b889999abc5610cc94c9dcbe3d0f28fe3 100644 (file)
@@ -27,22 +27,22 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
+import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
+import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
+import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 
 /**
- * An administrative contact phone controller (bean)
+ * A general contact bean (controller)
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
@@ -82,7 +82,12 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.contacts = new HashMap<>(10);
        }
 
-       @Override
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) {
                // The event must be valid
                if (null == event) {
@@ -103,7 +108,11 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -124,7 +133,11 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for unlinked fax contact by administrators
+        * <p>
+        * @param event Unlinked fax contact event
+        */
        public void afterAdminUnlinkedFaxContactDataEvent (@Observes final ObservableAdminUnlinkedFaxNumberEvent event) {
                // event should not be null
                if (null == event) {
@@ -148,7 +161,11 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for unlinked land-line contact by administrators
+        * <p>
+        * @param event Unlinked land-line contact event
+        */
        public void afterAdminUnlinkedLandLineContactDataEvent (@Observes final ObservableAdminUnlinkedLandLineNumberEvent event) {
                // event should not be null
                if (null == event) {
@@ -172,7 +189,11 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for unlinked mobile contact by administrators
+        * <p>
+        * @param event Unlinked mobile contact event
+        */
        public void afterAdminUnlinkedMobileContactDataEvent (@Observes final ObservableAdminUnlinkedMobileNumberEvent event) {
                // event should not be null
                if (null == event) {
@@ -196,7 +217,11 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
                // event should not be null
                if (null == event) {
index 85f1d255db44fdde058ef93fbc76f0315e939326..0c3747f8196d0af1a24bcc581dae1f0a65c9ce42 100644 (file)
@@ -20,12 +20,6 @@ import java.io.Serializable;
 import java.util.List;
 import javax.ejb.Local;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
 
 /**
  * An interface for user beans
@@ -56,47 +50,4 @@ public interface JobsContactPhoneWebSessionController extends Serializable {
         */
        List<Contact> allMobileNumberContacts ();
 
-       /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event);
-
-       /**
-        * Observes events being fired when an administrator has added a new
-        * contact.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event);
-
-       /**
-        * Event observer for updated contact data by administrators
-        * <p>
-        * @param event Updated contact data event
-        */
-       void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event);
-
-       /**
-        * Event observer for unlinked fax contact by administrators
-        * <p>
-        * @param event Unlinked fax contact event
-        */
-       void afterAdminUnlinkedFaxContactDataEvent (final ObservableAdminUnlinkedFaxNumberEvent event);
-
-       /**
-        * Event observer for unlinked land-line contact by administrators
-        * <p>
-        * @param event Unlinked land-line contact event
-        */
-       void afterAdminUnlinkedLandLineContactDataEvent (final ObservableAdminUnlinkedLandLineNumberEvent event);
-
-       /**
-        * Event observer for unlinked mobile contact by administrators
-        * <p>
-        * @param event Unlinked mobile contact event
-        */
-       void afterAdminUnlinkedMobileContactDataEvent (final ObservableAdminUnlinkedMobileNumberEvent event);
-
 }
index b4ba3e294e8a8149a1a3f8dda2c811d67fe0eabc..2a14757faaa1139566390f065a760d6b535f0e15 100644 (file)
@@ -28,8 +28,8 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
-import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
+import org.mxchange.jjobs.beans.BaseJobsController;
 
 /**
  * A country bean
@@ -72,8 +72,13 @@ public class JobsCountryWebApplicationBean extends BaseJobsController implements
                }
        }
 
-       @Override
-       public void afterAdminAddedCountry (@Observes final ObservableAdminAddedCountryEvent event) {
+       /**
+        * Observing method when the event is fired that an administrator added a
+        * new country
+        * <p>
+        * @param event Event instance
+        */
+       public void afterAdminAddedCountryEvent (@Observes final ObservableAdminAddedCountryEvent event) {
                // Is all valid?
                if (null == event) {
                        // Throw NPE
index 948dd681049042c85dd2a3846484c7531675a50c..898eef916b28d02ff3539b9d583e949f9505544c 100644 (file)
@@ -19,7 +19,6 @@ package org.mxchange.jjobs.beans.country;
 import java.io.Serializable;
 import java.util.List;
 import org.mxchange.jcountry.data.Country;
-import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
 
 /**
  * An interface for country beans
@@ -35,12 +34,4 @@ public interface JobsCountryWebApplicationController extends Serializable {
         */
        List<Country> allCountries ();
 
-       /**
-        * Observing method when the event is fired that an administrator added a
-        * new country
-        * <p>
-        * @param event Event instance
-        */
-       void afterAdminAddedCountry (final ObservableAdminAddedCountryEvent event);
-
 }
index 75bcc4f166a44a8a5b68fa623b73355826348cd1..2bed4bfaf6991ea5ebf5e0bad1beee06090fccea 100644 (file)
@@ -49,7 +49,11 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J
         */
        private Locale locale;
 
-       @Override
+       /**
+        * Event observer for logged-in user
+        * <p>
+        * @param event Event instance
+        */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
                // event should not be null
                if (null == event) {
@@ -73,7 +77,11 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J
                }
        }
 
-       @Override
+       /**
+        * Event observer for logged-out user
+        * <p>
+        * @param event Event instance
+        */
        public void afterUserLogoutEvent (@Observes final ObservableUserLogoutEvent event) {
                // event should not be null
                if (null == event) {
index 6aed0a7a4080cef518cb3350b7fb0f51861cde10..dc5f37ae45c3a5c93de813a9d5b26959add9fa35 100644 (file)
@@ -18,8 +18,6 @@ package org.mxchange.jjobs.beans.localization;
 
 import java.io.Serializable;
 import java.util.Locale;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
 
 /**
  * An interface for localization change beans
@@ -28,20 +26,6 @@ import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
  */
 public interface JobsLocalizationSessionController extends Serializable {
 
-       /**
-        * Event observer for logged-in user
-        * <p>
-        * @param event Event instance
-        */
-       void afterUserLoginEvent (final ObservableUserLoggedInEvent event);
-
-       /**
-        * Event observer for logged-out user
-        * <p>
-        * @param event Event instance
-        */
-       void afterUserLogoutEvent (final ObservableUserLogoutEvent event);
-
        /**
         * Getter for locale
         * <p>
index fe8adc934ed29bc404c787dbef2348514fd47464..528bbfb60ddbe3bd324ae80e6a0842b648e3ab73 100644 (file)
@@ -35,8 +35,11 @@ import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jusercore.container.login.LoginContainer;
 import org.mxchange.jusercore.container.login.UserLoginContainer;
+import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
+import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
 import org.mxchange.jusercore.events.logout.UserLogoutEvent;
+import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
@@ -48,9 +51,6 @@ import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
 import org.mxchange.jusercore.model.user.password_history.UserPasswordHistorySessionBeanRemote;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 
 /**
  * A web bean for user registration
@@ -82,11 +82,6 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
         */
        private String baseTemplatePathName;
 
-       /**
-        * Current password
-        */
-       private String userCurrentPassword;
-
        /**
         * Logged-in user instance
         */
@@ -110,6 +105,11 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
        @Inject
        private JobsUserWebSessionController userController;
 
+       /**
+        * Current password
+        */
+       private String userCurrentPassword;
+
        /**
         * Flag whether the user has logged-in, set only from inside
         */
@@ -161,7 +161,12 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                }
        }
 
-       @Override
+       /**
+        * Method being call after user's password has been updated (and history
+        * entry has been created).
+        * <p>
+        * @param event Event being observed
+        */
        public void afterUserUpdatedPasswordEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
                // Check parameter
                if (null == event) {
@@ -285,23 +290,23 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
        }
 
        @Override
-       public String getUserCurrentPassword () {
-               return this.userCurrentPassword;
+       public User getLoggedInUser () {
+               return this.loggedInUser;
        }
 
        @Override
-       public void setUserCurrentPassword (final String userCurrentPassword) {
-               this.userCurrentPassword = userCurrentPassword;
+       public void setLoggedInUser (final User loggedInUser) {
+               this.loggedInUser = loggedInUser;
        }
 
        @Override
-       public User getLoggedInUser () {
-               return this.loggedInUser;
+       public String getUserCurrentPassword () {
+               return this.userCurrentPassword;
        }
 
        @Override
-       public void setLoggedInUser (final User loggedInUser) {
-               this.loggedInUser = loggedInUser;
+       public void setUserCurrentPassword (final String userCurrentPassword) {
+               this.userCurrentPassword = userCurrentPassword;
        }
 
        @Override
index cc44c9589154221f278a9af930a61f2c86744ffb..467c505a6a421d349767ce28d20545de8583e8f3 100644 (file)
@@ -21,7 +21,6 @@ import java.util.List;
 import javax.ejb.Local;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 
 /**
  * An interface for registration web controllers
@@ -31,14 +30,6 @@ import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserP
 @Local
 public interface JobsUserLoginWebSessionController extends Serializable {
 
-       /**
-        * Method being call after user's password has been updated (and history
-        * entry has been created).
-        * <p>
-        * @param event Event being observed
-        */
-       void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event);
-
        /**
         * Checks whether given clear-text password is in user's password history.
         * <p>
index 58163751d6e051869ad9b3392eabbfb3d693877c..a6406fe3a431fb909f18e2aef35444387b72d274 100644 (file)
@@ -72,8 +72,13 @@ public class JobsMobileProviderWebRequestBean extends BaseJobsController impleme
                }
        }
 
-       @Override
-       public void afterAdminAddedMobileProvider (@Observes final AdminAddedMobileProviderEvent event) {
+       /**
+        * Observes events being fired after the administrator has added a new
+        * mobile provider
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedMobileProviderEvent (@Observes final AdminAddedMobileProviderEvent event) {
                // Is all valid?
                if (null == event) {
                        // Throw NPE
index 8b2d65dab2188d8be844c6d0e796866f5af60fc1..fa9a477bbd9854a7b12e60e34449c3f3ac467b5a 100644 (file)
@@ -18,7 +18,6 @@ package org.mxchange.jjobs.beans.mobileprovider;
 
 import java.io.Serializable;
 import java.util.List;
-import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -35,12 +34,4 @@ public interface JobsMobileProviderWebRequestController extends Serializable {
         */
        List<MobileProvider> allMobileProviders ();
 
-       /**
-        * Observes events being fired after the administrator has added a new
-        * mobile provider
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedMobileProvider (final AdminAddedMobileProviderEvent event);
-
 }
index ee37c9e057f70feba9e5dffcd04566d154c85dd8..a1480619462cc7cbfba45837c202c24f0b4dcbd4 100644 (file)
@@ -30,6 +30,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent;
 import org.mxchange.jphone.events.fax.removed.AdminFaxNumberRemovedFromListEvent;
@@ -53,7 +54,6 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
-import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 
 /**
  * Administrative controller (bean) for phone numbers
@@ -248,9 +248,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String deleteFaxData (final DialableFaxNumber faxNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.deleteFaxData: faxNumber={1} - CALLED!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
-
                // Is all data set
                if (faxNumber == null) {
                        // Not set, throw NPE
@@ -296,9 +293,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String deleteLandLineData (final DialableLandLineNumber landLineNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.deleteLandLineData: landLineNumber={1} - CALLED!", this.getClass().getSimpleName(), landLineNumber)); //NOI18N
-
                // Is all data set
                if (landLineNumber == null) {
                        // Not set, throw NPE
@@ -344,9 +338,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String deleteMobileData (final DialableMobileNumber mobileNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.deleteMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber)); //NOI18N
-
                // Is all data set
                if (mobileNumber == null) {
                        // Not set, throw NPE
@@ -386,9 +377,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String editFaxData (final DialableFaxNumber faxNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.editFaxData: faxNumber={1} - CALLED!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
-
                // Is all data set
                if (faxNumber == null) {
                        // Not set, throw NPE
@@ -424,9 +412,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getPhoneCountry(), faxNumber.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), faxNumber.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), faxNumber.getPhoneNumber()))) {
-                       // Log message
-                       System.out.println(MessageFormat.format("{0}.editFaxData: No difference - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
                        // Show message
                        this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -451,9 +436,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String editLandLineData (final DialableLandLineNumber landLineNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.editLandLineData: landLineNumber={1} - CALLED!", this.getClass().getSimpleName(), landLineNumber)); //NOI18N
-
                // Is all data set
                if (landLineNumber == null) {
                        // Not set, throw NPE
@@ -489,9 +471,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getPhoneCountry(), landLineNumber.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), landLineNumber.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), landLineNumber.getPhoneNumber()))) {
-                       // Log message
-                       System.out.println(MessageFormat.format("{0}.editLandLineData: No difference - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
                        // Show message
                        this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -516,9 +495,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public String editMobileData (final DialableMobileNumber mobileNumber) {
-               // Log message
-               System.out.println(MessageFormat.format("{0}.editMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber)); //NOI18N
-
                // Is all data set
                if (mobileNumber == null) {
                        // Not set, throw NPE
@@ -560,14 +536,8 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
                        return ""; //NOI18N
                }
 
-               // Log message
-               System.out.println(MessageFormat.format("{0}.editMobileData: this.mobileProvider.providerId={1},mobileNumber.mobileProvider.providerId={2},this.phoneNumber={3},mobileNumber.phoneNumber={4}", this.getClass().getSimpleName(), this.getMobileProvider().getProviderId(), mobileNumber.getMobileProvider().getProviderId(), this.getPhoneNumber(), mobileNumber.getPhoneNumber())); //NOI18N
-
                // Is the mobile provider and number the same?
                if ((Objects.equals(this.getMobileProvider(), mobileNumber.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), mobileNumber.getPhoneNumber()))) {
-                       // Log message
-                       System.out.println(MessageFormat.format("{0}.editMobileData: No difference - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
                        // Show message
                        this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -660,7 +630,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
 
        @Override
        public void setPhoneNumber (final Long phoneNumber) {
-               System.out.println(MessageFormat.format("{0}: Setting phoneNumber={1},previous:{2}", this.getClass().getSimpleName(), phoneNumber, this.phoneNumber));
                this.phoneNumber = phoneNumber;
        }
 
index 258f38261e3ca57770704eec1debe8f18ae162db..7c43385594f1b9579b1c70f3121b6bdd08bc5452 100644 (file)
@@ -29,6 +29,11 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
+import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
+import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
+import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent;
@@ -41,11 +46,6 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
-import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
-import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
 
 /**
  * Regular controller (bean) for phone numbers
@@ -252,14 +252,8 @@ public class JobsPhoneWebApplicationBean extends BaseJobsController implements J
                        throw new NullPointerException("event.linkedFaxNumer is null");
                }
 
-               // Log message
-               System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedFaxNumberEvent: event.linkedFaxNumber.phoneId=" + event.getLinkedFaxNumber().getPhoneId());
-
                // Is the id number in linked number not set?
                if (event.getLinkedFaxNumber().getPhoneId() == null) {
-                       // Log message
-                       System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedFaxNumberEvent: Adding to list: "+event.getContact().getContactFaxNumber());
-
                        // Then it is a new number, so add it from contact as there the id number has been set
                        this.uniqueAddFaxNumber(event.getContact().getContactFaxNumber());
                }
@@ -294,14 +288,8 @@ public class JobsPhoneWebApplicationBean extends BaseJobsController implements J
                        throw new NullPointerException("event.linkedLandLineNumer is null");
                }
 
-               // Log message
-               System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedLandLineNumberEvent: event.linkedLandLineNumber.phoneId=" + event.getLinkedLandLineNumber().getPhoneId());
-
                // Is the id number in linked number not set?
                if (event.getLinkedLandLineNumber().getPhoneId() == null) {
-                       // Log message
-                       System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedLandLineNumberEvent: Adding to list: "+event.getContact().getContactLandLineNumber());
-
                        // Then it is a new number, so add it from contact as there the id number has been set
                        this.uniqueAddLandLineNumber(event.getContact().getContactLandLineNumber());
                }
@@ -336,14 +324,8 @@ public class JobsPhoneWebApplicationBean extends BaseJobsController implements J
                        throw new NullPointerException("event.linkedMobileNumer is null");
                }
 
-               // Log message
-               System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedMobileNumberEvent: event.linkedMobileNumber.phoneId=" + event.getLinkedMobileNumber().getPhoneId());
-
                // Is the id number in linked number not set?
                if (event.getLinkedMobileNumber().getPhoneId() == null) {
-                       // Log message
-                       System.out.println(this.getClass().getSimpleName()+".afterAdminLinkedMobileNumberEvent: Adding to list: "+event.getContact().getContactMobileNumber());
-
                        // Then it is a new number, so add it from contact as there the id number has been set
                        this.uniqueAddMobileNumber(event.getContact().getContactMobileNumber());
                }
index 82e29446825522106e0bb1e9fb3c349de40193c6..ae0983f9d44a6a6d663bc180efcf1deb6f8e1f86 100644 (file)
@@ -77,7 +77,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
        private JobsFeaturesWebApplicationController featureController;
 
        /**
-        * Reemote register session bean
+        * Remote register session bean
         */
        private UserRegistrationSessionBeanRemote registerBean;
 
index c2b32f4593eb5b1e7c43437cfeb2161a35779f46..5bd05b9a86efa6bd803b338f286daa311f6b65a4 100644 (file)
@@ -176,12 +176,12 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
        private String userName;
 
        /**
-        * User password (unencrypted from web form)
+        * User password (clear-text from web form)
         */
        private String userPassword;
 
        /**
-        * User password repeated (unencrypted from web form)
+        * User password repeated (clear-text from web form)
         */
        private String userPasswordRepeat;
 
@@ -338,7 +338,11 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                return "admin_list_user"; //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event User registration event
+        */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
                // event should not be null
                if (null == event) {
@@ -359,7 +363,6 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                User registeredUser = event.getRegisteredUser();
 
                // @TODO Nothing to do with the user here?
-
                // Clear all data
                this.clear();
        }
index d5599e858bca5e5879c368cfefe15510b632b554..0d96b965d16a05714faaf841658ec6d234e027de 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.user;
 
 import java.io.Serializable;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -27,13 +26,6 @@ import org.mxchange.jusercore.model.user.User;
  */
 public interface JobsAdminUserWebRequestController extends Serializable {
 
-       /**
-        * Event observer for new user registrations
-        * <p>
-        * @param event User registration event
-        */
-       void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event);
-
        /**
         * Adds user instance to database by preparing a complete user instance and
         * sending it to the EJB. The data set in the controller is being verified,
@@ -94,30 +86,30 @@ public interface JobsAdminUserWebRequestController extends Serializable {
        void setUserName (final String userName);
 
        /**
-        * Getter for unencrypted user password
+        * Getter for clear-text user password
         * <p>
-        * @return Unencrypted user password
+        * @return Clear-text user password
         */
        String getUserPassword ();
 
        /**
-        * Setter for unencrypted user password
+        * Setter for clear-text user password
         * <p>
-        * @param userPassword Unencrypted user password
+        * @param userPassword Clear-text user password
         */
        void setUserPassword (final String userPassword);
 
        /**
-        * Getter for unencrypted user password repeated
+        * Getter for clear-text user password repeated
         * <p>
-        * @return Unencrypted user password repeated
+        * @return Clear-text user password repeated
         */
        String getUserPasswordRepeat ();
 
        /**
-        * Setter for unencrypted user password repeated
+        * Setter for clear-text user password repeated
         * <p>
-        * @param userPasswordRepeat Unencrypted user password repeated
+        * @param userPasswordRepeat Clear-text user password repeated
         */
        void setUserPasswordRepeat (final String userPasswordRepeat);
 
index 51bbe13c18c91fd1b2400fccfdcfba72427c5555..f9ea8067cdb717c5f5180e99fb561f74c3bd70a4 100644 (file)
@@ -36,17 +36,7 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
-import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
-import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
-import org.mxchange.jusercore.model.user.UserUtils;
-import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
@@ -58,6 +48,15 @@ import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserP
 import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
 import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
 import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
+import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
+import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+import org.mxchange.jusercore.model.user.UserUtils;
+import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 
 /**
  * A user controller (bean)
@@ -85,12 +84,6 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        @Inject
        private JobsFeaturesWebApplicationController featureController;
 
-       /**
-        * Localization controller
-        */
-       @Inject
-       private JobsLocalizationSessionController localizationController;
-
        /**
         * Event being fired when user updated personal data
         */
@@ -130,12 +123,12 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        private List<String> userNameList;
 
        /**
-        * User password (unencrypted from web form)
+        * User password (clear-text from web form)
         */
        private String userPassword;
 
        /**
-        * User password repeated (unencrypted from web form)
+        * User password repeated (clear-text from web form)
         */
        private String userPasswordRepeat;
 
@@ -162,14 +155,18 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                        Context context = new InitialContext();
 
                        // Try to lookup
-                       this.userBean = (UserSessionBeanRemote) context.lookup("java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+                       this.userBean = (UserSessionBeanRemote) context.lookup("java:global/jrecruiter-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
                } catch (final NamingException e) {
                        // Throw again
                        throw new FaceletException(e);
                }
        }
 
-       @Override
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -196,7 +193,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.setUserId(event.getAddedUser().getUserId());
        }
 
-       @Override
+       /**
+        * Event observer for deleted user accounts (by administrator)
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -220,7 +221,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer for linked users with existing contact data
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -247,7 +252,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.setUserId(event.getLinkedUser().getUserId());
        }
 
-       @Override
+       /**
+        * Event observer for locked users
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminLockedUserEvent (@Observes final ObservableAdminLockedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -268,7 +277,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.updateList(event.getLockedUser());
        }
 
-       @Override
+       /**
+        * Event observer for unlocked users
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminUnlockedUserEvent (@Observes final ObservableAdminUnlockedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -289,7 +302,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.updateList(event.getUnlockedUser());
        }
 
-       @Override
+       /**
+        * Event observer for updated user data by administrator
+        * <p>
+        * @param event Event being updated
+        */
        public void afterAdminUpdatedUserDataEvent (@Observes final ObservableAdminUpdatedUserDataEvent event) {
                // event should not be null
                if (null == event) {
@@ -313,7 +330,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.clear();
        }
 
-       @Override
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserConfirmedAccountEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
                // event should not be null
                if (null == event) {
@@ -334,7 +355,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.updateList(event.getConfirmedUser());
        }
 
-       @Override
+       /**
+        * Event observer for logged-in user
+        * <p>
+        * @param event Event instance
+        */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
                // event should not be null
                if (null == event) {
@@ -364,7 +389,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                }
        }
 
-       @Override
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event User registration event
+        */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
                // event should not be null
                if (null == event) {
@@ -406,7 +435,12 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.setUserId(registeredUser.getUserId());
        }
 
-       @Override
+       /**
+        * Method being call after user's password has been updated (and history
+        * entry has been created).
+        * <p>
+        * @param event Event being observed
+        */
        public void afterUserUpdatedPasswordEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
                // Check parameter
                if (null == event) {
@@ -427,7 +461,11 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.updateList(event.getPasswordHistory().getUserPasswordHistoryUser());
        }
 
-       @Override
+       /**
+        * Listens to fired event when user updated personal data
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserUpdatedPersonalDataEvent (@Observes final ObservableUpdatedUserPersonalDataEvent event) {
                // Check parameter
                if (null == event) {
@@ -464,6 +502,9 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
 
        @Override
        public User createUserInstance (final boolean createContactData) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: CALLED!", this.getClass().getSimpleName()));
+
                // Required personal data must be set
                assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
 
@@ -487,8 +528,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                        this.setUserPasswordRepeat(randomPassword);
                }
 
-               // Set local, user name and mode
-               user.setUserLocale(this.localizationController.getLocale());
+               // Set user name and mode
                user.setUserName(this.getUserName());
                user.setUserProfileMode(this.getUserProfileMode());
 
@@ -497,16 +537,25 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                        // Create contact instance
                        Contact contact = this.contactController.createContactInstance();
 
+                       // Debug message
+                       //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: contact={1}", this.getClass().getSimpleName(), contact));
+
                        // Set contact in user
                        user.setUserContact(contact);
                }
 
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: user={1} - EXIT!", this.getClass().getSimpleName(), user));
+
                // Return it
                return user;
        }
 
        @Override
        public User createUserLogin () {
+               // Trace message
+               //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: CALLED!", this.getClass().getSimpleName()));
+
                // Is all data set?
                if (this.getUserName() == null) {
                        // Throw NPE
@@ -522,6 +571,9 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                // Update all data ...
                recruiter.setUserName(this.getUserName());
 
+               // Trace message
+               //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: recruiter={1} - EXIT!", this.getClass().getSimpleName(), recruiter));
+
                // Return the new instance
                return recruiter;
        }
@@ -844,6 +896,9 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                if (this.userNameList.contains(user.getUserName())) {
                        // Abort here
                        throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N
+               } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
+                       // Already added
+                       throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N
                }
 
                // Add user name
index cfa5baaf0f4e4bf96fdf55f67c8f4a31776a13d6..0404031a77a7ce248798c8af2f74c36609a55398 100644 (file)
@@ -23,17 +23,6 @@ import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
-import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
-import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
-import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
-import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
-import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
-import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
 
 /**
  * An interface for user beans
@@ -47,84 +36,6 @@ public interface JobsUserWebSessionController extends Serializable {
         */
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
-       /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event);
-
-       /**
-        * Event observer for deleted user accounts (by administrator)
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event);
-
-       /**
-        * Event observer for linked users with existing contact data
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event);
-
-       /**
-        * Event observer for locked users
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminLockedUserEvent (final ObservableAdminLockedUserEvent event);
-
-       /**
-        * Event observer for unlocked users
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminUnlockedUserEvent (final ObservableAdminUnlockedUserEvent event);
-
-       /**
-        * Event observer for updated user data by administrator
-        * <p>
-        * @param event Event being updated
-        */
-       void afterAdminUpdatedUserDataEvent (final ObservableAdminUpdatedUserDataEvent event);
-
-       /**
-        * Event observer when user confirmed account.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserConfirmedAccountEvent (final ObservableUserConfirmedAccountEvent event);
-
-       /**
-        * Method being call after user's password has been updated (and history
-        * entry has been created).
-        * <p>
-        * @param event Event being observed
-        */
-       void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event);
-
-       /**
-        * Listens to fired event when user updated personal data
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserUpdatedPersonalDataEvent (final ObservableUpdatedUserPersonalDataEvent event);
-
-       /**
-        * Event observer for new user registrations
-        * <p>
-        * @param event User registration event
-        */
-       void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event);
-
-       /**
-        * Event observer for logged-in user
-        * <p>
-        * @param event Event instance
-        */
-       void afterUserLoginEvent (final ObservableUserLoggedInEvent event);
-
        /**
         * All users
         * <p>
@@ -234,30 +145,30 @@ public interface JobsUserWebSessionController extends Serializable {
        void setUserName (final String userName);
 
        /**
-        * Getter for unencrypted user password
+        * Getter for clear-text user password
         * <p>
-        * @return Unencrypted user password
+        * @return Clear-text user password
         */
        String getUserPassword ();
 
        /**
-        * Setter for unencrypted user password
+        * Setter for clear-text user password
         * <p>
-        * @param userPassword Unencrypted user password
+        * @param userPassword Clear-text user password
         */
        void setUserPassword (final String userPassword);
 
        /**
-        * Getter for unencrypted user password repeated
+        * Getter for clear-text user password repeated
         * <p>
-        * @return Unencrypted user password repeated
+        * @return Clear-text user password repeated
         */
        String getUserPasswordRepeat ();
 
        /**
-        * Setter for unencrypted user password repeated
+        * Setter for clear-text user password repeated
         * <p>
-        * @param userPasswordRepeat Unencrypted user password repeated
+        * @param userPasswordRepeat Clear-text user password repeated
         */
        void setUserPasswordRepeat (final String userPasswordRepeat);
 
index b82eb125a43e8e90352961c1ce6af11dc5203ff7..755219246491532f32e6a51764d623b46cc028d9 100644 (file)
@@ -72,12 +72,12 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
        private JobsUserLoginWebSessionController userLoginController;
 
        /**
-        * User password (unencrypted from web form)
+        * User password (clear-text from web form)
         */
        private String userPassword;
 
        /**
-        * User password repeated (unencrypted from web form)
+        * User password repeated (clear-text from web form)
         */
        private String userPasswordRepeat;
 
index 742f05a5c4586eeb6fc734744885265d1581a451..734c267d384d0e983cfe685553d7e88cf0647227 100644 (file)
@@ -28,30 +28,30 @@ import javax.ejb.Local;
 public interface JobsUserPasswordWebRequestController extends Serializable {
 
        /**
-        * Getter for unencrypted user password
+        * Getter for clear-text user password
         * <p>
-        * @return Unencrypted user password
+        * @return Clear-text user password
         */
        String getUserPassword ();
 
        /**
-        * Setter for unencrypted user password
+        * Setter for clear-text user password
         * <p>
-        * @param userPassword Unencrypted user password
+        * @param userPassword Clear-text user password
         */
        void setUserPassword (final String userPassword);
 
        /**
-        * Getter for unencrypted user password repeated
+        * Getter for clear-text user password repeated
         * <p>
-        * @return Unencrypted user password repeated
+        * @return Clear-text user password repeated
         */
        String getUserPasswordRepeat ();
 
        /**
-        * Setter for unencrypted user password repeated
+        * Setter for clear-text user password repeated
         * <p>
-        * @param userPasswordRepeat Unencrypted user password repeated
+        * @param userPasswordRepeat Clear-text user password repeated
         */
        void setUserPasswordRepeat (final String userPasswordRepeat);
 
index bf85b50516dc04f371a486b9407214ecbc1e4dae..1628e9e12e208e008269cf004573c9517b746fb5 100644 (file)
@@ -61,9 +61,6 @@ public class JobsContactConverter implements Converter {
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -80,14 +77,8 @@ public class JobsContactConverter implements Converter {
                        // Try to parse the value as long
                        Long contactId = Long.valueOf(submittedValue);
 
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contactId{0}", contactId)); //NOI18N
-
                        // Try to get user instance from it
                        contact = this.contactBean.findContactById(contactId);
-
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: contact={0}", contact)); //NOI18N
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
@@ -96,9 +87,6 @@ public class JobsContactConverter implements Converter {
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
 
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: contact={0} - EXIT!", contact)); //NOI18N
-
                // Return it
                return contact;
        }
index 31d32d1be67a78b20be2ebfffbe6dd682f7d9aa6..f484608570fab16376811abf43e7c25099efdfa1 100644 (file)
@@ -62,9 +62,6 @@ public class JobsCountryConverter implements Converter {
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},this.countryBean={3} - CALLED!", context, component, submittedValue, this.countryBean)); //NOI18N
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -88,9 +85,6 @@ public class JobsCountryConverter implements Converter {
                        // Category id should not be below 1
                        assert (countryId > 0) : "countryId is smaller than one: " + countryId; //NOI18N
 
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: countryId={0}", countryId)); //NOI18N
-
                        // Try to find it
                        for (final Country cntry : countryList) {
                                // Is the id the same? (null-safe)
@@ -105,9 +99,6 @@ public class JobsCountryConverter implements Converter {
                        throw new ConverterException(ex);
                }
 
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: country={0} - EXIT!", country)); //NOI18N
-
                // Return it
                return country;
        }
index 089ee09d691d48965017eed0c12f5bb6d7238a89..6239b924534f293ff5f5e61267cc7d1f84b19277 100644 (file)
@@ -62,9 +62,6 @@ public class JobsMobileNumberConverter implements Converter {
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -91,9 +88,6 @@ public class JobsMobileNumberConverter implements Converter {
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
 
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: mobileNumber={0} - EXIT!", mobileNumber)); //NOI18N
-
                // Return it
                return mobileNumber;
        }
index c1784a158350a66237e2828af5cbda22f7212588..2bfc29825a6df5110f65af6e94b0206d4a930b04 100644 (file)
@@ -62,9 +62,6 @@ public class JobsMobileProviderConverter implements Converter {
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -88,9 +85,6 @@ public class JobsMobileProviderConverter implements Converter {
                        // Category id should not be below 1
                        assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N
 
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: providerId={0}", providerId)); //NOI18N
-
                        // Try to find it
                        for (final MobileProvider prov : providerList) {
                                // Is the id the same? (null-safe)
@@ -105,9 +99,6 @@ public class JobsMobileProviderConverter implements Converter {
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logException(ex);
                }
 
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: provider={0} - EXIT!", provider)); //NOI18N
-
                // Return it
                return provider;
        }
index a95ff41404bba5628a7eb70c53ee2740880a4d03..711356ca1940104fdda6963d05458a3e935868a2 100644 (file)
@@ -61,9 +61,6 @@ public class JobsUserConverter implements Converter {
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -80,14 +77,8 @@ public class JobsUserConverter implements Converter {
                        // Try to parse the value as long
                        Long userId = Long.valueOf(submittedValue);
 
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: userId{0}", userId)); //NOI18N
-
                        // Try to get user instance from it
                        user = this.userBean.findUserById(userId);
-
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: user={0}", user)); //NOI18N
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
@@ -96,9 +87,6 @@ public class JobsUserConverter implements Converter {
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
                }
 
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: user={0} - EXIT!", user)); //NOI18N
-
                // Return it
                return user;
        }
index 3b4920ae4b059aea9a31bf4285c6b9ca0ca073e1..209e7150e1f56aa176979b2a73284cb0a447a4f2 100644 (file)
@@ -58,9 +58,6 @@ public class JobsBirthdayValidator extends BaseDateValidator implements Validato
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
-
                // All accepted, required fields
                String[] requiredFields = {"birthday", "contactBirthday"}; //NOI18N
 
@@ -71,8 +68,6 @@ public class JobsBirthdayValidator extends BaseDateValidator implements Validato
                Date birthday = (Date) value;
 
                // @TODO Finish this, e.g. load maximum,minimum birthday from properties file
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
        }
 
 }
index 66daec0f7395c06f796a8f589137790be0a8b16a..34ad5ad104b4fe243257d0c1e8cea29f1d2836a5 100644 (file)
@@ -81,9 +81,6 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator
         * @param event User registration event
         */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("UserIdValidator:afterUserRegistrationEvent: event={0} - CALLED!", event)); //NOI18N
-
                // event should not be null
                if (null == event) {
                        // Throw NPE
@@ -102,21 +99,12 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator
                // Get user instance
                User registeredUser = event.getRegisteredUser();
 
-               // Debug message
-               // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("UserIdValidator:afterUserRegistrationEvent: registeredUser={0}", registeredUser)); //NOI18N
-
                // Update cache
                JobsUserIdValidator.cachedStatus.add(registeredUser.getUserId());
-
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace("UserIdValidator:afterUserRegistrationEvent: EXIT!"); //NOI18N
        }
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
-
                // All accepted, required fields
                String[] requiredFields = {"userId"}; //NOI18N
 
@@ -146,9 +134,6 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator
 
                // Add to cache if valid
                JobsUserIdValidator.cachedStatus.add(userId);
-
-               // Trace message
-               // NOISY-DEBUG: this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
        }
 
 }