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 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.Locale;
22 import java.util.Objects;
23 import java.util.Properties;
24 import javax.ejb.EJBException;
25 import javax.faces.FacesException;
26 import javax.jms.Connection;
27 import javax.jms.JMSException;
28 import javax.jms.MessageProducer;
29 import javax.jms.ObjectMessage;
30 import javax.jms.Queue;
31 import javax.jms.QueueConnectionFactory;
32 import javax.jms.Session;
33 import javax.mail.Address;
34 import javax.naming.Context;
35 import javax.naming.InitialContext;
36 import javax.naming.NamingException;
37 import org.mxchange.jcontacts.contact.Contact;
38 import org.mxchange.jcoreee.database.BaseDatabaseBean;
39 import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
40 import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
41 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
42 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
43 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
44 import org.mxchange.jphone.utils.PhoneUtils;
45 import org.mxchange.jusercore.model.user.User;
46 import org.mxchange.jusercore.model.user.UserUtils;
49 * A helper class for beans that access the database.
51 * @author Roland Haeder<roland@mxchange.org>
53 public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
58 private static final long serialVersionUID = 12_895_410_275_811_963L;
63 private Connection connection;
68 private MessageProducer messageProducer;
71 * Mailer message queue
78 private Session session;
81 * Protected constructor
83 protected BaseAddressbookDatabaseBean () {
84 // Call super constructor
88 // Get initial context
89 Context context = new InitialContext();
91 // Get factory from JMS resource
92 QueueConnectionFactory connectionFactory = (QueueConnectionFactory) context.lookup("jms/jlandingpage-queue-factory"); //NOI18N
95 this.queue = (Queue) context.lookup("jms/jlandingpage-email-queue"); //NOI18N
98 this.connection = connectionFactory.createConnection();
100 // Init session instance
101 this.session = this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
103 // And message producer
104 this.messageProducer = this.session.createProducer(this.queue);
105 } catch (final NamingException | JMSException e) {
106 // Continued to throw
107 throw new FacesException(e);
112 * Updates all contacts's phone entry's created timestamps
114 * @param contact Contact instance to update
116 protected void setAllContactPhoneEntriesCreated (final Contact contact) {
118 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesCreated: contact={0} - CALLED!", contact)); //NOI18N
120 // The contact instance must be valid
121 if (null == contact) {
123 throw new NullPointerException("contact is null"); //NOI18N
126 // Get all phone instances
127 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
128 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
129 DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
132 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntriesCreated: landLineNumber={0},faxNumber={1},cellphoneNumber={2}", landLineNumber, faxNumber, cellphoneNumber)); //NOI18N
134 // Is a phone number instance set?
135 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
137 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
139 // Set updated timestamp
140 landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
143 // Is a fax number instance set?
144 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
146 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
148 // Set updated timestamp
149 faxNumber.setPhoneEntryCreated(new GregorianCalendar());
152 // Is a mobile number instance set?
153 if ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() == null)) {
155 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for cellphone number ..."); //NOI18N
157 // Set updated timestamp
158 cellphoneNumber.setPhoneEntryCreated(new GregorianCalendar());
162 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesCreated: EXIT!"); //NOI18N
166 * Returnes a detached instance from given cellphone instance
168 * @param cellphoneNumber Cellphone instance
169 * @param fetchedNumber Found cellphone number in database
171 * @return Detached instance
173 protected DialableCellphoneNumber getDetached (final DialableCellphoneNumber cellphoneNumber, final DialableCellphoneNumber fetchedNumber) {
175 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: cellphoneNumber={0},fetchedNumber={1} - CALLED!", cellphoneNumber, fetchedNumber)); //NOI18N
178 if (null == cellphoneNumber) {
180 throw new NullPointerException("cellphoneNumber is null"); //NOI18N
181 } else if (fetchedNumber.getPhoneId() == null) {
183 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
187 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
189 // Init query instance
190 DialableCellphoneNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
193 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
196 DialableCellphoneNumber detachedNumber = null;
198 // Is there a difference?
199 if (!PhoneUtils.isSameCellphoneNumber(cellphoneNumber, fetchedNumber)) {
201 detachedNumber = this.getEntityManager().merge(foundNumber);
207 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
210 return detachedNumber;
214 * Returnes a detached instance from given land-line instance
216 * @param landLineNumber Land-line instance
217 * @param fetchedNumber Found land-line number in database
219 * @return Detached instance
221 protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
223 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
226 if (null == landLineNumber) {
228 throw new NullPointerException("landLineNumber is null"); //NOI18N
229 } else if (fetchedNumber.getPhoneId() == null) {
231 throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
235 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
237 // Init query instance
238 DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
241 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
244 DialableLandLineNumber detachedNumber = null;
246 // Is there a difference?
247 if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
249 detachedNumber = this.getEntityManager().merge(foundNumber);
253 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
256 return detachedNumber;
260 * Returnes a detached instance from given fax instance
262 * @param faxNumber Fax instance
263 * @param fetchedNumber Found fax number in database
265 * @return Detached instance
267 protected DialableFaxNumber getDetached (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
269 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: faxNumber={0},fetchedNumber={1} - CALLED!", faxNumber, fetchedNumber)); //NOI18N
272 if (null == faxNumber) {
274 throw new NullPointerException("faxNumber is null"); //NOI18N
275 } else if (fetchedNumber.getPhoneId() == null) {
277 throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
281 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
283 // Init query instance
284 DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
287 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
290 DialableFaxNumber detachedNumber = null;
292 // Is there a difference?
293 if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
295 detachedNumber = this.getEntityManager().merge(foundNumber);
299 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
302 return detachedNumber;
306 * Merges given contact's data
308 * @param contact Contact instance to merge
310 * @return Detached contact instance
312 protected Contact mergeContactData (final Contact contact) {
314 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: contact={0} - CALLED!", contact)); //NOI18N
316 // The contact instance must be valid
317 if (null == contact) {
319 throw new NullPointerException("contact is null"); //NOI18N
320 } else if (contact.getContactId() == null) {
322 throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
323 } else if (contact.getContactId() < 1) {
325 throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
328 // Set updated timestamp
329 contact.setContactUpdated(new GregorianCalendar());
331 // Get contact from it and find it
332 Contact foundContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
335 assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", contact.getContactId()); //NOI18N
338 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: contact.contactId={0}", foundContact.getContactId())); //NOI18N
340 // Merge contact instance
341 Contact detachedContact = this.getEntityManager().merge(foundContact);
344 detachedContact.copyAll(contact);
347 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: detachedContact={0} - EXIT!", detachedContact)); //NOI18N
349 // Return detached contact
350 return detachedContact;
354 * Merges given (detached) contact's cellphone, land-line and fax numbers
356 * @param detachedContact Detached contact instance
358 protected void mergeContactsCellphoneLandLineFaxNumbers (final Contact detachedContact) {
360 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactsCellphoneLandLineFaxNumbers: detachedContact={0} - CALLED!", detachedContact)); //NOI18N
362 // The contact instance must be valid
363 if (null == detachedContact) {
365 throw new NullPointerException("detachedContact is null"); //NOI18N
366 } else if (detachedContact.getContactId() == null) {
368 throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
369 } else if (detachedContact.getContactId() < 1) {
371 throw new IllegalStateException(MessageFormat.format("detachedContact.contactId={0} is not valid.", detachedContact.getContactId())); //NOI18N
375 DialableCellphoneNumber cellphone = detachedContact.getContactCellphoneNumber();
376 DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
377 DialableFaxNumber fax = detachedContact.getContactFaxNumber();
379 // Is there a cellphone instance set?
380 if (cellphone instanceof DialableCellphoneNumber) {
382 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
385 DialableCellphoneNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
388 assert (foundCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
390 // Then merge it, too
391 DialableCellphoneNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
394 assert (detachedCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
397 detachedCellphone.copyAll(detachedContact.getContactCellphoneNumber());
400 detachedContact.setContactCellphoneNumber(detachedCellphone);
403 // Is there a fax instance set?
404 if (fax instanceof DialableFaxNumber) {
406 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
409 DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
412 assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
414 // Then merge it, too
415 DialableFaxNumber detachedFax = this.getEntityManager().merge(foundFax);
418 assert (detachedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", detachedFax.getPhoneId()); //NOI18N
421 detachedFax.copyAll(detachedContact.getContactFaxNumber());
424 detachedContact.setContactFaxNumber(detachedFax);
427 // Is there a fax instance set?
428 if (landLine instanceof DialableLandLineNumber) {
430 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
433 DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
436 assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
438 // Then merge it, too
439 DialableLandLineNumber detachedLandLine = this.getEntityManager().merge(foundLandLine);
442 assert (detachedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", detachedLandLine.getPhoneId()); //NOI18N
445 detachedLandLine.copyAll(detachedContact.getContactLandLineNumber());
448 detachedContact.setContactLandLineNumber(detachedLandLine);
452 this.getLoggerBeanLocal().logTrace("mergeContactsCellphoneLandLineFaxNumbers: EXIT!"); //NOI18N
456 * Sends an email with given subject line, template name to given recipient
459 * @param subjectLine Subject line
460 * @param templateName Template name
461 * @param emailAddress Recipient's email address
462 * @param user User instance
464 protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user) {
466 this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},emailAddress={3},user={4} - CALLED!", subjectLine, templateName, emailAddress, user));
469 if (null == subjectLine) {
471 throw new NullPointerException("subjectLine is null");
472 } else if (subjectLine.isEmpty()) {
474 throw new IllegalArgumentException("subjectLine is empty");
475 } else if (null == templateName) {
477 throw new NullPointerException("templateName is null");
478 } else if (templateName.isEmpty()) {
480 throw new IllegalArgumentException("templateName is empty");
481 } else if (null == emailAddress) {
483 throw new NullPointerException("emailAddress is null");
486 // Prepare mail wrapper
487 WrapableEmailDelivery emailWrapper = new EmailDeliveryWrapper();
490 Properties variables = UserUtils.getAllUserFields(user);
493 // @TODO Get locale from user + language from message bundle
494 emailWrapper.setRecipient(emailAddress);
495 emailWrapper.setLocale(Locale.GERMAN);
496 emailWrapper.setSubjectLine(subjectLine);
497 emailWrapper.setTemplateName(templateName); //NOI18N
498 emailWrapper.setTemplateVariables(variables);
501 // Send out email change
502 ObjectMessage message = this.session.createObjectMessage();
503 message.setObject(emailWrapper);
506 this.sendMessage(message, this.messageProducer);
507 } catch (final JMSException ex) {
509 throw new EJBException(ex);
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.contactCellphoneNumber={0}", other.getContactCellphoneNumber())); //NOI18N
539 // Is other cellphone not set?
540 if ((other.getContactCellphoneNumber() == null) || (PhoneUtils.isSameCellphoneNumber(contact.getContactCellphoneNumber(), other.getContactCellphoneNumber()))) {
542 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying cellphone entry ..."); //NOI18N
544 // Is the fax number set?
545 if (other.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
546 // Copy cellphone number
547 contact.setContactCellphoneNumber(this.getDetached(other.getContactCellphoneNumber(), contact.getContactCellphoneNumber()));
550 contact.setContactCellphoneNumber(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 contacts's phone entry's updated timestamps
597 * @param contact Contact instance to update
598 * @param isCellphoneUnlinked 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 isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
607 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesUpdated: contact={0},isCellphoneUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED", contact, isCellphoneUnlinked, 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 DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
626 // Flags and instances must be constistent
627 if (isCellphoneUnlinked && cellphoneNumber instanceof DialableCellphoneNumber) {
629 throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but cellphoneNumber 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 ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() instanceof Long) && (cellphoneNumber.getPhoneId() > 0)) {
659 this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for cellphone number ..."); //NOI18N
661 // Set updated timestamp
662 cellphoneNumber.setPhoneEntryUpdated(new GregorianCalendar());
666 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesUpdated: EXIT!"); //NOI18N