import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.helper.created.ObservableHelperCreatedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
* <p>
* @param event Event being fired
*/
- public void afterHelperCreatedContactEvent (@Observes final ObservableHelperCreatedContactEvent event) {
+ public void afterCreatedContactEvent (@Observes final ObservableCreatedContactEvent event) {
// Log message
- //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterHelperCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
// The event instance must be valid
if (null == event) {
}
// Log message
- //* NOISY-DEBUG: */ System.out.println("AdminContactController::afterHelperCreatedContactEvent(): EXIT!"); //NOI18N
+ //* NOISY-DEBUG: */ System.out.println("AdminContactController::afterCreatedContactEvent(): EXIT!"); //NOI18N
}
@Override
import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestController;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
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.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@Inject
private AddressbookWebRequestHelperController beanHelper;
- /**
- * Event being fired when a fax number has been unlinked
- */
- @Inject
- @Any
- private Event<ObservableAdminUnlinkedFaxNumberEvent> faxNumberUnlinkedEvent;
-
- /**
- * Event being fired when a land-line number has been unlinked
- */
- @Inject
- @Any
- private Event<ObservableAdminUnlinkedLandLineNumberEvent> landLineNumberUnlinkedEvent;
-
- /**
- * Event being fired when admin unlinks mobile from contact
- */
- @Inject
- @Any
- private Event<ObservableAdminUnlinkedMobileNumberEvent> mobileNumberUnlinkedEvent;
/**
* Area code (city dial prefix) for fax number
* Fax number
*/
private Long faxNumber;
+ /**
+ * Event being fired when a fax number has been unlinked
+ */
+ @Inject
+ @Any
+ private Event<ObservableAdminUnlinkedFaxNumberEvent> faxNumberUnlinkedEvent;
/**
* Area code (city dial prefix) for land-line number
* Land-line number
*/
private Long landLineNumber;
-
/**
- * Mobile provider
+ * Event being fired when a land-line number has been unlinked
*/
- private MobileProvider mobileProvider;
+ @Inject
+ @Any
+ private Event<ObservableAdminUnlinkedLandLineNumberEvent> landLineNumberUnlinkedEvent;
/**
* Mobile number
*/
private Long mobileNumber;
+ /**
+ * Event being fired when admin unlinks mobile from contact
+ */
+ @Inject
+ @Any
+ private Event<ObservableAdminUnlinkedMobileNumberEvent> mobileNumberUnlinkedEvent;
+ /**
+ * Mobile provider
+ */
+ private MobileProvider mobileProvider;
/**
* Default constructor
this.clear();
}
+ /**
+ * Observer for events being fired when a bean helper has successfully
+ * created a contact instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedContactEvent (@Observes final ObservableCreatedContactEvent event) {
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
+
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE again
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getCreatedContact() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.createdContact is null"); //NOI18N //NOI18N
+ } else if (event.getCreatedContact().getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N //NOI18N
+ } else if (event.getCreatedContact().getContactId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
+ }
+
+ // Set it here
+ this.setContact(event.getCreatedContact());
+ }
+
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * fax number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedFaxNumberEvent (@Observes final ObservableCreatedFaxNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getFaxNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.faxNumber is null"); //NOI18N
+ } else if (event.getFaxNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.faxNumber.phoneId is null"); //NOI18N
+ } else if (event.getFaxNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.faxNumber.phoneId={0} is invalid", event.getFaxNumber().getPhoneId())); //NOI18N
+ }
+
+ // Get fax number from event
+ DialableFaxNumber number = event.getFaxNumber();
+
+ // Copy all data to this bean
+ this.setPhoneId(number.getPhoneId());
+ this.setFaxCountry(number.getPhoneCountry());
+ this.setFaxAreaCode(number.getPhoneAreaCode());
+ this.setFaxNumber(number.getPhoneNumber());
+ this.setPhoneEntryCreated(number.getPhoneEntryCreated());
+ this.setPhoneEntryUpdated(number.getPhoneEntryUpdated());
+ }
+
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * land-line number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedLandLineNumberEvent (@Observes final ObservableCreatedLandLineNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getLandLineNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.landLineNumber is null"); //NOI18N
+ } else if (event.getLandLineNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.landLineNumber.phoneId is null"); //NOI18N
+ } else if (event.getLandLineNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.landLineNumber.phoneId={0} is invalid", event.getLandLineNumber().getPhoneId())); //NOI18N
+ }
+
+ // Get fax number from event
+ DialableLandLineNumber number = event.getLandLineNumber();
+
+ // Copy all data to this bean
+ this.setPhoneId(number.getPhoneId());
+ this.setLandLineCountry(number.getPhoneCountry());
+ this.setLandLineAreaCode(number.getPhoneAreaCode());
+ this.setLandLineNumber(number.getPhoneNumber());
+ this.setPhoneEntryCreated(number.getPhoneEntryCreated());
+ this.setPhoneEntryUpdated(number.getPhoneEntryUpdated());
+ }
+
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * mobile number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedMobileNumberEvent (@Observes final ObservableCreatedMobileNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getMobileNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.mobileNumber is null"); //NOI18N
+ } else if (event.getMobileNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.mobileNumber.phoneId is null"); //NOI18N
+ } else if (event.getMobileNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.mobileNumber.phoneId={0} is invalid", event.getMobileNumber().getPhoneId())); //NOI18N
+ }
+
+ // Get fax number from event
+ DialableMobileNumber number = event.getMobileNumber();
+
+ // Copy all data to this bean
+ this.setPhoneId(number.getPhoneId());
+ this.setMobileProvider(number.getMobileProvider());
+ this.setMobileNumber(number.getPhoneNumber());
+ this.setPhoneEntryCreated(number.getPhoneEntryCreated());
+ this.setPhoneEntryUpdated(number.getPhoneEntryUpdated());
+ }
+
/**
* Links fax number to contact from bean helper as "main fax number".
* <p>
this.landLineNumber = landLineNumber;
}
- /**
- * Getter for mobile provider
- * <p>
- * @return Mobile provider
- */
- public MobileProvider getMobileProvider () {
- return this.mobileProvider;
- }
-
- /**
- * Setter for mobile provider
- * <p>
- * @param mobileProvider Mobile provider
- */
- public void setMobileProvider (final MobileProvider mobileProvider) {
- this.mobileProvider = mobileProvider;
- }
/**
* Getter for mobile number
public void setMobileNumber (final Long mobileNumber) {
this.mobileNumber = mobileNumber;
}
+ /**
+ * Getter for mobile provider
+ * <p>
+ * @return Mobile provider
+ */
+ public MobileProvider getMobileProvider () {
+ return this.mobileProvider;
+ }
+ /**
+ * Setter for mobile provider
+ * <p>
+ * @param mobileProvider Mobile provider
+ */
+ public void setMobileProvider (final MobileProvider mobileProvider) {
+ this.mobileProvider = mobileProvider;
+ }
/**
* Post-construction method
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.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
import org.mxchange.jphone.phonenumbers.DialableNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
this.clear();
}
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * fax number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedFaxNumberEvent (@Observes final ObservableCreatedFaxNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getFaxNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.faxNumber is null"); //NOI18N
+ } else if (event.getFaxNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.faxNumber.phoneId is null"); //NOI18N
+ } else if (event.getFaxNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.faxNumber.phoneId={0} is invalid", event.getFaxNumber().getPhoneId())); //NOI18N
+ }
+
+ // Set it here
+ this.setFaxNumber(event.getFaxNumber());
+ }
+
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * land-line number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedLandLineNumberEvent (@Observes final ObservableCreatedLandLineNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getLandLineNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.landLineNumber is null"); //NOI18N
+ } else if (event.getLandLineNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.landLineNumber.phoneId is null"); //NOI18N
+ } else if (event.getLandLineNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.landLineNumber.phoneId={0} is invalid", event.getLandLineNumber().getPhoneId())); //NOI18N
+ }
+
+ // Set it here
+ this.setLandLineNumber(event.getLandLineNumber());
+ }
+
+ /**
+ * Observes events being fired when a bean helper has successfully created a
+ * mobile number instance.
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterCreatedMobileNumberEvent (@Observes final ObservableCreatedMobileNumberEvent event) {
+ // The event instance must be valid
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getMobileNumber() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.mobileNumber is null"); //NOI18N
+ } else if (event.getMobileNumber().getPhoneId() == null) {
+ // Throw NPE yet again
+ throw new NullPointerException("event.mobileNumber.phoneId is null"); //NOI18N
+ } else if (event.getMobileNumber().getPhoneId() < 1) {
+ // Throw NPE yet again
+ throw new NullPointerException(MessageFormat.format("event.mobileNumber.phoneId={0} is invalid", event.getMobileNumber().getPhoneId())); //NOI18N
+ }
+
+ // Set it here
+ this.setMobileNumber(event.getMobileNumber());
+ }
+
/**
* Getter for all contacts having current fax number linked
* <p>
import org.mxchange.addressbook.beans.user.AddressbookAdminUserWebRequestController;
import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.events.contact.helper.created.HelperCreatedContactEvent;
-import org.mxchange.jcontacts.events.contact.helper.created.ObservableHelperCreatedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
import org.mxchange.jphone.events.helper.fax.created.HelperCreatedFaxNumberEvent;
import org.mxchange.jphone.events.helper.fax.created.ObservableHelperCreatedFaxNumberEvent;
import org.mxchange.jphone.events.helper.landline.created.HelperCreatedLandLineNumberEvent;
import org.mxchange.jphone.events.helper.landline.created.ObservableHelperCreatedLandLineNumberEvent;
-import org.mxchange.jphone.events.helper.mobile.created.HelperCreatedMobileNumberEvent;
-import org.mxchange.jphone.events.helper.mobile.created.ObservableHelperCreatedMobileNumberEvent;
+import org.mxchange.jphone.events.mobile.created.CreatedMobileNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
*/
@Any
@Inject
- private Event<ObservableHelperCreatedContactEvent> contactCreatedEvent;
+ private Event<ObservableCreatedContactEvent> contactCreatedEvent;
/**
* Fax number
*/
@Any
@Inject
- private Event<ObservableHelperCreatedMobileNumberEvent> mobileNumberCreatedEvent;
+ private Event<ObservableCreatedMobileNumberEvent> mobileNumberCreatedEvent;
/**
* User instance
this.setPhoneInstances(this.getContact());
// Set all fields: user
- this.contactCreatedEvent.fire(new HelperCreatedContactEvent(this.getContact()));
+ this.contactCreatedEvent.fire(new CreatedContactEvent(this.getContact()));
}
/**
}
// Fire event
- this.mobileNumberCreatedEvent.fire(new HelperCreatedMobileNumberEvent(this.getMobileNumber()));
+ this.mobileNumberCreatedEvent.fire(new CreatedMobileNumberEvent(this.getMobileNumber()));
}
/**
import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.addressbook.beans.helper.AddressbookWebRequestHelperController;
import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent;
import org.mxchange.jphone.events.fax.removed.AdminFaxNumberRemovedFromListEvent;
import org.mxchange.jphone.events.fax.removed.AdminRemoveFaxNumberFromListEvent;
import org.mxchange.jphone.events.fax.updated.AdminFaxNumberUpdatedEvent;
import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent;
-import org.mxchange.jphone.events.helper.fax.created.ObservableHelperCreatedFaxNumberEvent;
-import org.mxchange.jphone.events.helper.landline.created.ObservableHelperCreatedLandLineNumberEvent;
-import org.mxchange.jphone.events.helper.mobile.created.ObservableHelperCreatedMobileNumberEvent;
+import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
import org.mxchange.jphone.events.landline.deleted.AdminDeletedLandLineNumberEvent;
import org.mxchange.jphone.events.landline.deleted.AdminLandLineNumberDeletedEvent;
import org.mxchange.jphone.events.landline.removed.AdminLandLineNumberRemovedFromListEvent;
import org.mxchange.jphone.events.landline.removed.AdminRemoveLandLineNumberFromListEvent;
import org.mxchange.jphone.events.landline.updated.AdminLandLineNumberUpdatedEvent;
import org.mxchange.jphone.events.landline.updated.AdminUpdatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
import org.mxchange.jphone.events.mobile.deleted.AdminDeletedMobileNumberEvent;
import org.mxchange.jphone.events.mobile.deleted.AdminMobileNumberDeletedEvent;
import org.mxchange.jphone.events.mobile.remove.AdminMobileNumberRemovedFromListEvent;
* <p>
* @param event Event being fired
*/
- public void afterHelperCreatedFaxNumberEvent (@Observes final ObservableHelperCreatedFaxNumberEvent event) {
+ public void afterCreatedFaxNumberEvent (@Observes final ObservableCreatedFaxNumberEvent event) {
// The event instance must be valid
if (null == event) {
// Throw NPE
* <p>
* @param event Event being fired
*/
- public void afterHelperCreatedLandLineNumberEvent (@Observes final ObservableHelperCreatedLandLineNumberEvent event) {
+ public void afterCreatedLandLineNumberEvent (@Observes final ObservableCreatedLandLineNumberEvent event) {
// The event instance must be valid
if (null == event) {
// Throw NPE
* <p>
* @param event Event being fired
*/
- public void afterHelperCreatedMobileNumberEvent (@Observes final ObservableHelperCreatedMobileNumberEvent event) {
+ public void afterCreatedMobileNumberEvent (@Observes final ObservableCreatedMobileNumberEvent event) {
// The event instance must be valid
if (null == event) {
// Throw NPE
import org.mxchange.jcoreee.utils.FacesUtils;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
+import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
import org.mxchange.jusercore.events.user.delete.AdminDeletedUserEvent;
import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
-import org.mxchange.jusercore.events.user.helper.created.ObservableHelperCreatedUserEvent;
import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent;
import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
import org.mxchange.jusercore.events.user.locked.AdminLockedUserEvent;
* <p>
* @param event User created event
*/
- public void afterHelperCreatedUserEvent (@Observes final ObservableHelperCreatedUserEvent event) {
+ public void afterCreatedUserEvent (@Observes final ObservableCreatedUserEvent event) {
// Is the instance valid?
if (null == event) {
// Throw NPE
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.juserlogincore.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;
import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.jusercore.events.user.helper.created.ObservableHelperCreatedContactEvent;
/**
* A user bean (controller)
* <p>
* @param event User created event
*/
- public void afterHelperCreatedUserEvent (@Observes final ObservableHelperCreatedContactEvent event) {
+ public void afterCreatedUserEvent (@Observes final ObservableCreatedUserEvent event) {
// Is the instance valid?
if (null == event) {
// Throw NPE