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.User;
36 import org.mxchange.jusercore.model.user.UserUtils;
39 * A helper class for beans that access the database.
41 * @author Roland Häder<roland@mxchange.org>
43 public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
48 private static final long serialVersionUID = 12_895_410_275_811_963L;
51 * Protected constructor
53 protected BaseAddressbookDatabaseBean () {
54 // Call super constructor
55 super("jms/addressbook-queue-factory", "jms/addressbook-email-queue"); //NOI18N
59 * Updates all contacts's phone entry's created timestamps
61 * @param contact Contact instance to update
63 protected void setAllContactPhoneEntriesCreated (final Contact contact) {
65 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
67 // The contact instance must be valid
68 if (null == contact) {
70 throw new NullPointerException("contact is null"); //NOI18N
73 // Get all phone instances
74 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
75 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
76 DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
79 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: landLineNumber={1},faxNumber={2},mobileNumber={3}", this.getClass().getSimpleName(), landLineNumber, faxNumber, mobileNumber)); //NOI18N
81 // Is a phone number instance set?
82 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
84 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
86 // Set updated timestamp
87 landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
90 // Is a fax number instance set?
91 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
93 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
95 // Set updated timestamp
96 faxNumber.setPhoneEntryCreated(new GregorianCalendar());
99 // Is a mobile number instance set?
100 if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
102 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for cellphone number ...", this.getClass().getSimpleName())); //NOI18N
104 // Set updated timestamp
105 mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
109 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: EXIT!", this.getClass().getSimpleName())); //NOI18N
113 * Returns a managed instance from given mobile number
115 * @param mobileNumber Mobile number
116 * @param fetchedNumber Found mobile number in database
118 * @return Managed instance
120 protected DialableMobileNumber getManaged (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
122 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: mobileNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), mobileNumber, fetchedNumber)); //NOI18N
125 if (null == mobileNumber) {
127 throw new NullPointerException("mobileNumber is null"); //NOI18N
128 } else if (null == fetchedNumber) {
130 throw new NullPointerException("fetchedNumber is null"); //NOI18N
131 } else if (fetchedNumber.getPhoneId() == null) {
133 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
137 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.getDetached: fetchedNumber.phoneId={1}", this.getClass().getSimpleName(), fetchedNumber.getPhoneId())); //NOI18N
140 DialableMobileNumber managedNumber = null;
142 // Is there a difference?
143 if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
145 managedNumber = this.getEntityManager().merge(fetchedNumber);
149 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
152 return managedNumber;
156 * Returns a managed instance from given land-line number
158 * @param landLineNumber Land-line number
159 * @param fetchedNumber Found land-line number in database
161 * @return Managed instance
163 protected DialableLandLineNumber getManaged (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
165 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: landLineNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), landLineNumber, fetchedNumber)); //NOI18N
168 if (null == landLineNumber) {
170 throw new NullPointerException("landLineNumber is null"); //NOI18N
171 } else if (null == fetchedNumber) {
173 throw new NullPointerException("fetchedNumber is null"); //NOI18N
174 } else if (fetchedNumber.getPhoneId() == null) {
176 throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
180 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.getDetached: fetchedNumber.phoneId={1}", this.getClass().getSimpleName(), fetchedNumber.getPhoneId())); //NOI18N
183 DialableLandLineNumber managedNumber = null;
185 // Is there a difference?
186 if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
188 managedNumber = this.getEntityManager().merge(fetchedNumber);
192 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
195 return managedNumber;
199 * Returns a managed instance from given fax number
201 * @param faxNumber Fax number
202 * @param fetchedNumber Found fax number in database
204 * @return Managed instance
206 protected DialableFaxNumber getManaged (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
208 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: faxNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), faxNumber, fetchedNumber)); //NOI18N
211 if (null == faxNumber) {
213 throw new NullPointerException("faxNumber is null"); //NOI18N
214 } else if (null == fetchedNumber) {
216 throw new NullPointerException("fetchedNumber is null"); //NOI18N
217 } else if (fetchedNumber.getPhoneId() == null) {
219 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
223 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.getDetached: fetchedNumber.phoneId={1}", this.getClass().getSimpleName(), fetchedNumber.getPhoneId())); //NOI18N
226 DialableFaxNumber managedNumber = null;
228 // Is there a difference?
229 if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
231 managedNumber = this.getEntityManager().merge(fetchedNumber);
235 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
238 return managedNumber;
242 * Merges given (detached) contact's data
244 * @param detachedContact Contact instance to merge
246 * @return Detached contact instance
248 protected Contact mergeContactData (final Contact detachedContact) {
250 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: contact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
252 // The contact instance must be valid
253 if (null == detachedContact) {
255 throw new NullPointerException("detachedContact is null"); //NOI18N
256 } else if (detachedContact.getContactId() == null) {
258 throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
259 } else if (detachedContact.getContactId() < 1) {
261 throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
264 // Get contact from it and find it
265 Contact foundContact = this.getEntityManager().getReference(detachedContact.getClass(), detachedContact.getContactId());
268 assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N
271 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: foundContact.contactId={1}", this.getClass().getSimpleName(), foundContact.getContactId())); //NOI18N
273 // Merge contact instance
274 Contact managedContact = this.getEntityManager().merge(foundContact);
276 // Is a fax number set?
277 if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) {
278 // Make fax numbers managed
279 managedContact.setContactFaxNumber(this.getManaged(detachedContact.getContactFaxNumber(), detachedContact.getContactFaxNumber()));
282 // Is a land-line number set?
283 if (detachedContact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
284 // Make land-line numbers managed
285 managedContact.setContactLandLineNumber(this.getManaged(detachedContact.getContactLandLineNumber(), detachedContact.getContactLandLineNumber()));
288 // Is a mobile number set?
289 if (detachedContact.getContactMobileNumber() instanceof DialableMobileNumber) {
290 // Make mobile numbers managed
291 managedContact.setContactMobileNumber(this.getManaged(detachedContact.getContactMobileNumber(), detachedContact.getContactMobileNumber()));
294 // Set updated timestamp
295 managedContact.setContactUpdated(new GregorianCalendar());
298 managedContact.copyAll(detachedContact);
301 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
303 // Return detached contact
304 return managedContact;
308 * Merges given (detached) contact's cellphone, land-line and fax numbers
310 * @param detachedContact Detached contact instance
312 protected void mergeContactsMobileLandLineFaxNumbers (final Contact detachedContact) {
314 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactsMobileLandLineFaxNumbers: detachedContact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
316 // The contact instance must be valid
317 if (null == detachedContact) {
319 throw new NullPointerException("detachedContact is null"); //NOI18N
320 } else if (detachedContact.getContactId() == null) {
322 throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
323 } else if (detachedContact.getContactId() < 1) {
325 throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
329 DialableMobileNumber cellphone = detachedContact.getContactMobileNumber();
330 DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
331 DialableFaxNumber fax = detachedContact.getContactFaxNumber();
333 // Is there a cellphone instance set?
334 if (cellphone instanceof DialableMobileNumber) {
336 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
339 DialableMobileNumber foundMobile = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
342 assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
345 foundMobile.copyAll(detachedContact.getContactMobileNumber());
348 detachedContact.setContactMobileNumber(foundMobile);
351 // Is there a fax instance set?
352 if (fax instanceof DialableFaxNumber) {
354 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
357 DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
360 foundFax.copyAll(detachedContact.getContactFaxNumber());
363 detachedContact.setContactFaxNumber(foundFax);
366 // Is there a fax instance set?
367 if (landLine instanceof DialableLandLineNumber) {
369 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
372 DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
375 assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
378 foundLandLine.copyAll(detachedContact.getContactLandLineNumber());
381 detachedContact.setContactLandLineNumber(foundLandLine);
385 this.getLoggerBeanLocal().logTrace("mergeContactsMobileLandLineFaxNumbers: EXIT!"); //NOI18N
389 * Sends an email with given subject line, template name to given recipient
392 * @param subjectLine Subject line
393 * @param templateName Template name
394 * @param emailAddress Recipient's email address
395 * @param user User instance
396 * @param baseUrl Base URL
398 protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl) {
400 this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},emailAddress={2},user={3},baseUrl={4} - CALLED!", subjectLine, templateName, emailAddress, user, baseUrl)); //NOI18N
403 if (null == subjectLine) {
405 throw new NullPointerException("subjectLine is null"); //NOI18N
406 } else if (subjectLine.isEmpty()) {
408 throw new IllegalArgumentException("subjectLine is empty"); //NOI18N
409 } else if (null == templateName) {
411 throw new NullPointerException("templateName is null"); //NOI18N
412 } else if (templateName.isEmpty()) {
414 throw new IllegalArgumentException("templateName is empty"); //NOI18N
415 } else if (null == emailAddress) {
417 throw new NullPointerException("emailAddress is null"); //NOI18N
420 // Prepare mail wrapper
421 WrapableEmailDelivery emailWrapper = new EmailDeliveryWrapper();
424 Properties variables = UserUtils.getAllUserFields(user);
427 variables.put("baseUrl", baseUrl); //NOI18N
430 // @TODO Language from message bundle
431 emailWrapper.setRecipient(emailAddress);
432 emailWrapper.setLocale(user.getUserLocale());
433 emailWrapper.setSubjectLine(subjectLine);
434 emailWrapper.setTemplateName(templateName);
435 emailWrapper.setTemplateVariables(variables);
438 // Send out email change
439 ObjectMessage message = this.getSession().createObjectMessage();
440 message.setObject(emailWrapper);
443 this.sendMessage(message);
444 } catch (final JMSException ex) {
446 throw new EJBException(ex);
450 this.getLoggerBeanLocal().logTrace("sendEmail: EXIT!"); //NOI18N
454 * Updates all contact's phone instances from other contact, both contacts
455 * should be the same.
457 * @param contact Contact to set instances
458 * @param other Other contact to get instances from
460 protected void setAllContactPhoneEntries (final Contact contact, final Contact other) {
462 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: contact={1},other={2} - CALLED!", this.getClass().getSimpleName(), contact, other)); //NOI18N
464 // Both must be the same and not null
465 if (null == contact) {
467 throw new NullPointerException("contact is null"); //NOI18N
468 } else if (null == other) {
470 throw new NullPointerException("other is null"); //NOI18N
471 } else if (!Objects.equals(contact, other)) {
472 // Not same instances
473 throw new IllegalArgumentException(MessageFormat.format("contact={0} and other={1} are not equal!", contact, other)); //NOI18N
477 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
479 // Is other cellphone not set?
480 if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
482 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying cellphone entry ...", this.getClass().getSimpleName())); //NOI18N
484 // Is the fax number set?
485 if (other.getContactMobileNumber() instanceof DialableMobileNumber) {
486 // Copy cellphone number
487 contact.setContactMobileNumber(this.getManaged(other.getContactMobileNumber(), contact.getContactMobileNumber()));
490 contact.setContactMobileNumber(null);
495 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
497 // Is other cellphone not set?
498 if ((other.getContactLandLineNumber() == null) || (PhoneUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
500 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying land-line entry ...", this.getClass().getSimpleName())); //NOI18N
502 // Is the land-line number set?
503 if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
504 // Copy land-line number
505 contact.setContactLandLineNumber(this.getManaged(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
508 contact.setContactLandLineNumber(null);
513 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactFaxNumber={1}", this.getClass().getSimpleName(), other.getContactFaxNumber())); //NOI18N
515 // Is other cellphone not set?
516 if ((other.getContactFaxNumber() == null) || (PhoneUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
518 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying fax entry ...", this.getClass().getSimpleName())); //NOI18N
520 // Is the fax number set?
521 if (other.getContactFaxNumber() instanceof DialableFaxNumber) {
523 contact.setContactFaxNumber(this.getManaged(other.getContactFaxNumber(), contact.getContactFaxNumber()));
526 contact.setContactFaxNumber(null);
531 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: EXIT!", this.getClass().getSimpleName())); //NOI18N
535 * Updates all contact's phone entry's updated timestamps
537 * @param contact Contact instance to update
538 * @param isMobileUnlinked Whether a cellphone entry has been unlinked in
540 * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
542 * @param isFaxUnlinked Whether a fax entry has been unlinked in contact
545 protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
547 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: contact={1},isMobileUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED", this.getClass().getSimpleName(), contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
549 // The contact instance must be valid
550 if (null == contact) {
552 throw new NullPointerException("contact is null"); //NOI18N
553 } else if (contact.getContactId() == null) {
555 throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
556 } else if (contact.getContactId() < 1) {
558 throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
561 // Get all phone instances
562 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
563 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
564 DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
566 // Flags and instances must be constistent
567 if (isMobileUnlinked && mobileNumber instanceof DialableMobileNumber) {
569 throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but mobileNumber is set."); //NOI18N
570 } else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
572 throw new IllegalStateException("isLandlineUnlinked is TRUE, but landLineNumber is set."); //NOI18N
573 } else if (isFaxUnlinked && faxNumber instanceof DialableFaxNumber) {
575 throw new IllegalStateException("isFaxUnlinked is TRUE, but faxNumber is set."); //NOI18N
578 // Is a phone number instance set?
579 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() instanceof Long) && (landLineNumber.getPhoneId() > 0)) {
581 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
583 // Set updated timestamp
584 landLineNumber.setPhoneEntryUpdated(new GregorianCalendar());
587 // Is a fax number instance set?
588 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() instanceof Long) && (faxNumber.getPhoneId() > 0)) {
590 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
592 // Set updated timestamp
593 faxNumber.setPhoneEntryUpdated(new GregorianCalendar());
596 // Is a mobile number instance set?
597 if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() instanceof Long) && (mobileNumber.getPhoneId() > 0)) {
599 this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for cellphone number ...", this.getClass().getSimpleName())); //NOI18N
601 // Set updated timestamp
602 mobileNumber.setPhoneEntryUpdated(new GregorianCalendar());
606 this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: EXIT!", this.getClass().getSimpleName())); //NOI18N