2 * Copyright (C) 2016 Roland Haeder
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.jcontacts.phone;
19 import java.text.MessageFormat;
20 import java.util.GregorianCalendar;
21 import java.util.Objects;
23 import javax.ejb.Stateless;
24 import org.mxchange.jcontacts.contact.Contact;
25 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
26 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
27 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
28 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
29 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
30 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
31 import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;
34 * A session EJB for administrative contact's phone number purposes
36 * @author Roland Haeder<rhaeder@cho-time.de>
38 @Stateless (name = "adminContactPhone", description = "An administrative bean handling contact's phone (fax, land-line and mobile) data")
39 public class PizzaAdminContactPhoneSessionBean extends BasePizzaDatabaseBean implements AdminContactsPhoneSessionBeanRemote {
44 private static final long serialVersionUID = 189_217_561_460_237_108L;
50 private ContactSessionBeanRemote contactBean;
53 public Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
55 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingFaxNumberWithContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
57 // Is the contact set?
58 if (null == contact) {
60 throw new NullPointerException("contact is null"); //NOI18N
61 } else if (contact.getContactId() == null) {
62 // ... and throw again
63 throw new NullPointerException("contact.contactId is null"); //NOI18N
64 } else if (contact.getContactId() < 1) {
66 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
67 } else if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
68 // Not set cell phone instance
69 throw new PhoneNumberAlreadyLinkedException(faxNumber);
70 } else if (null == faxNumber) {
72 throw new NullPointerException("faxNumber is null"); //NOI18N
73 } else if (faxNumber.getPhoneId() == null) {
75 throw new NullPointerException("faxNumber.phoneId is null"); //NOI18N
76 } else if (faxNumber.getPhoneId() < 1) {
78 throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid", faxNumber.getPhoneId())); //NOI18N
79 } else if (faxNumber.getPhoneCountry() == null) {
81 throw new NullPointerException("faxNumber.phoneCountry is null"); //NOI18N
82 } else if (faxNumber.getPhoneAreaCode() == null) {
84 throw new NullPointerException("faxNumber.phoneAreaCode is null"); //NOI18N
85 } else if (faxNumber.getPhoneAreaCode() < 1) {
87 throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid", faxNumber.getPhoneAreaCode())); //NOI18N
88 } else if (faxNumber.getPhoneNumber() == null) {
90 throw new NullPointerException("faxNumber.phoneNumber is null"); //NOI18N
91 } else if (faxNumber.getPhoneNumber() < 1) {
93 throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid", faxNumber.getPhoneNumber())); //NOI18N
96 // Set fax number in contact
97 contact.setContactFaxNumber(faxNumber);
100 Contact updatedContact = this.contactBean.updateContactData(contact);
103 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingFaxNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
106 return updatedContact;
110 public Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
112 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingLandLineNumberWithContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
114 // Is the contact set?
115 if (null == contact) {
117 throw new NullPointerException("contact is null"); //NOI18N
118 } else if (contact.getContactId() == null) {
119 // ... and throw again
120 throw new NullPointerException("contact.contactId is null"); //NOI18N
121 } else if (contact.getContactId() < 1) {
123 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
124 } else if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
125 // Not set cell phone instance
126 throw new PhoneNumberAlreadyLinkedException(landLineNumber);
127 } else if (null == landLineNumber) {
129 throw new NullPointerException("landLineNumber is null"); //NOI18N
130 } else if (landLineNumber.getPhoneId() == null) {
132 throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
133 } else if (landLineNumber.getPhoneId() < 1) {
135 throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", landLineNumber.getPhoneId())); //NOI18N
136 } else if (landLineNumber.getPhoneCountry() == null) {
138 throw new NullPointerException("landLineNumber.phoneCountry is null"); //NOI18N
139 } else if (landLineNumber.getPhoneAreaCode() == null) {
141 throw new NullPointerException("landLineNumber.phoneAreaCode is null"); //NOI18N
142 } else if (landLineNumber.getPhoneAreaCode() < 1) {
144 throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid", landLineNumber.getPhoneAreaCode())); //NOI18N
145 } else if (landLineNumber.getPhoneNumber() == null) {
147 throw new NullPointerException("landLineNumber.phoneNumber is null"); //NOI18N
148 } else if (landLineNumber.getPhoneNumber() < 1) {
150 throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid", landLineNumber.getPhoneNumber())); //NOI18N
153 // Set land-line number in contact
154 contact.setContactLandLineNumber(landLineNumber);
157 Contact updatedContact = this.contactBean.updateContactData(contact);
160 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingLandLineNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
163 return updatedContact;
167 public Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
169 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingMobileNumberWithContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
171 // Is the contact set?
172 if (null == contact) {
174 throw new NullPointerException("contact is null"); //NOI18N
175 } else if (contact.getContactId() == null) {
176 // ... and throw again
177 throw new NullPointerException("contact.contactId is null"); //NOI18N
178 } else if (contact.getContactId() < 1) {
180 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
181 } else if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
182 // Not set cell phone instance
183 throw new PhoneNumberAlreadyLinkedException(mobileNumber);
184 } else if (null == mobileNumber) {
186 throw new NullPointerException("mobileNumber is null"); //NOI18N
187 } else if (mobileNumber.getPhoneId() == null) {
189 throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
190 } else if (mobileNumber.getPhoneId() < 1) {
192 throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
193 } else if (mobileNumber.getMobileProvider() == null) {
195 throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
196 } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
198 throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
199 } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
201 throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
204 // Set mobile number in contact
205 contact.setContactMobileNumber(mobileNumber);
208 Contact updatedContact = this.contactBean.updateContactData(contact);
211 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingMobileNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
214 return updatedContact;
218 public Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
220 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewFaxNumberWithContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
222 // Is the contact set?
223 if (null == contact) {
225 throw new NullPointerException("contact is null"); //NOI18N
226 } else if (contact.getContactId() == null) {
227 // ... and throw again
228 throw new NullPointerException("contact.contactId is null"); //NOI18N
229 } else if (contact.getContactId() < 1) {
231 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
232 } else if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
233 // Not set cell phone instance
234 throw new PhoneNumberAlreadyLinkedException(faxNumber);
235 } else if (null == faxNumber) {
237 throw new NullPointerException("faxNumber is null"); //NOI18N
238 } else if (faxNumber.getPhoneId() instanceof Long) {
240 throw new IllegalStateException(MessageFormat.format("faxNumber.phoneId={0} is not null", faxNumber.getPhoneId())); //NOI18N
241 } else if (faxNumber.getPhoneCountry() == null) {
243 throw new NullPointerException("faxNumber.phoneCountry is null"); //NOI18N
244 } else if (faxNumber.getPhoneAreaCode() == null) {
246 throw new NullPointerException("faxNumber.phoneAreaCode is null"); //NOI18N
247 } else if (faxNumber.getPhoneAreaCode() < 1) {
249 throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid", faxNumber.getPhoneAreaCode())); //NOI18N
250 } else if (faxNumber.getPhoneNumber() == null) {
252 throw new NullPointerException("faxNumber.phoneNumber is null"); //NOI18N
253 } else if (faxNumber.getPhoneNumber() < 1) {
255 throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid", faxNumber.getPhoneNumber())); //NOI18N
258 // Set created instance
259 faxNumber.setPhoneEntryCreated(new GregorianCalendar());
261 // Set fax number in contact
262 contact.setContactFaxNumber(faxNumber);
265 Contact updatedContact = this.contactBean.updateContactData(contact);
268 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewFaxNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
271 return updatedContact;
275 public Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
277 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewLandLineNumberWithContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
279 // Is the contact set?
280 if (null == contact) {
282 throw new NullPointerException("contact is null"); //NOI18N
283 } else if (contact.getContactId() == null) {
284 // ... and throw again
285 throw new NullPointerException("contact.contactId is null"); //NOI18N
286 } else if (contact.getContactId() < 1) {
288 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
289 } else if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
290 // Not set cell phone instance
291 throw new PhoneNumberAlreadyLinkedException(landLineNumber);
292 } else if (null == landLineNumber) {
294 throw new NullPointerException("landLineNumber is null"); //NOI18N
295 } else if (landLineNumber.getPhoneId() instanceof Long) {
297 throw new IllegalStateException(MessageFormat.format("landLineNumber.phoneId={0} is not null", landLineNumber.getPhoneId())); //NOI18N
298 } else if (landLineNumber.getPhoneCountry() == null) {
300 throw new NullPointerException("landLineNumber.phoneCountry is null"); //NOI18N
301 } else if (landLineNumber.getPhoneAreaCode() == null) {
303 throw new NullPointerException("landLineNumber.phoneAreaCode is null"); //NOI18N
304 } else if (landLineNumber.getPhoneAreaCode() < 1) {
306 throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid", landLineNumber.getPhoneAreaCode())); //NOI18N
307 } else if (landLineNumber.getPhoneNumber() == null) {
309 throw new NullPointerException("landLineNumber.phoneNumber is null"); //NOI18N
310 } else if (landLineNumber.getPhoneNumber() < 1) {
312 throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid", landLineNumber.getPhoneNumber())); //NOI18N
315 // Set created instance
316 landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
318 // Set landLine number in contact
319 contact.setContactLandLineNumber(landLineNumber);
322 Contact updatedContact = this.contactBean.updateContactData(contact);
325 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewLandLineNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
328 return updatedContact;
332 public Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
334 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewMobileNumberWithContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
336 // Is the contact set?
337 if (null == contact) {
339 throw new NullPointerException("contact is null"); //NOI18N
340 } else if (contact.getContactId() == null) {
341 // ... and throw again
342 throw new NullPointerException("contact.contactId is null"); //NOI18N
343 } else if (contact.getContactId() < 1) {
345 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
346 } else if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
347 // Not set cell phone instance
348 throw new PhoneNumberAlreadyLinkedException(mobileNumber);
349 } else if (null == mobileNumber) {
351 throw new NullPointerException("mobileNumber is null"); //NOI18N
352 } else if (mobileNumber.getPhoneId() instanceof Long) {
354 throw new IllegalStateException(MessageFormat.format("mobileNumber.phoneId={0} is not null", mobileNumber.getPhoneId())); //NOI18N
355 } else if (mobileNumber.getMobileProvider() == null) {
357 throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
358 } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
360 throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
361 } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
363 throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
366 // Set created instance
367 mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
369 // Set mobile number in contact
370 contact.setContactMobileNumber(mobileNumber);
373 Contact updatedContact = this.contactBean.updateContactData(contact);
376 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewMobileNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
379 return updatedContact;
383 public Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException {
385 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkFaxDataFromContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
387 // Is the contact set?
388 if (null == contact) {
390 throw new NullPointerException("contact is null"); //NOI18N
391 } else if (contact.getContactId() == null) {
392 // ... and throw again
393 throw new NullPointerException("contact.contactId is null"); //NOI18N
394 } else if (contact.getContactId() < 1) {
396 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
397 } else if (contact.getContactFaxNumber() == null) {
398 // Not set cell phone instance
399 throw new PhoneNumberNotLinkedException(faxNumber);
400 } else if (contact.getContactFaxNumber().getPhoneId() == null) {
402 throw new NullPointerException("contact.contactFaxNumber.phoneId is null"); //NOI18N
403 } else if (contact.getContactFaxNumber().getPhoneId() < 1) {
405 throw new IllegalArgumentException(MessageFormat.format("contact.contactFaxNumber.phoneId={0} is invalid.", contact.getContactFaxNumber().getPhoneId())); //NOI18N
406 } else if (!Objects.equals(faxNumber.getPhoneId(), contact.getContactFaxNumber().getPhoneId())) {
408 throw new IllegalArgumentException(MessageFormat.format("contact.contactFaxNumber.phoneId={0} and faxNumber.phoneId={1} are not the same.", contact.getContactFaxNumber().getPhoneId(), faxNumber.getPhoneId())); //NOI18N
411 // Remove it from contact
412 contact.setContactFaxNumber(null);
415 Contact updatedContact = this.contactBean.updateContactData(contact);
418 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkFaxDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
421 return updatedContact;
425 public Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException {
427 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkLandLineDataFromContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
429 // Is the contact set?
430 if (null == contact) {
432 throw new NullPointerException("contact is null"); //NOI18N
433 } else if (contact.getContactId() == null) {
434 // ... and throw again
435 throw new NullPointerException("contact.contactId is null"); //NOI18N
436 } else if (contact.getContactId() < 1) {
438 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
439 } else if (contact.getContactLandLineNumber() == null) {
440 // Not set cell phone instance
441 throw new PhoneNumberNotLinkedException(landLineNumber);
442 } else if (contact.getContactLandLineNumber().getPhoneId() == null) {
444 throw new NullPointerException("contact.contactLandLineNumber.phoneId is null"); //NOI18N
445 } else if (contact.getContactLandLineNumber().getPhoneId() < 1) {
447 throw new IllegalArgumentException(MessageFormat.format("contact.contactLandLineNumber.phoneId={0} is invalid.", contact.getContactLandLineNumber().getPhoneId())); //NOI18N
448 } else if (!Objects.equals(landLineNumber.getPhoneId(), contact.getContactLandLineNumber().getPhoneId())) {
450 throw new IllegalArgumentException(MessageFormat.format("contact.contactLandLineNumber.phoneId={0} and landLineNumber.phoneId={1} are not the same.", contact.getContactLandLineNumber().getPhoneId(), landLineNumber.getPhoneId())); //NOI18N
453 // Remove it from contact
454 contact.setContactLandLineNumber(null);
457 Contact updatedContact = this.contactBean.updateContactData(contact);
460 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkLandLineDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
463 return updatedContact;
467 public Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException {
469 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkMobileDataFromContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
471 // Is the contact set?
472 if (null == contact) {
474 throw new NullPointerException("contact is null"); //NOI18N
475 } else if (contact.getContactId() == null) {
476 // ... and throw again
477 throw new NullPointerException("contact.contactId is null"); //NOI18N
478 } else if (contact.getContactId() < 1) {
480 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
481 } else if (contact.getContactMobileNumber() == null) {
482 // Not set cell phone instance
483 throw new PhoneNumberNotLinkedException(mobileNumber);
484 } else if (contact.getContactMobileNumber().getPhoneId() == null) {
486 throw new NullPointerException("contact.contactMobileNumber.phoneId is null"); //NOI18N
487 } else if (contact.getContactMobileNumber().getPhoneId() < 1) {
489 throw new IllegalArgumentException(MessageFormat.format("contact.contactMobileNumber.phoneId={0} is invalid.", contact.getContactMobileNumber().getPhoneId())); //NOI18N
490 } else if (!Objects.equals(mobileNumber.getPhoneId(), contact.getContactMobileNumber().getPhoneId())) {
492 throw new IllegalArgumentException(MessageFormat.format("contact.contactMobileNumber.phoneId={0} and mobileNumber.phoneId={1} are not the same.", contact.getContactMobileNumber().getPhoneId(), mobileNumber.getPhoneId())); //NOI18N
495 // Remove it from contact
496 contact.setContactMobileNumber(null);
499 Contact updatedContact = this.contactBean.updateContactData(contact);
502 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkMobileDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
505 return updatedContact;