}
/**
- * Copies currently set contact instances data to adminContactController
+ * Getter for contact instance
+ * <p>
+ * @return Contact instance
+ */
+ public Contact getContact () {
+ return this.contact;
+ }
+
+ /**
+ * Setter for contact instance
+ * <p>
+ * @param contact Contact instance
+ */
+ public void setContact (final Contact contact) {
+ // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
+ // System.out.println(MessageFormat.format("{0}: Setting contact={1}, previous: {2}, caller: {3}", this.getClass().getSimpleName(), contact, this.contact, caller));
+ this.contact = contact;
+ }
+
+ /**
+ * Returns a message key depending on if this contact is a user and/or a
+ * contact. If this contact is unused, a default key is returned.
+ * <p>
+ * @param contact Contact instance to check
+ * <p>
+ * @return Message key
+ */
+ public String getContactUsageMessageKey (final Contact contact) {
+ // The contact must be valid
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("contact.contactId is null"); //NOI18N
+ } else if (contact.getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
+ }
+
+ // Default key is "unused"
+ String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
+
+ // Check user contact
+ boolean isUserContact = this.userController.isContactFound(contact);
+
+ // Check user first
+ if (isUserContact) {
+ // Only user
+ messageKey = "CONTACT_IS_USER"; //NOI18N
+ }
+
+ // Return message key
+ return messageKey;
+ }
+
+ /**
+ * Getter for dialable fax number
+ * <p>
+ * @return Dialable fax number
+ */
+ public DialableFaxNumber getFaxNumber () {
+ return this.faxNumber;
+ }
+
+ /**
+ * Setter for dialable fax number
+ * <p>
+ * @param faxNumber Dialable fax number
+ */
+ public void setFaxNumber (final DialableFaxNumber faxNumber) {
+ this.faxNumber = faxNumber;
+ }
+
+ /**
+ * Getter for dialable land-line number
+ * <p>
+ * @return Dialable land-line number
+ */
+ public DialableLandLineNumber getLandLineNumber () {
+ return this.landLineNumber;
+ }
+
+ /**
+ * Setter for dialable land-line number
+ * <p>
+ * @param landLineNumber Dialable land-line number
+ */
+ public void setLandLineNumber (final DialableLandLineNumber landLineNumber) {
+ this.landLineNumber = landLineNumber;
+ }
+
+ /**
+ * Getter for dialable mobile number
+ * <p>
+ * @return Dialable mobile number
+ */
+ public DialableMobileNumber getMobileNumber () {
+ return this.mobileNumber;
+ }
+
+ /**
+ * Setter for dialable mobile number
+ * <p>
+ * @param mobileNumber Dialable mobile number
+ */
+ public void setMobileNumber (final DialableMobileNumber mobileNumber) {
+ this.mobileNumber = mobileNumber;
+ }
+
+ /**
+ * Getter for user instance
+ * <p>
+ * @return User instance
+ */
+ public User getUser () {
+ return this.user;
+ }
+
+ /**
+ * Setter for user instance
+ * <p>
+ * @param user User instance
+ */
+ public void setUser (final User user) {
+ this.user = user;
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a contact id has been
+ * successfully converted to a Contact instance.
*/
- public void copyContactToController () {
+ public void notifyControllerContactConverted () {
// String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
- // System.out.println(MessageFormat.format("{0}.copyContactToController: CALLED, caller: {2}", this.getClass().getSimpleName(), this.contact, caller));
+ // System.out.println(MessageFormat.format("{0}.notifyControllerContactConverted: CALLED, caller: {2}", this.getClass().getSimpleName(), this.contact, caller));
// Validate contact instance
if (this.getContact() == null) {
}
/**
- * Copies currently set fax number's data to admin phone controller
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableFaxNumber instance.
*/
- public void copyFaxNumberToController () {
+ public void notifyControllerFaxNumberConverted () {
// Validate fax instance
if (this.getFaxNumber() == null) {
// Throw NPE
}
/**
- * Copies currently set land-line number's data to admin phone controller
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableLandLineNumber instance.
*/
- public void copyLandLineNumberToController () {
+ public void notifyControllerLandLineNumberConverted () {
// Validate land-line instance
if (this.getLandLineNumber() == null) {
// Throw NPE
}
/**
- * Copies currently set mobile number's data to admin phone controller
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableMobileNumber instance.
*/
- public void copyMobileNumberToController () {
+ public void notifyControllerMobileNumberConverted () {
// Validate mobile instance
if (this.getMobileNumber() == null) {
// Throw NPE
}
/**
- * Copies currently set user instances data to adminUserController
+ * Notifies other controllers (backing beans) if a user id has been
+ * successfully converted to a User instance.
*/
- public void copyUserToController () {
+ public void notifyControllerUserConverted () {
// Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - CALLED!"); //NOI18N
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::notifyControllerUserConverted - CALLED!"); //NOI18N
// Validate user instance
if (this.getUser() == null) {
this.userCreatedEvent.fire(new CreatedUserEvent(this.getUser()));
}
- /**
- * Getter for contact instance
- * <p>
- * @return Contact instance
- */
- public Contact getContact () {
- return this.contact;
- }
-
- /**
- * Setter for contact instance
- * <p>
- * @param contact Contact instance
- */
- public void setContact (final Contact contact) {
- // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
- // System.out.println(MessageFormat.format("{0}: Setting contact={1}, previous: {2}, caller: {3}", this.getClass().getSimpleName(), contact, this.contact, caller));
- this.contact = contact;
- }
-
- /**
- * Returns a message key depending on if this contact is a user and/or a
- * contact. If this contact is unused, a default key is returned.
- * <p>
- * @param contact Contact instance to check
- * <p>
- * @return Message key
- */
- public String getContactUsageMessageKey (final Contact contact) {
- // The contact must be valid
- if (null == contact) {
- // Throw NPE
- throw new NullPointerException("contact is null"); //NOI18N
- } else if (contact.getContactId() == null) {
- // Throw again ...
- throw new NullPointerException("contact.contactId is null"); //NOI18N
- } else if (contact.getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
- }
-
- // Default key is "unused"
- String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
-
- // Check user contact
- boolean isUserContact = this.userController.isContactFound(contact);
-
- // Check user first
- if (isUserContact) {
- // Only user
- messageKey = "CONTACT_IS_USER"; //NOI18N
- }
-
- // Return message key
- return messageKey;
- }
-
- /**
- * Getter for dialable fax number
- * <p>
- * @return Dialable fax number
- */
- public DialableFaxNumber getFaxNumber () {
- return this.faxNumber;
- }
-
- /**
- * Setter for dialable fax number
- * <p>
- * @param faxNumber Dialable fax number
- */
- public void setFaxNumber (final DialableFaxNumber faxNumber) {
- this.faxNumber = faxNumber;
- }
-
- /**
- * Getter for dialable land-line number
- * <p>
- * @return Dialable land-line number
- */
- public DialableLandLineNumber getLandLineNumber () {
- return this.landLineNumber;
- }
-
- /**
- * Setter for dialable land-line number
- * <p>
- * @param landLineNumber Dialable land-line number
- */
- public void setLandLineNumber (final DialableLandLineNumber landLineNumber) {
- this.landLineNumber = landLineNumber;
- }
-
- /**
- * Getter for dialable mobile number
- * <p>
- * @return Dialable mobile number
- */
- public DialableMobileNumber getMobileNumber () {
- return this.mobileNumber;
- }
-
- /**
- * Setter for dialable mobile number
- * <p>
- * @param mobileNumber Dialable mobile number
- */
- public void setMobileNumber (final DialableMobileNumber mobileNumber) {
- this.mobileNumber = mobileNumber;
- }
-
- /**
- * Getter for user instance
- * <p>
- * @return User instance
- */
- public User getUser () {
- return this.user;
- }
-
- /**
- * Setter for user instance
- * <p>
- * @param user User instance
- */
- public void setUser (final User user) {
- this.user = user;
- }
-
/**
* Set's all given contact's phone instances: land-line, mobile and
* faxNumber