2 * Copyright (C) 2016, 2017 Roland Häder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (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 General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.addressbook.database;
19 import java.text.MessageFormat;
20 import java.util.GregorianCalendar;
21 import java.util.Objects;
22 import java.util.Properties;
23 import javax.ejb.EJBException;
24 import javax.jms.JMSException;
25 import javax.jms.ObjectMessage;
26 import javax.mail.Address;
27 import org.mxchange.jcontacts.contact.Contact;
28 import org.mxchange.jcoreee.database.BaseDatabaseBean;
29 import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
30 import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
31 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
32 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
33 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
34 import org.mxchange.jphone.utils.PhoneUtils;
35 import org.mxchange.jusercore.model.user.LoginUser;
36 import org.mxchange.jusercore.model.user.User;
37 import org.mxchange.jusercore.model.user.UserUtils;
40 * A helper class for beans that access the database.
42 * @author Roland Häder<roland@mxchange.org>
44 public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
49 private static final long serialVersionUID = 12_895_410_275_811_963L;
52 * Protected constructor
54 protected BaseAddressbookDatabaseBean () {
55 // Call super constructor
56 super("jms/addressbook-queue-factory", "jms/addressbook-email-queue"); //NOI18N
60 * Updates all contact's phone entry's created timestamps
62 * @param contact Contact instance to update
64 protected void setAllContactPhoneEntriesCreated (final Contact contact) {
66 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesCreated: contact={0} - CALLED!", contact)); //NOI18N
68 // The contact instance must be valid
69 if (null == contact) {
71 throw new NullPointerException("contact is null"); //NOI18N
74 // Get all phone instances
75 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
76 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
77 DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
80 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntriesCreated: landLineNumber={0},faxNumber={1},mobileNumber={2}", landLineNumber, faxNumber, mobileNumber)); //NOI18N
82 // Is a phone number instance set?
83 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
85 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
87 // Set updated timestamp
88 landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
91 // Is a fax number instance set?
92 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
94 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
96 // Set updated timestamp
97 faxNumber.setPhoneEntryCreated(new GregorianCalendar());
100 // Is a mobile number instance set?
101 if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
103 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for cellphone number ..."); //NOI18N
105 // Set updated timestamp
106 mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
110 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesCreated: EXIT!"); //NOI18N
114 * Returns a detached instance from given cellphone instance
116 * @param mobileNumber Mobile instance
117 * @param fetchedNumber Found cellphone number in database
119 * @return Detached instance
121 protected DialableMobileNumber getDetached (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
123 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: mobileNumber={0},fetchedNumber={1} - CALLED!", mobileNumber, fetchedNumber)); //NOI18N
126 if (null == mobileNumber) {
128 throw new NullPointerException("mobileNumber is null"); //NOI18N
129 } else if (fetchedNumber.getPhoneId() == null) {
131 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
135 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
137 // Init query instance
138 DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
141 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
144 DialableMobileNumber detachedNumber = null;
146 // Is there a difference?
147 if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
149 detachedNumber = this.getEntityManager().merge(foundNumber);
155 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
158 return detachedNumber;
162 * Returns a detached instance from given land-line instance
164 * @param landLineNumber Land-line instance
165 * @param fetchedNumber Found land-line number in database
167 * @return Detached instance
169 protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
171 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
174 if (null == landLineNumber) {
176 throw new NullPointerException("landLineNumber is null"); //NOI18N
177 } else if (fetchedNumber.getPhoneId() == null) {
179 throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
183 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
185 // Init query instance
186 DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
189 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
192 DialableLandLineNumber detachedNumber = null;
194 // Is there a difference?
195 if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
197 detachedNumber = this.getEntityManager().merge(foundNumber);
201 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
204 return detachedNumber;
208 * Returns a detached instance from given fax instance
210 * @param faxNumber Fax instance
211 * @param fetchedNumber Found fax number in database
213 * @return Detached instance
215 protected DialableFaxNumber getDetached (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
217 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: faxNumber={0},fetchedNumber={1} - CALLED!", faxNumber, fetchedNumber)); //NOI18N
220 if (null == faxNumber) {
222 throw new NullPointerException("faxNumber is null"); //NOI18N
223 } else if (fetchedNumber.getPhoneId() == null) {
225 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
229 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
231 // Init query instance
232 DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
235 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
238 DialableFaxNumber detachedNumber = null;
240 // Is there a difference?
241 if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
243 detachedNumber = this.getEntityManager().merge(foundNumber);
247 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
250 return detachedNumber;
254 * Get back a managed instance from given user
256 * @param user Unmanaged/detached user instance
258 * @return Managed user instance
260 protected User getManagedUser (final User user) {
262 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getManaged: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
264 // user should not be null
267 throw new NullPointerException("user is null"); //NOI18N
268 } else if (user.getUserId() == null) {
270 throw new NullPointerException("user.userId is null"); //NOI18N
271 } else if (user.getUserId() < 1) {
273 throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N
274 } else if (user.getUserContact() == null) {
276 throw new NullPointerException("user.userContact is null"); //NOI18N
277 } else if (user.getUserContact().getContactId() == null) {
279 throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
280 } else if (user.getUserContact().getContactId() < 1) {
281 // Not valid id number
282 throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is not valid", user.getUserContact().getContactId())); //NOI18N#
285 // Try to find it (should be there)
286 User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
289 assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
292 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getManaged: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
299 * Merges given contact's data
301 * @param contact Contact instance to merge
303 * @return Detached contact instance
305 protected Contact mergeContactData (final Contact contact) {
307 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: contact={0} - CALLED!", contact)); //NOI18N
309 // The contact instance must be valid
310 if (null == contact) {
312 throw new NullPointerException("contact is null"); //NOI18N
313 } else if (contact.getContactId() == null) {
315 throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
316 } else if (contact.getContactId() < 1) {
318 throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
321 // Set updated timestamp
322 contact.setContactUpdated(new GregorianCalendar());
324 // Get contact from it and find it
325 Contact foundContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
328 assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", contact.getContactId()); //NOI18N
331 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: foundContact.contactId={0}", foundContact.getContactId())); //NOI18N
333 // Merge contact instance
334 Contact detachedContact = this.getEntityManager().merge(foundContact);
337 detachedContact.copyAll(contact);
340 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: detachedContact={0} - EXIT!", detachedContact)); //NOI18N
342 // Return detached contact
343 return detachedContact;
347 * Merges given (detached) contact's cellphone, land-line and fax numbers
349 * @param detachedContact Detached contact instance
351 protected void mergeContactsMobileLandLineFaxNumbers (final Contact detachedContact) {
353 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactsMobileLandLineFaxNumbers: detachedContact={0} - CALLED!", detachedContact)); //NOI18N
355 // The contact instance must be valid
356 if (null == detachedContact) {
358 throw new NullPointerException("detachedContact is null"); //NOI18N
359 } else if (detachedContact.getContactId() == null) {
361 throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
362 } else if (detachedContact.getContactId() < 1) {
364 throw new IllegalStateException(MessageFormat.format("detachedContact.contactId={0} is not valid.", detachedContact.getContactId())); //NOI18N
368 DialableMobileNumber cellphone = detachedContact.getContactMobileNumber();
369 DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
370 DialableFaxNumber fax = detachedContact.getContactFaxNumber();
372 // Is there a cellphone instance set?
373 if (cellphone instanceof DialableMobileNumber) {
375 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
378 DialableMobileNumber foundMobile = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
381 assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
383 // Then merge it, too
384 DialableMobileNumber detachedMobile = this.getEntityManager().merge(foundMobile);
387 assert (detachedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", detachedMobile.getPhoneId()); //NOI18N
390 detachedMobile.copyAll(detachedContact.getContactMobileNumber());
393 detachedContact.setContactMobileNumber(detachedMobile);
396 // Is there a fax instance set?
397 if (fax instanceof DialableFaxNumber) {
399 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
402 DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
405 assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
407 // Then merge it, too
408 DialableFaxNumber detachedFax = this.getEntityManager().merge(foundFax);
411 assert (detachedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", detachedFax.getPhoneId()); //NOI18N
414 detachedFax.copyAll(detachedContact.getContactFaxNumber());
417 detachedContact.setContactFaxNumber(detachedFax);
420 // Is there a fax instance set?
421 if (landLine instanceof DialableLandLineNumber) {
423 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
426 DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
429 assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
431 // Then merge it, too
432 DialableLandLineNumber detachedLandLine = this.getEntityManager().merge(foundLandLine);
435 assert (detachedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", detachedLandLine.getPhoneId()); //NOI18N
438 detachedLandLine.copyAll(detachedContact.getContactLandLineNumber());
441 detachedContact.setContactLandLineNumber(detachedLandLine);
445 this.getLoggerBeanLocal().logTrace("mergeContactsMobileLandLineFaxNumbers: EXIT!"); //NOI18N
449 * Sends an email with given subject line, template name to given recipient
452 * @param subjectLine Subject line
453 * @param templateName Template name
454 * @param emailAddress Recipient's email address
455 * @param user User instance
456 * @param baseUrl Base URL
458 protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl) {
460 this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},emailAddress={2},user={3},baseUrl={4} - CALLED!", subjectLine, templateName, emailAddress, user, baseUrl)); //NOI18N
463 if (null == subjectLine) {
465 throw new NullPointerException("subjectLine is null"); //NOI18N
466 } else if (subjectLine.isEmpty()) {
468 throw new IllegalArgumentException("subjectLine is empty"); //NOI18N
469 } else if (null == templateName) {
471 throw new NullPointerException("templateName is null"); //NOI18N
472 } else if (templateName.isEmpty()) {
474 throw new IllegalArgumentException("templateName is empty"); //NOI18N
475 } else if (null == emailAddress) {
477 throw new NullPointerException("emailAddress is null"); //NOI18N
480 // Prepare mail wrapper
481 WrapableEmailDelivery emailWrapper = new EmailDeliveryWrapper();
484 Properties variables = UserUtils.getAllUserFields(user);
487 variables.put("baseUrl", baseUrl); //NOI18N
490 // @TODO Language from message bundle
491 emailWrapper.setRecipient(emailAddress);
492 emailWrapper.setLocale(user.getUserLocale());
493 emailWrapper.setSubjectLine(subjectLine);
494 emailWrapper.setTemplateName(templateName);
495 emailWrapper.setTemplateVariables(variables);
498 // Send out email change
499 ObjectMessage message = this.getSession().createObjectMessage();
500 message.setObject(emailWrapper);
503 this.sendMessage(message);
504 } catch (final JMSException ex) {
506 throw new EJBException(ex);
510 this.getLoggerBeanLocal().logTrace("sendEmail: EXIT!"); //NOI18N
514 * Updates all contact's phone instances from other contact, both contacts
515 * should be the same.
517 * @param contact Contact to set instances
518 * @param other Other contact to get instances from
520 protected void setAllContactPhoneEntries (final Contact contact, final Contact other) {
522 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntries: contact={0},other={1} - CALLED!", contact, other)); //NOI18N
524 // Both must be the same and not null
525 if (null == contact) {
527 throw new NullPointerException("contact is null"); //NOI18N
528 } else if (null == other) {
530 throw new NullPointerException("other is null"); //NOI18N
531 } else if (!Objects.equals(contact, other)) {
532 // Not same instances
533 throw new IllegalArgumentException(MessageFormat.format("contact={0} and other={1} are not equal!", contact, other)); //NOI18N
537 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
539 // Is other cellphone not set?
540 if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
542 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying cellphone entry ..."); //NOI18N
544 // Is the fax number set?
545 if (other.getContactMobileNumber() instanceof DialableMobileNumber) {
546 // Copy cellphone number
547 contact.setContactMobileNumber(this.getDetached(other.getContactMobileNumber(), contact.getContactMobileNumber()));
550 contact.setContactMobileNumber(null);
555 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
557 // Is other cellphone not set?
558 if ((other.getContactLandLineNumber() == null) || (PhoneUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
560 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying land-line entry ..."); //NOI18N
562 // Is the land-line number set?
563 if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
564 // Copy land-line number
565 contact.setContactLandLineNumber(this.getDetached(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
568 contact.setContactLandLineNumber(null);
573 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactFaxNumber={0}", other.getContactFaxNumber())); //NOI18N
575 // Is other cellphone not set?
576 if ((other.getContactFaxNumber() == null) || (PhoneUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
578 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying fax entry ..."); //NOI18N
580 // Is the fax number set?
581 if (other.getContactFaxNumber() instanceof DialableFaxNumber) {
583 contact.setContactFaxNumber(this.getDetached(other.getContactFaxNumber(), contact.getContactFaxNumber()));
586 contact.setContactFaxNumber(null);
591 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntries: EXIT!"); //NOI18N
595 * Updates all contact's phone entry's updated timestamps
597 * @param contact Contact instance to update
598 * @param isMobileUnlinked Whether a cellphone entry has been unlinked in
600 * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
602 * @param isFaxUnlinked Whether a fax entry has been unlinked in contact
605 protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
607 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesUpdated: contact={0},isMobileUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED", contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
609 // The contact instance must be valid
610 if (null == contact) {
612 throw new NullPointerException("contact is null"); //NOI18N
613 } else if (contact.getContactId() == null) {
615 throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
616 } else if (contact.getContactId() < 1) {
618 throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
621 // Get all phone instances
622 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
623 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
624 DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
626 // Flags and instances must be constistent
627 if (isMobileUnlinked && mobileNumber instanceof DialableMobileNumber) {
629 throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but mobileNumber is set."); //NOI18N
630 } else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
632 throw new IllegalStateException("isLandlineUnlinked is TRUE, but landLineNumber is set."); //NOI18N
633 } else if (isFaxUnlinked && faxNumber instanceof DialableFaxNumber) {
635 throw new IllegalStateException("isFaxUnlinked is TRUE, but faxNumber is set."); //NOI18N
638 // Is a phone number instance set?
639 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() instanceof Long) && (landLineNumber.getPhoneId() > 0)) {
641 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ..."); //NOI18N
643 // Set updated timestamp
644 landLineNumber.setPhoneEntryUpdated(new GregorianCalendar());
647 // Is a fax number instance set?
648 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() instanceof Long) && (faxNumber.getPhoneId() > 0)) {
650 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ..."); //NOI18N
652 // Set updated timestamp
653 faxNumber.setPhoneEntryUpdated(new GregorianCalendar());
656 // Is a mobile number instance set?
657 if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() instanceof Long) && (mobileNumber.getPhoneId() > 0)) {
659 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for cellphone number ..."); //NOI18N
661 // Set updated timestamp
662 mobileNumber.setPhoneEntryUpdated(new GregorianCalendar());
666 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesUpdated: EXIT!"); //NOI18N