]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
1109322a2fcdb0fa4f522a358f7e4fcfff075d2e
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / contact / JobsAdminContactWebRequestBean.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jjobs.beans.contact;
18
19 import java.text.MessageFormat;
20 import java.util.Date;
21 import java.util.Iterator;
22 import javax.annotation.PostConstruct;
23 import javax.enterprise.context.RequestScoped;
24 import javax.enterprise.event.Event;
25 import javax.enterprise.inject.Any;
26 import javax.faces.view.facelets.FaceletException;
27 import javax.inject.Inject;
28 import javax.inject.Named;
29 import javax.naming.Context;
30 import javax.naming.InitialContext;
31 import javax.naming.NamingException;
32 import org.mxchange.jcontacts.contact.Contact;
33 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
34 import org.mxchange.jcontacts.contact.UserContact;
35 import org.mxchange.jcontacts.contact.gender.Gender;
36 import org.mxchange.jcontacts.contact.utils.ContactUtils;
37 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
38 import org.mxchange.jcontacts.events.contact.add.AdminContactAddedEvent;
39 import org.mxchange.jcontacts.events.contact.update.AdminContactUpdatedEvent;
40 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
41 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
42 import org.mxchange.jcountry.data.Country;
43 import org.mxchange.jjobs.beans.BaseJobsController;
44 import org.mxchange.jphone.phonenumbers.DialableNumber;
45 import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
46 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
47 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
48 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
49 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
50 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
51 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
52 import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
53
54 /**
55  * An administrative user bean (controller)
56  * <p>
57  * @author Roland Haeder<roland@mxchange.org>
58  */
59 @Named ("adminContactController")
60 @RequestScoped
61 public class JobsAdminContactWebRequestBean extends BaseJobsController implements JobsAdminContactWebRequestController {
62
63         /**
64          * Serial number
65          */
66         private static final long serialVersionUID = 542_145_347_916L;
67
68         /**
69          * An event fired when the administrator has added a new contact
70          */
71         @Inject
72         @Any
73         private Event<AdminAddedContactEvent> addedContactEvent;
74
75         /**
76          * Admin helper instance
77          */
78         @Inject
79         private JobsWebRequestController beanHelper;
80
81         /**
82          * Birth day
83          */
84         private Date birthday;
85
86         /**
87          * Cellphone number's carrier
88          */
89         private MobileProvider cellphoneCarrier;
90
91         /**
92          * Cellphone id number
93          */
94         private Long cellphoneId;
95
96         /**
97          * Cellphone number
98          */
99         private Long cellphoneNumber;
100
101         /**
102          * City
103          */
104         private String city;
105
106         /**
107          * Optional comments
108          */
109         private String comment;
110
111         /**
112          * Remote contact bean
113          */
114         private final ContactSessionBeanRemote contactBean;
115
116         /**
117          * General contact controller
118          */
119         @Inject
120         private JobsContactWebSessionController contactController;
121
122         /**
123          * Contact id
124          */
125         private Long contactId;
126
127         /**
128          * Country instance
129          */
130         private Country country;
131
132         /**
133          * Email address
134          */
135         private String emailAddress;
136
137         /**
138          * Family name
139          */
140         private String familyName;
141
142         /**
143          * Fax number's area code
144          */
145         private Integer faxAreaCode;
146
147         /**
148          * Country instance for fax number
149          */
150         private Country faxCountry;
151
152         /**
153          * Fax id number
154          */
155         private Long faxId;
156
157         /**
158          * Fax number
159          */
160         private Long faxNumber;
161
162         /**
163          * First name
164          */
165         private String firstName;
166
167         /**
168          * Gender instance
169          */
170         private Gender gender;
171
172         /**
173          * House number
174          */
175         private Short houseNumber;
176
177         /**
178          * Whether a cellphone entry has been unlinked
179          */
180         private boolean isCellphoneUnlinked;
181
182         /**
183          * Whether a fax entry has been unlinked
184          */
185         private boolean isFaxUnlinked;
186
187         /**
188          * Whether a land-line number has been unlinked
189          */
190         private boolean isLandLineUnlinked;
191
192         /**
193          * Land-line id number
194          */
195         private Long landLineId;
196
197         /**
198          * Phone number area code
199          */
200         private Integer phoneAreaCode;
201
202         /**
203          * Country instance for phone number
204          */
205         private Country phoneCountry;
206
207         /**
208          * Phone number
209          */
210         private Long phoneNumber;
211
212         /**
213          * Street
214          */
215         private String street;
216
217         /**
218          * Title
219          */
220         private String title;
221
222         /**
223          * An event fired when the administrator has updated contact data
224          */
225         @Inject
226         @Any
227         private Event<AdminUpdatedContactEvent> updatedContactEvent;
228
229         /**
230          * ZIP code
231          */
232         private Integer zipCode;
233
234         /**
235          * Default constructor
236          */
237         public JobsAdminContactWebRequestBean () {
238                 // Try it
239                 try {
240                         // Get initial context
241                         Context context = new InitialContext();
242
243                         // Try to lookup
244                         this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jratecalc-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
245                 } catch (final NamingException e) {
246                         // Throw again
247                         throw new FaceletException(e);
248                 }
249         }
250
251         @Override
252         public String addContact () {
253                 // Are all minimum fields set?
254                 if (this.getGender() == null) {
255                         // Throw NPE
256                         throw new NullPointerException("gender is null"); //NOI18N
257                 } else if (this.getFirstName() == null) {
258                         // Throw NPE
259                         throw new NullPointerException("firstName is null"); //NOI18N
260                 } else if (this.getFirstName().isEmpty()) {
261                         // Empty string
262                         throw new IllegalStateException("firstName is empty"); //NOI18N
263                 } else if (this.getFamilyName() == null) {
264                         // Throw NPE
265                         throw new NullPointerException("familyName is null"); //NOI18N
266                 } else if (this.getFamilyName().isEmpty()) {
267                         // Empty string
268                         throw new IllegalStateException("familyName is empty"); //NOI18N
269                 }
270
271                 // Create new contact instance
272                 Contact contact = this.createContactInstance();
273
274                 // Default is not same contact
275                 if (this.isSameContactFound(contact)) {
276                         // Already registered
277                         throw new FaceletException(new ContactAlreadyAddedException(contact));
278                 }
279
280                 // Init contact
281                 Contact updatedContact;
282
283                 // Try to call EJB
284                 try {
285                         // Call EJB
286                         updatedContact = this.contactBean.addContact(contact);
287                 } catch (final ContactAlreadyAddedException ex) {
288                         // Throw again
289                         throw new FaceletException(ex);
290                 }
291
292                 // Fire event
293                 this.addedContactEvent.fire(new AdminContactAddedEvent(updatedContact));
294
295                 // Clear this bean
296                 this.clear();
297
298                 // Return outcome
299                 return "admin_list_contact"; //NOI18N
300         }
301
302         @Override
303         public void copyContactToController (final Contact contact) {
304                 // The contact instance must be valid
305                 if (null == contact) {
306                         // Throw NPE again
307                         throw new NullPointerException("contact is null"); //NOI18N
308                 } else if (contact.getContactId() == null) {
309                         // Throw NPE again
310                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
311                 } else if (contact.getContactId() < 1) {
312                         // Not valid
313                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
314                 }
315
316                 // Set all fields: contact
317                 this.setContactId(contact.getContactId());
318                 this.setTitle(contact.getContactTitle());
319                 this.setBirthday(contact.getContactBirthday());
320                 this.setCity(contact.getContactCity());
321                 this.setComment(contact.getContactComment());
322                 this.setCountry(contact.getContactCountry());
323                 this.setEmailAddress(contact.getContactEmailAddress());
324                 this.setFamilyName(contact.getContactFamilyName());
325                 this.setFirstName(contact.getContactFirstName());
326                 this.setGender(contact.getContactGender());
327                 this.setHouseNumber(contact.getContactHouseNumber());
328                 this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
329                 this.setStreet(contact.getContactStreet());
330                 this.setZipCode(contact.getContactZipCode());
331
332                 // ... cellphone data
333                 if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
334                         this.setCellphoneId(contact.getContactCellphoneNumber().getPhoneId());
335                         this.setCellphoneCarrier(contact.getContactCellphoneNumber().getCellphoneProvider());
336                         this.setCellphoneNumber(contact.getContactCellphoneNumber().getPhoneNumber());
337                 }
338
339                 // ... fax data
340                 if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
341                         this.setFaxId(contact.getContactFaxNumber().getPhoneId());
342                         this.setFaxAreaCode(contact.getContactFaxNumber().getPhoneAreaCode());
343                         this.setFaxCountry(contact.getContactFaxNumber().getPhoneCountry());
344                         this.setFaxNumber(contact.getContactFaxNumber().getPhoneNumber());
345                 }
346
347                 // .. land-line data
348                 if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
349                         this.setLandLineId(contact.getContactLandLineNumber().getPhoneId());
350                         this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
351                         this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry());
352                         this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber());
353                 }
354         }
355
356         @Override
357         public Contact createContactInstance () {
358                 // Generate phone number
359                 DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
360                 DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
361                 DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
362
363                 // Create new instance
364                 Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
365
366                 // Check if contact instance is in helper and valid
367                 if (null == contact) {
368                         // Throw NPE
369                         throw new NullPointerException("beanHelper.contact is null"); //NOI18N
370                 } else if (contact.getContactId() == null) {
371                         // Throw NPE again
372                         throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
373                 } else if (contact.getContactId() < 1) {
374                         // Invalid id
375                         throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
376                 }
377
378                 // Update all data in contact
379                 this.updateContactData(contact);
380
381                 // Call EJB for updating contact data
382                 Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
383
384                 // Fire event
385                 this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
386
387                 // Clear bean
388                 this.clear();
389
390                 // Return it
391                 return contact;
392         }
393
394         @Override
395         public String editContactData () {
396                 // Get contact instance
397                 Contact contact = this.beanHelper.getContact();
398
399                 // Check if contact instance is in helper and valid
400                 if (null == contact) {
401                         // Throw NPE
402                         throw new NullPointerException("beanHelper.contact is null"); //NOI18N
403                 } else if (contact.getContactId() == null) {
404                         // Throw NPE again
405                         throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
406                 } else if (contact.getContactId() < 1) {
407                         // Invalid id
408                         throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
409                 }
410
411                 // Update all data in contact
412                 this.updateContactData(contact);
413
414                 // Call EJB for updating contact data
415                 Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
416
417                 // Fire event
418                 this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
419
420                 // Clear bean
421                 this.clear();
422
423                 // Return to contact list (for now)
424                 return "admin_list_contact"; //NOI18N
425         }
426
427         @Override
428         public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
429                 // Is it null?
430                 if (null == cellphoneNumber) {
431                         // Return null
432                         return null;
433                 }
434
435                 // Get all data
436                 String number = String.format(
437                            "%s%d%d", //NOI18N
438                            cellphoneNumber.getCellphoneProvider().getProviderCountry().getCountryExternalDialPrefix(),
439                            cellphoneNumber.getCellphoneProvider().getProviderDialPrefix(),
440                            cellphoneNumber.getPhoneNumber()
441            );
442
443                 // Return it
444                 return number;
445         }
446
447         @Override
448         public String generatePhoneNumber (final DialableNumber phoneNumber) {
449                 // Is it null?
450                 if (null == phoneNumber) {
451                         // Return null
452                         return null;
453                 }
454
455                 // Generate it
456                 String number = String.format(
457                            "%s%d%d", //NOI18N
458                            phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(),
459                            phoneNumber.getPhoneAreaCode(),
460                            phoneNumber.getPhoneNumber()
461            );
462
463                 // Return it
464                 return number;
465         }
466
467         @Override
468         @SuppressWarnings ("ReturnOfDateField")
469         public Date getBirthday () {
470                 return this.birthday;
471         }
472
473         @Override
474         @SuppressWarnings ("AssignmentToDateFieldFromParameter")
475         public void setBirthday (final Date birthday) {
476                 this.birthday = birthday;
477         }
478
479         @Override
480         public MobileProvider getCellphoneCarrier () {
481                 return this.cellphoneCarrier;
482         }
483
484         @Override
485         public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
486                 this.cellphoneCarrier = cellphoneCarrier;
487         }
488
489         @Override
490         public Long getCellphoneId () {
491                 return this.cellphoneId;
492         }
493
494         @Override
495         public void setCellphoneId (final Long cellphoneId) {
496                 this.cellphoneId = cellphoneId;
497         }
498
499         @Override
500         public Long getCellphoneNumber () {
501                 return this.cellphoneNumber;
502         }
503
504         @Override
505         public void setCellphoneNumber (Long cellphoneNumber) {
506                 this.cellphoneNumber = cellphoneNumber;
507         }
508
509         @Override
510         public String getCity () {
511                 return this.city;
512         }
513
514         @Override
515         public void setCity (final String city) {
516                 this.city = city;
517         }
518
519         @Override
520         public String getComment () {
521                 return this.comment;
522         }
523
524         @Override
525         public void setComment (final String comment) {
526                 this.comment = comment;
527         }
528
529         @Override
530         public Long getContactId () {
531                 return this.contactId;
532         }
533
534         @Override
535         public void setContactId (final Long contactId) {
536                 this.contactId = contactId;
537         }
538
539         @Override
540         public String getControllerType () {
541                 return "admin"; //NOI18N
542         }
543
544         @Override
545         @Deprecated
546         public void setControllerType (final String controllerType) {
547                 throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
548         }
549
550         @Override
551         public Country getCountry () {
552                 return this.country;
553         }
554
555         @Override
556         public void setCountry (final Country country) {
557                 this.country = country;
558         }
559
560         @Override
561         public String getEmailAddress () {
562                 return this.emailAddress;
563         }
564
565         @Override
566         public void setEmailAddress (final String emailAddress) {
567                 this.emailAddress = emailAddress;
568         }
569
570         @Override
571         public String getFamilyName () {
572                 return this.familyName;
573         }
574
575         @Override
576         public void setFamilyName (final String familyName) {
577                 this.familyName = familyName;
578         }
579
580         @Override
581         public Integer getFaxAreaCode () {
582                 return this.faxAreaCode;
583         }
584
585         @Override
586         public void setFaxAreaCode (final Integer faxAreaCode) {
587                 this.faxAreaCode = faxAreaCode;
588         }
589
590         @Override
591         public Country getFaxCountry () {
592                 return this.faxCountry;
593         }
594
595         @Override
596         public void setFaxCountry (final Country faxCountry) {
597                 this.faxCountry = faxCountry;
598         }
599
600         @Override
601         public Long getFaxId () {
602                 return this.faxId;
603         }
604
605         @Override
606         public void setFaxId (final Long faxId) {
607                 this.faxId = faxId;
608         }
609
610         @Override
611         public Long getFaxNumber () {
612                 return this.faxNumber;
613         }
614
615         @Override
616         public void setFaxNumber (final Long faxNumber) {
617                 this.faxNumber = faxNumber;
618         }
619
620         @Override
621         public String getFirstName () {
622                 return this.firstName;
623         }
624
625         @Override
626         public void setFirstName (final String firstName) {
627                 this.firstName = firstName;
628         }
629
630         @Override
631         public Gender getGender () {
632                 return this.gender;
633         }
634
635         @Override
636         public void setGender (final Gender gender) {
637                 this.gender = gender;
638         }
639
640         @Override
641         public Short getHouseNumber () {
642                 return this.houseNumber;
643         }
644
645         @Override
646         public void setHouseNumber (final Short houseNumber) {
647                 this.houseNumber = houseNumber;
648         }
649
650         @Override
651         public Long getLandLineId () {
652                 return this.landLineId;
653         }
654
655         @Override
656         public void setLandLineId (final Long landLineId) {
657                 this.landLineId = landLineId;
658         }
659
660         @Override
661         public Integer getPhoneAreaCode () {
662                 return this.phoneAreaCode;
663         }
664
665         @Override
666         public void setPhoneAreaCode (final Integer phoneAreaCode) {
667                 this.phoneAreaCode = phoneAreaCode;
668         }
669
670         @Override
671         public Country getPhoneCountry () {
672                 return this.phoneCountry;
673         }
674
675         @Override
676         public void setPhoneCountry (final Country phoneCountry) {
677                 this.phoneCountry = phoneCountry;
678         }
679
680         @Override
681         public Long getPhoneNumber () {
682                 return this.phoneNumber;
683         }
684
685         @Override
686         public void setPhoneNumber (final Long phoneNumber) {
687                 this.phoneNumber = phoneNumber;
688         }
689
690         @Override
691         public String getStreet () {
692                 return this.street;
693         }
694
695         @Override
696         public void setStreet (final String street) {
697                 this.street = street;
698         }
699
700         @Override
701         public String getTitle () {
702                 return this.title;
703         }
704
705         @Override
706         public void setTitle (final String title) {
707                 this.title = title;
708         }
709
710         @Override
711         public Integer getZipCode () {
712                 return this.zipCode;
713         }
714
715         @Override
716         public void setZipCode (final Integer zipCode) {
717                 this.zipCode = zipCode;
718         }
719
720         /**
721          * Post-initialization of this class
722          */
723         @PostConstruct
724         public void init () {
725         }
726
727         /**
728          * Clears this bean
729          */
730         private void clear () {
731                 // Clear all data
732                 // - personal data
733                 this.setGender(Gender.UNKNOWN);
734                 this.setTitle(null);
735                 this.setFirstName(null);
736                 this.setFamilyName(null);
737                 this.setStreet(null);
738                 this.setHouseNumber(null);
739                 this.setHouseNumberExtension(null);
740                 this.setZipCode(null);
741                 this.setCity(null);
742                 this.setCountry(null);
743
744                 // - contact data
745                 this.setEmailAddress(null);
746                 this.setPhoneCountry(null);
747                 this.setPhoneAreaCode(null);
748                 this.setPhoneNumber(null);
749                 this.setCellphoneCarrier(null);
750                 this.setCellphoneNumber(null);
751                 this.setFaxCountry(null);
752                 this.setFaxAreaCode(null);
753                 this.setFaxNumber(null);
754
755                 // - other data
756                 this.setBirthday(null);
757                 this.setComment(null);
758         }
759
760         /**
761          * Checks whether the given contact is found
762          * <p>
763          * @param contact Contact inastance
764          *
765          * @return Wether contact has been found
766          */
767         private boolean isSameContactFound (final Contact contact) {
768                 // Default is not found
769                 boolean IsFound = false;
770
771                 // Get iterator
772                 Iterator<Contact> iterator = this.contactController.allContacts().iterator();
773
774                 // Loop through all
775                 while (iterator.hasNext()) {
776                         // Get next contact
777                         Contact next = iterator.next();
778
779                         // Is the same?
780                         if (ContactUtils.isSameContact(contact, next)) {
781                                 // Yes, then abort loop
782                                 IsFound = false;
783                                 break;
784                         }
785                 }
786
787                 // Return status
788                 return IsFound;
789         }
790
791         /**
792          * Updates all data in contact instance.
793          * <p>
794          * @param contact Contact instance
795          */
796         private void updateContactData (final Contact contact) {
797                 // Contact instance should be valid
798                 if (null == contact) {
799                         // Throw NPE
800                         throw new NullPointerException("contact is null"); //NOI18N
801                 } else if (contact.getContactId() == null) {
802                         // Throw NPE again
803                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
804                 } else if (contact.getContactId() < 1) {
805                         // Invalid id
806                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
807                 }
808
809                 // Update all fields
810                 contact.setContactGender(this.getGender());
811                 contact.setContactTitle(this.getTitle());
812                 contact.setContactFirstName(this.getFirstName());
813                 contact.setContactFamilyName(this.getFamilyName());
814                 contact.setContactStreet(this.getStreet());
815                 contact.setContactHouseNumber(this.getHouseNumber());
816                 contact.setContactZipCode(this.getZipCode());
817                 contact.setContactCity(this.getCity());
818                 contact.setContactCountry(this.getCountry());
819
820                 // Update contact's cellphone number
821                 this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
822
823                 // Update contact's land-line number
824                 this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
825
826                 // Update contact's fax number
827                 this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
828         }
829
830 }