2 * Copyright (C) 2016 - 2020 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jjobs.beans.contact;
19 import java.text.MessageFormat;
20 import java.util.Date;
21 import java.util.Objects;
23 import javax.enterprise.context.RequestScoped;
24 import javax.enterprise.event.Observes;
25 import javax.faces.view.facelets.FaceletException;
26 import javax.inject.Inject;
27 import javax.inject.Named;
28 import org.mxchange.jcontacts.model.contact.Contact;
29 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
30 import org.mxchange.jcontacts.model.contact.Contacts;
31 import org.mxchange.jcontacts.model.contact.UserContact;
32 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
33 import org.mxchange.jcountry.model.data.Country;
34 import org.mxchange.jjobs.beans.BaseJobsBean;
35 import org.mxchange.jjobs.beans.contact.list.JobsContactListWebViewController;
36 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
37 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
38 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
39 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
40 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
41 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
42 import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
43 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
44 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
45 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
46 import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
47 import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
50 * A general contact controller (bean)
52 * @author Roland Häder<roland@mxchange.org>
54 @Named ("contactController")
56 public class JobsContactWebRequestBean extends BaseJobsBean implements JobsContactWebRequestController {
61 private static final long serialVersionUID = 542_145_347_916L;
64 * Academic academicTitle
66 private String academicTitle;
71 private Date birthday;
81 private String comment;
84 * EJB for general contact purposes
86 @EJB (lookup = "java:global/jjobs-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
87 private ContactSessionBeanRemote contactBean;
90 * An instance of a contact-list backing bean
92 private JobsContactListWebViewController contactListController;
97 private Country country;
102 private String emailAddress;
105 * Email address repeated
107 private String emailAddressRepeat;
112 private String familyName;
115 * Fax number's area code
117 private Integer faxAreaCode;
120 * Country instance for fax number
122 private Country faxCountry;
127 private Long faxNumber;
132 private String firstName;
137 private Short houseNumber;
140 * House number extension
142 private String houseNumberExtension;
145 * Whether a fax entry has been unlinked
147 private boolean isFaxUnlinked;
150 * Whether a land-line number has been unlinked
152 private boolean isLandLineUnlinked;
155 * Whether a mobile entry has been unlinked
157 private boolean isMobileUnlinked;
160 * Phone number area code
162 private Integer landLineAreaCode;
165 * Country instance for phone number
167 private Country landLineCountry;
172 private Long landLineNumber;
177 private Long mobileNumber;
180 * Mobile number's carrier
182 private MobileProvider mobileProvider;
185 * Personal academicTitle
187 private PersonalTitle personalTitle;
192 private String street;
195 * Login bean (controller)
198 private JobsUserLoginWebSessionController userLoginController;
203 private Integer zipCode;
206 * Default constructor
208 public JobsContactWebRequestBean () {
209 // Call super constructor
214 * Event observer for newly added users by administrator
216 * @param event Event being fired
218 public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
219 // event should not be null
222 throw new NullPointerException("event is null"); //NOI18N
223 } else if (event.getAddedUser() == null) {
225 throw new NullPointerException("event.addedUser is null"); //NOI18N
226 } else if (event.getAddedUser().getUserId() == null) {
228 throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
229 } else if (event.getAddedUser().getUserId() < 1) {
231 throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
239 * Observes events being fired when an administrator has linked a new user
240 * with existing contact data.
242 * @param event Event being fired
244 public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
245 // event should not be null
248 throw new NullPointerException("event is null"); //NOI18N
249 } else if (event.getLinkedUser() == null) {
251 throw new NullPointerException("event.linkedUser is null"); //NOI18N
252 } else if (event.getLinkedUser().getUserContact() == null) {
254 throw new NullPointerException("event.linkedUser.userContact is null"); //NOI18N
255 } else if (event.getLinkedUser().getUserContact().getContactId() == null) {
257 throw new NullPointerException("event.linkedUser.userContact.contactId is null"); //NOI18N
258 } else if (event.getLinkedUser().getUserContact().getContactId() < 1) {
260 throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getLinkedUser(), event.getLinkedUser().getUserContact().getContactId())); //NOI18N
268 * Event observer for logged-in user
270 * @param event Event instance
272 public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
273 // event should not be null
276 throw new NullPointerException("event is null"); //NOI18N
277 } else if (event.getLoggedInUser() == null) {
279 throw new NullPointerException("event.loggedInUser is null"); //NOI18N
280 } else if (event.getLoggedInUser().getUserId() == null) {
282 throw new NullPointerException("event.loggedInUser.userId is null"); //NOI18N
283 } else if (event.getLoggedInUser().getUserId() < 1) {
285 throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
288 // Copy all data to this bean
289 this.copyContact(event.getLoggedInUser().getUserContact());
293 public void clearEmailAddresses () {
295 this.setEmailAddress(null);
296 this.setEmailAddressRepeat(null);
300 public Contact createContactInstance () {
301 // Is all required data set?
302 if (!this.isRequiredPersonalDataSet()) {
303 // No, then abort here
304 throw new FaceletException(new IllegalArgumentException("Not all personal data is set, but createContactInstance() is called.")); //NOI18N
307 // Required personal data must be set
308 assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
310 // Generate phone number
311 final DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
312 final DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
313 final DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
315 // Create new contact
316 Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName());
317 contact.setContactStreet(this.getStreet());
318 contact.setContactHouseNumber(this.getHouseNumber());
319 contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
320 contact.setContactZipCode(this.getZipCode());
321 contact.setContactCity(this.getCity());
322 contact.setContactCountry(this.getCountry());
323 contact.setContactEmailAddress(this.getEmailAddress());
324 contact.setContactBirthday(this.getBirthday());
325 contact.setContactComment(this.getComment());
327 // Don't set null or wrong references
328 if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
329 // Now the number must be given
330 if (landLine.getPhoneAreaCode() == null) {
332 throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
333 } else if (landLine.getPhoneAreaCode() < 1) {
335 throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
336 } else if (landLine.getPhoneNumber() == null) {
338 throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
339 } else if (landLine.getPhoneNumber() < 1) {
341 throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
345 contact.setContactLandLineNumber(landLine);
348 // Don't set null or wrong references
349 if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
350 // Now the number must be given
351 if (fax.getPhoneAreaCode() == null) {
353 throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
354 } else if (fax.getPhoneAreaCode() < 1) {
356 throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
357 } else if (fax.getPhoneNumber() == null) {
359 throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
360 } else if (fax.getPhoneNumber() < 1) {
362 throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
366 contact.setContactFaxNumber(fax);
369 // Is the provider set?
370 if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
371 // Is the number set?
372 if (mobile.getPhoneNumber() == null) {
374 throw new NullPointerException("mobile.phoneNumber is null"); //NOI18N
375 } else if (mobile.getPhoneNumber() < 1) {
377 throw new IllegalArgumentException("mobile.phoneNumber is zero or below."); //NOI18N
381 contact.setContactMobileNumber(mobile);
389 public String doChangePersonalContactData () {
390 // This method shall only be called if the user is logged-in
391 if (!this.userLoginController.isUserLoggedIn()) {
393 throw new IllegalStateException("User is not logged-in"); //NOI18N
394 } else if (!this.isRequiredChangePersonalDataSet()) {
395 // Not all required fields are set
396 throw new FaceletException("Not all required fields are set."); //NOI18N
397 } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
398 // Password not matching
399 this.showFacesMessage("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); //NOI18N
403 // Get contact instance
404 Contact contact = this.userLoginController.getLoggedInUser().getUserContact();
406 // It should be there, so run some tests on it
407 assert (contact instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N
408 assert (contact.getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N
409 assert (contact.getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N
412 contact.setContactPersonalTitle(this.getPersonalTitle());
413 contact.setContactFirstName(this.getFirstName());
414 contact.setContactFamilyName(this.getFamilyName());
415 contact.setContactStreet(this.getStreet());
416 contact.setContactHouseNumber(this.getHouseNumber());
417 contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
418 contact.setContactZipCode(this.getZipCode());
419 contact.setContactCity(this.getCity());
420 contact.setContactCountry(this.getCountry());
422 // Update contact's mobile number
423 this.isMobileUnlinked = Contacts.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
425 // Update contact's land-line number
426 this.isLandLineUnlinked = Contacts.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
428 // Update contact's fax number
429 this.isFaxUnlinked = Contacts.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
431 // Send it to the EJB
432 this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
435 return "contact_data_saved"; //NOI18N
439 * Getter for academic title
441 * @return Academic title
443 public String getAcademicTitle () {
444 return this.academicTitle;
448 * Setter for academic title
450 * @param academicTitle Academic title
452 public void setAcademicTitle (final String academicTitle) {
453 this.academicTitle = academicTitle;
457 * Getter for birth day
461 @SuppressWarnings ("ReturnOfDateField")
462 public Date getBirthday () {
463 return this.birthday;
467 * Setter for birth day
469 * @param birthday Birth day
471 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
472 public void setBirthday (final Date birthday) {
473 this.birthday = birthday;
477 * Getter for city name
481 public String getCity () {
486 * Setter for city name
488 * @param city City name
490 public void setCity (final String city) {
495 * Getter for comments
499 public String getComment () {
506 * @param comment Comments
508 public void setComment (final String comment) {
509 this.comment = comment;
513 public String getControllerType () {
514 return "general"; //NOI18N
519 public void setControllerType (final String controllerType) {
520 throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
524 * Getter for country instance
526 * @return Country instance
528 public Country getCountry () {
533 * Setter for country instance
535 * @param country Country instance
537 public void setCountry (final Country country) {
538 this.country = country;
542 public String getEmailAddress () {
543 return this.emailAddress;
547 * Setter for email address
549 * @param emailAddress Email address
551 public void setEmailAddress (final String emailAddress) {
552 this.emailAddress = emailAddress;
556 * Getter for email address, repeated
558 * @return the emailAddress, repeated
560 public String getEmailAddressRepeat () {
561 return this.emailAddressRepeat;
565 * Setter for email address repeated
567 * @param emailAddressRepeat the emailAddress to set
569 public void setEmailAddressRepeat (final String emailAddressRepeat) {
570 this.emailAddressRepeat = emailAddressRepeat;
576 * @return the familyName
578 public String getFamilyName () {
579 return this.familyName;
585 * @param familyName the familyName to set
587 public void setFamilyName (final String familyName) {
588 this.familyName = familyName;
592 * Getter for fax number's area code
594 * @return Fax number's area code
596 public Integer getFaxAreaCode () {
597 return this.faxAreaCode;
601 * Setter for fax number's area code
603 * @param faxAreaCode Fax number's area code
605 public void setFaxAreaCode (final Integer faxAreaCode) {
606 this.faxAreaCode = faxAreaCode;
610 * Getter for fax's country instance
612 * @return Fax' country instance
614 public Country getFaxCountry () {
615 return this.faxCountry;
619 * Setter for fax's country instance
621 * @param faxCountry Fax' country instance
623 public void setFaxCountry (final Country faxCountry) {
624 this.faxCountry = faxCountry;
628 * Getter for fax number
632 public Long getFaxNumber () {
633 return this.faxNumber;
637 * Setter for fax number
639 * @param faxNumber Fax number
641 public void setFaxNumber (final Long faxNumber) {
642 this.faxNumber = faxNumber;
648 * @return the first name
650 public String getFirstName () {
651 return this.firstName;
657 * @param firstName the first name to set
659 public void setFirstName (final String firstName) {
660 this.firstName = firstName;
666 * @return the houseNumber
668 public Short getHouseNumber () {
669 return this.houseNumber;
675 * @param houseNumber the houseNumber to set
677 public void setHouseNumber (final Short houseNumber) {
678 this.houseNumber = houseNumber;
682 * Getter for house number extension, example: 123a 'a' is then the
683 * extension and 123 is the house number.
685 * @return House number extension
687 public String getHouseNumberExtension () {
688 return this.houseNumberExtension;
692 * Setter for house number extension
694 * @param houseNumberExtension House number extension
696 public void setHouseNumberExtension (final String houseNumberExtension) {
697 this.houseNumberExtension = houseNumberExtension;
701 * Getter for land-line number's area code
703 * @return Land-line number's area code
705 public Integer getLandLineAreaCode () {
706 return this.landLineAreaCode;
710 * Setter for land-line number's area code
712 * @param landLineAreaCode Land-line number's area code
714 public void setLandLineAreaCode (final Integer landLineAreaCode) {
715 this.landLineAreaCode = landLineAreaCode;
719 * Getter for land-line number's country instance
721 * @return Land-line number's country instance
723 public Country getLandLineCountry () {
724 return this.landLineCountry;
728 * Setter for land-line number's country instance
730 * @param landLineCountry Land-line number's country instance
732 public void setLandLineCountry (final Country landLineCountry) {
733 this.landLineCountry = landLineCountry;
737 * Getter for land-line number
739 * @return Land-line number
741 public Long getLandLineNumber () {
742 return this.landLineNumber;
746 * Setter for land-line number
748 * @param landLineNumber Land-line number
750 public void setLandLineNumber (final Long landLineNumber) {
751 this.landLineNumber = landLineNumber;
755 * Getter for mobile number
757 * @return Mobile number
759 public Long getMobileNumber () {
760 return this.mobileNumber;
764 * Setter for mobile number
766 * @param mobileNumber Mobile number
768 public void setMobileNumber (final Long mobileNumber) {
769 this.mobileNumber = mobileNumber;
773 * Getter for mobile number's carrier
775 * @return Mobile number's carrier
777 public MobileProvider getMobileProvider () {
778 return this.mobileProvider;
782 * Setter for mobile number's provider
784 * @param mobileProvider Mobile number's provider
786 public void setMobileProvider (final MobileProvider mobileProvider) {
787 this.mobileProvider = mobileProvider;
791 * Getter for personal title
793 * @return Personal title
795 public PersonalTitle getPersonalTitle () {
796 return this.personalTitle;
800 * Setter for personal title
802 * @param personalTitle Personal title
804 public void setPersonalTitle (final PersonalTitle personalTitle) {
805 this.personalTitle = personalTitle;
813 public String getStreet () {
820 * @param street Street
822 public void setStreet (final String street) {
823 this.street = street;
827 * Getter for ZIP code
831 public Integer getZipCode () {
836 * Setter for ZIP code
838 * @param zipCode ZIP code
840 public void setZipCode (final Integer zipCode) {
841 this.zipCode = zipCode;
845 public boolean isEmailAddressRegistered (final Contact contact) {
847 if (null == contact) {
849 throw new NullPointerException("contact is null"); //NOI18N
850 } else if (contact.getContactEmailAddress() == null) {
852 throw new NullPointerException("contact.contactEmailAddress is null"); //NOI18N
853 } else if (contact.getContactEmailAddress().isEmpty()) {
855 throw new IllegalArgumentException("contact.contactEmailAddress is empty."); //NOI18N
858 // Default is not registered
859 boolean isRegistered = false;
862 for (final Contact currentContact : this.contactListController.getAllContacts()) {
863 // Is same contact found?
864 if (currentContact.getContactEmailAddress().equals(contact.getContactEmailAddress())) {
865 // Found same email address
868 // Skipp further iterations
878 public boolean isEmailAddressRegistered (final String emailAddress) {
879 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
883 public boolean isRequiredChangePersonalDataSet () {
884 return ((this.getPersonalTitle() != null) &&
885 (this.getFirstName() != null) &&
886 (this.getFamilyName() != null) &&
887 (this.getStreet() != null) &&
888 (this.getHouseNumber() != null) &&
889 (this.getZipCode() != null) &&
890 (this.getCity() != null));
894 public boolean isRequiredPersonalDataSet () {
895 return ((this.getPersonalTitle() != null) &&
896 (this.getFirstName() != null) &&
897 (this.getFamilyName() != null) &&
898 (this.getStreet() != null) &&
899 (this.getHouseNumber() != null) &&
900 (this.getZipCode() != null) &&
901 (this.getCity() != null) &&
902 (this.getEmailAddress() != null) &&
903 (this.getEmailAddressRepeat() != null));
907 public boolean isSameEmailAddressEntered () {
908 return (Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat()));
912 public void updateContactDataFromController (final Contact contact) {
913 // Is the instance valid?
914 if (null == contact) {
916 throw new NullPointerException("contact is null"); //NOI18N
917 } else if (contact.getContactId() == null) {
919 throw new NullPointerException("contact.contactId is null"); //NOI18N
920 } else if (contact.getContactId() < 1) {
921 // Not valid id number
922 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
926 this.copyContact(contact);
932 private void clear () {
935 this.setPersonalTitle(null);
936 this.setAcademicTitle(null);
937 this.setFirstName(null);
938 this.setFamilyName(null);
939 this.setStreet(null);
940 this.setHouseNumber(null);
941 this.setHouseNumberExtension(null);
942 this.setZipCode(null);
944 this.setCountry(null);
947 this.clearEmailAddresses();
948 this.setLandLineAreaCode(null);
949 this.setLandLineCountry(null);
950 this.setLandLineNumber(null);
951 this.setMobileProvider(null);
952 this.setMobileNumber(null);
953 this.setFaxAreaCode(null);
954 this.setFaxCountry(null);
955 this.setFaxNumber(null);
958 this.setBirthday(null);
959 this.setComment(null);
963 * Copies given contact into the controller
965 * @param contact Contact instance
967 private void copyContact (final Contact contact) {
970 this.setPersonalTitle(contact.getContactPersonalTitle());
971 this.setAcademicTitle(contact.getContactTitle());
972 this.setFirstName(contact.getContactFirstName());
973 this.setFamilyName(contact.getContactFamilyName());
974 this.setStreet(contact.getContactStreet());
975 this.setHouseNumber(contact.getContactHouseNumber());
976 this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
977 this.setZipCode(contact.getContactZipCode());
978 this.setCity(contact.getContactCity());
979 this.setCountry(contact.getContactCountry());
980 this.setEmailAddress(contact.getContactEmailAddress());
981 this.setBirthday(contact.getContactBirthday());
982 this.setComment(contact.getContactComment());
984 // Get mobile, phone and fax instance
985 DialableMobileNumber mobile = contact.getContactMobileNumber();
986 DialableFaxNumber fax = contact.getContactFaxNumber();
987 DialableLandLineNumber phone = contact.getContactLandLineNumber();
990 if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
991 this.setLandLineCountry(phone.getPhoneCountry());
992 this.setLandLineAreaCode(phone.getPhoneAreaCode());
993 this.setLandLineNumber(phone.getPhoneNumber());
996 if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
997 this.setMobileProvider(mobile.getMobileProvider());
998 this.setMobileNumber(mobile.getPhoneNumber());
1001 if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
1002 this.setFaxCountry(fax.getPhoneCountry());
1003 this.setFaxAreaCode(fax.getPhoneAreaCode());
1004 this.setFaxNumber(fax.getPhoneNumber());