From: Roland Häder Date: Thu, 20 Apr 2017 15:53:23 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=153bb750b1f1eff5041b2accadef81fab048e7e3;p=jjobs-war.git Please cherry-pick: - 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 --- diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index 2ead9fac..4e4557cd 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -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. + *

+ * @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 + *

+ * @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 + *

+ * @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. + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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. + *

+ * @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 + *

+ * @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 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 + *

+ * @param event Event being fired + */ public void removeMobileNumberFromListEvent (@Observes final AdminRemoveMobileNumberFromListEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java index 4257510d..0da470ab 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java @@ -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 allContacts (); - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Event observer for deleted contact instance by administrator - *

- * @param event Event being fired - */ - void afterAdminDeletedContactEvent (final ObservableAdminDeletedContactEvent event); - - /** - * Event observer for unlinked fax contact by administrators - *

- * @param event Unlinked fax contact event - */ - void afterAdminUnlinkedFaxContactDataEvent (final ObservableAdminUnlinkedFaxNumberEvent event); - - /** - * Event observer for unlinked land-line contact by administrators - *

- * @param event Unlinked land-line contact event - */ - void afterAdminUnlinkedLandLineContactDataEvent (final ObservableAdminUnlinkedLandLineNumberEvent event); - - /** - * Event observer for unlinked mobile contact by administrators - *

- * @param event Unlinked mobile contact event - */ - void afterAdminUnlinkedMobileContactDataEvent (final ObservableAdminUnlinkedMobileNumberEvent event); - - /** - * Event observer when user confirmed account. - *

- * @param event Event being fired - */ - void afterUserConfirmedAccountEventEvent (final ObservableUserConfirmedAccountEvent event); - - /** - * Event observer when a list with unused mobile numbers is being created - *

- * @param event Event being fired - */ - void removeMobileNumberFromListEvent(final AdminRemoveMobileNumberFromListEvent event); - /** * Updates all data from bean in given contact instance *

@@ -121,43 +60,6 @@ public interface JobsContactWebSessionController extends Serializable { */ Contact lookupContactById (final Long contactId) throws ContactNotFoundException; - /** - * Event observer for new user registrations - *

- * @param event User registration event - */ - void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @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. - *

- * @param event Event being fired - */ - void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event); - - /** - * Event observer for logged-in user - *

- * @param event Event instance - */ - void afterUserLoginEvent (final ObservableUserLoggedInEvent event); - /** * Creates an instance from all properties *

diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java index 3f20b39c..557c4c59 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java @@ -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. + *

+ * @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 + *

+ * @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 + *

+ * @param event Updated contact data event + */ public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java index d35718bf..8a12b61c 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java @@ -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 - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @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. *

* @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. *

@@ -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. *

* @param contact Contact instance to link with existing/new data diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java index 7a55240b..ee524e2b 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java @@ -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) *

* @author Roland Häder */ @@ -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. + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @param event Updated contact data event + */ public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java index 85f1d255..0c3747f8 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java @@ -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 allMobileNumberContacts (); - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event); - - /** - * Event observer for unlinked fax contact by administrators - *

- * @param event Unlinked fax contact event - */ - void afterAdminUnlinkedFaxContactDataEvent (final ObservableAdminUnlinkedFaxNumberEvent event); - - /** - * Event observer for unlinked land-line contact by administrators - *

- * @param event Unlinked land-line contact event - */ - void afterAdminUnlinkedLandLineContactDataEvent (final ObservableAdminUnlinkedLandLineNumberEvent event); - - /** - * Event observer for unlinked mobile contact by administrators - *

- * @param event Unlinked mobile contact event - */ - void afterAdminUnlinkedMobileContactDataEvent (final ObservableAdminUnlinkedMobileNumberEvent event); - } diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java index b4ba3e29..2a14757f 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java @@ -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 + *

+ * @param event Event instance + */ + public void afterAdminAddedCountryEvent (@Observes final ObservableAdminAddedCountryEvent event) { // Is all valid? if (null == event) { // Throw NPE diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java index 948dd681..898eef91 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java @@ -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 allCountries (); - /** - * Observing method when the event is fired that an administrator added a - * new country - *

- * @param event Event instance - */ - void afterAdminAddedCountry (final ObservableAdminAddedCountryEvent event); - } diff --git a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java index 75bcc4f1..2bed4bfa 100644 --- a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java @@ -49,7 +49,11 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J */ private Locale locale; - @Override + /** + * Event observer for logged-in user + *

+ * @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 + *

+ * @param event Event instance + */ public void afterUserLogoutEvent (@Observes final ObservableUserLogoutEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java index 6aed0a7a..dc5f37ae 100644 --- a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java @@ -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 - *

- * @param event Event instance - */ - void afterUserLoginEvent (final ObservableUserLoggedInEvent event); - - /** - * Event observer for logged-out user - *

- * @param event Event instance - */ - void afterUserLogoutEvent (final ObservableUserLogoutEvent event); - /** * Getter for locale *

diff --git a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java index fe8adc93..528bbfb6 100644 --- a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java @@ -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). + *

+ * @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 diff --git a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java index cc44c958..467c505a 100644 --- a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionController.java @@ -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). - *

- * @param event Event being observed - */ - void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event); - /** * Checks whether given clear-text password is in user's password history. *

diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java index 58163751..a6406fe3 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java @@ -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 + *

+ * @param event Event being fired + */ + public void afterAdminAddedMobileProviderEvent (@Observes final AdminAddedMobileProviderEvent event) { // Is all valid? if (null == event) { // Throw NPE diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java index 8b2d65da..fa9a477b 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java @@ -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 allMobileProviders (); - /** - * Observes events being fired after the administrator has added a new - * mobile provider - *

- * @param event Event being fired - */ - void afterAdminAddedMobileProvider (final AdminAddedMobileProviderEvent event); - } diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index ee37c9e0..a1480619 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java index 258f3826..7c433855 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationBean.java @@ -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()); } diff --git a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java index 82e29446..ae0983f9 100644 --- a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java @@ -77,7 +77,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement private JobsFeaturesWebApplicationController featureController; /** - * Reemote register session bean + * Remote register session bean */ private UserRegistrationSessionBeanRemote registerBean; diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index c2b32f45..5bd05b9a 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -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 + *

+ * @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(); } diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java index d5599e85..0d96b965 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java @@ -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 - *

- * @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 *

- * @return Unencrypted user password + * @return Clear-text user password */ String getUserPassword (); /** - * Setter for unencrypted user password + * Setter for clear-text user password *

- * @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 *

- * @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 *

- * @param userPasswordRepeat Unencrypted user password repeated + * @param userPasswordRepeat Clear-text user password repeated */ void setUserPasswordRepeat (final String userPasswordRepeat); diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index 51bbe13c..f9ea8067 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -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 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 + *

+ * @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) + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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. + *

+ * @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 + *

+ * @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 + *

+ * @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). + *

+ * @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 + *

+ * @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 diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java index cfa5baaf..0404031a 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java @@ -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 - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Event observer for deleted user accounts (by administrator) - *

- * @param event Event being fired - */ - void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event); - - /** - * Event observer for linked users with existing contact data - *

- * @param event Event being fired - */ - void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event); - - /** - * Event observer for locked users - *

- * @param event Event being fired - */ - void afterAdminLockedUserEvent (final ObservableAdminLockedUserEvent event); - - /** - * Event observer for unlocked users - *

- * @param event Event being fired - */ - void afterAdminUnlockedUserEvent (final ObservableAdminUnlockedUserEvent event); - - /** - * Event observer for updated user data by administrator - *

- * @param event Event being updated - */ - void afterAdminUpdatedUserDataEvent (final ObservableAdminUpdatedUserDataEvent event); - - /** - * Event observer when user confirmed account. - *

- * @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). - *

- * @param event Event being observed - */ - void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event); - - /** - * Listens to fired event when user updated personal data - *

- * @param event Event being fired - */ - void afterUserUpdatedPersonalDataEvent (final ObservableUpdatedUserPersonalDataEvent event); - - /** - * Event observer for new user registrations - *

- * @param event User registration event - */ - void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event); - - /** - * Event observer for logged-in user - *

- * @param event Event instance - */ - void afterUserLoginEvent (final ObservableUserLoggedInEvent event); - /** * All users *

@@ -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 *

- * @return Unencrypted user password + * @return Clear-text user password */ String getUserPassword (); /** - * Setter for unencrypted user password + * Setter for clear-text user password *

- * @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 *

- * @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 *

- * @param userPasswordRepeat Unencrypted user password repeated + * @param userPasswordRepeat Clear-text user password repeated */ void setUserPasswordRepeat (final String userPasswordRepeat); diff --git a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java index b82eb125..75521924 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java @@ -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; diff --git a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java index 742f05a5..734c267d 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java @@ -28,30 +28,30 @@ import javax.ejb.Local; public interface JobsUserPasswordWebRequestController extends Serializable { /** - * Getter for unencrypted user password + * Getter for clear-text user password *

- * @return Unencrypted user password + * @return Clear-text user password */ String getUserPassword (); /** - * Setter for unencrypted user password + * Setter for clear-text user password *

- * @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 *

- * @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 *

- * @param userPasswordRepeat Unencrypted user password repeated + * @param userPasswordRepeat Clear-text user password repeated */ void setUserPasswordRepeat (final String userPasswordRepeat); diff --git a/src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java b/src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java index bf85b505..1628e9e1 100644 --- a/src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java +++ b/src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java b/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java index 31d32d1b..f4846085 100644 --- a/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java +++ b/src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java b/src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java index 089ee09d..6239b924 100644 --- a/src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java +++ b/src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java b/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java index c1784a15..2bfc2982 100644 --- a/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java +++ b/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java b/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java index a95ff414..711356ca 100644 --- a/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java +++ b/src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java @@ -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; } diff --git a/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java b/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java index 3b4920ae..209e7150 100644 --- a/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java +++ b/src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java @@ -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 } } diff --git a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java index 66daec0f..34ad5ad1 100644 --- a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java +++ b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java @@ -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 } }