]> git.mxchange.org Git - addressbook-core.git/blob - src/org/mxchange/addressbook/database/BaseAddressbookDatabaseBean.java
fixed email address
[addressbook-core.git] / src / org / mxchange / addressbook / database / BaseAddressbookDatabaseBean.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU 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.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
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/>.
16  */
17 package org.mxchange.addressbook.database;
18
19 import java.text.MessageFormat;
20 import java.util.GregorianCalendar;
21 import java.util.Objects;
22 import org.mxchange.jcontacts.contact.Contact;
23 import org.mxchange.jcoreee.database.BaseDatabaseBean;
24 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
25 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
26 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
27 import org.mxchange.jphone.utils.PhoneUtils;
28
29 /**
30  * A helper class for beans that access the database.
31  * <p>
32  * @author Roland Haeder<roland@mxchange.org>
33  */
34 public abstract class BaseAddressbookDatabaseBean extends BaseDatabaseBean {
35
36         /**
37          * Serial number
38          */
39         private static final long serialVersionUID = 12_895_410_275_811_963L;
40
41         /**
42          * Protected constructor
43          */
44         protected BaseAddressbookDatabaseBean () {
45                 // Call super constructor
46                 super();
47         }
48
49         /**
50          * Updates all contacts's phone entry's created timestamps
51          * <p>
52          * @param contact Contact instance to update
53          */
54         protected void setAllContactPhoneEntriesCreated (final Contact contact) {
55                 // Trace message
56                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesCreated: contact={0} - CALLED!", contact)); //NOI18N
57
58                 // The contact instance must be valid
59                 if (null == contact) {
60                         // Throw NPE again
61                         throw new NullPointerException("contact is null"); //NOI18N
62                 }
63
64                 // Get all phone instances
65                 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
66                 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
67                 DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
68
69                 // Debug message
70                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntriesCreated: landLineNumber={0},faxNumber={1},cellphoneNumber={2}", landLineNumber, faxNumber, cellphoneNumber)); //NOI18N
71
72                 // Is a phone number instance set?
73                 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
74                         // Debug message
75                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
76
77                         // Set updated timestamp
78                         landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
79                 }
80
81                 // Is a fax number instance set?
82                 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
83                         // Debug message
84                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
85
86                         // Set updated timestamp
87                         faxNumber.setPhoneEntryCreated(new GregorianCalendar());
88                 }
89
90                 // Is a mobile number instance set?
91                 if ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() == null)) {
92                         // Debug message
93                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesCreated: Setting created timestamp for cellphone number ..."); //NOI18N
94
95                         // Set updated timestamp
96                         cellphoneNumber.setPhoneEntryCreated(new GregorianCalendar());
97                 }
98
99                 // Trace message
100                 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesCreated: EXIT!"); //NOI18N
101         }
102
103         /**
104          * Returnes a detached instance from given cellphone instance
105          * <p>
106          * @param cellphoneNumber Cellphone instance
107          * @param fetchedNumber Found cellphone number in database
108          * <p>
109          * @return Detached instance
110          */
111         protected DialableCellphoneNumber getDetached (final DialableCellphoneNumber cellphoneNumber, final DialableCellphoneNumber fetchedNumber) {
112                 // Trace message
113                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: cellphoneNumber={0},fetchedNumber={1} - CALLED!", cellphoneNumber, fetchedNumber));
114
115                 // Should be valid
116                 if (null == cellphoneNumber) {
117                         // Throw NPE
118                         throw new NullPointerException("cellphoneNumber is null");
119                 } else if (fetchedNumber.getPhoneId() == null) {
120                         // ..and again
121                         throw new NullPointerException("fetchedNumber.phoneId is null");
122                 }
123
124                 // Debug message
125                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId()));
126
127                 // Init query instance
128                 DialableCellphoneNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
129
130                 // Debug message
131                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber));
132
133                 // Default is null
134                 DialableCellphoneNumber detachedNumber = null;
135
136                 // Is there a difference?
137                 if (!PhoneUtils.isSameCellphoneNumber(cellphoneNumber, fetchedNumber)) {
138                         // Merge this entry
139                         detachedNumber = this.getEntityManager().merge(foundNumber);
140
141                         // Copy all
142                 }
143
144                 // Trace message
145                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber));
146
147                 // Return it
148                 return detachedNumber;
149         }
150
151         /**
152          * Returnes a detached instance from given land-line instance
153          * <p>
154          * @param landLineNumber Land-line instance
155          * @param fetchedNumber Found land-line number in database
156          * <p>
157          * @return Detached instance
158          */
159         protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
160                 // Trace message
161                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber));
162
163                 // Should be valid
164                 if (null == landLineNumber) {
165                         // Throw NPE
166                         throw new NullPointerException("landLineNumber is null");
167                 } else if (fetchedNumber.getPhoneId() == null) {
168                         // ..and again
169                         throw new NullPointerException("landLineNumber.phoneId is null");
170                 }
171
172                 // Debug message
173                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId()));
174
175                 // Init query instance
176                 DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
177
178                 // Debug message
179                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber));
180
181                 // Default is null
182                 DialableLandLineNumber detachedNumber = null;
183
184                 // Is there a difference?
185                 if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
186                         // Merge this entry
187                         detachedNumber = this.getEntityManager().merge(foundNumber);
188                 }
189
190                 // Trace message
191                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber));
192
193                 // Return it
194                 return detachedNumber;
195         }
196
197         /**
198          * Returnes a detached instance from given fax instance
199          * <p>
200          * @param faxNumber Fax instance
201          * @param fetchedNumber Found fax number in database
202          * <p>
203          * @return Detached instance
204          */
205         protected DialableFaxNumber getDetached (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
206                 // Trace message
207                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: faxNumber={0},fetchedNumber={1} - CALLED!", faxNumber, fetchedNumber));
208
209                 // Should be valid
210                 if (null == faxNumber) {
211                         // Throw NPE
212                         throw new NullPointerException("faxNumber is null");
213                 } else if (fetchedNumber.getPhoneId() == null) {
214                         // ..and again
215                         throw new NullPointerException("fetchedNumber.phoneId is null");
216                 }
217
218                 // Debug message
219                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId()));
220
221                 // Init query instance
222                 DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
223
224                 // Debug message
225                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber));
226
227                 // Default is null
228                 DialableFaxNumber detachedNumber = null;
229
230                 // Is there a difference?
231                 if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
232                         // Merge this entry
233                         detachedNumber = this.getEntityManager().merge(foundNumber);
234                 }
235
236                 // Trace message
237                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber));
238
239                 // Return it
240                 return detachedNumber;
241         }
242
243         /**
244          * Merges given contact's data
245          * <p>
246          * @param contact Contact instance to merge
247          * <p>
248          * @return Detached contact instance
249          */
250         protected Contact mergeContactData (final Contact contact) {
251                 // Trace message
252                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: contact={0} - CALLED!", contact)); //NOI18N
253
254                 // The contact instance must be valid
255                 if (null == contact) {
256                         // Throw NPE again
257                         throw new NullPointerException("contact is null"); //NOI18N
258                 } else if (contact.getContactId() == null) {
259                         // Throw NPE again
260                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
261                 } else if (contact.getContactId() < 1) {
262                         // Not valid
263                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
264                 }
265
266                 // Set updated timestamp
267                 contact.setContactUpdated(new GregorianCalendar());
268
269                 // Get contact from it and find it
270                 Contact foundContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
271
272                 // Should be found
273                 assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", contact.getContactId()); //NOI18N
274
275                 // Debug message
276                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: contact.contactId={0}", foundContact.getContactId())); //NOI18N
277
278                 // Merge contact instance
279                 Contact detachedContact = this.getEntityManager().merge(foundContact);
280
281                 // Copy all
282                 detachedContact.copyAll(contact);
283
284                 // Trace message
285                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: detachedContact={0} - EXIT!", detachedContact)); //NOI18N
286
287                 // Return detached contact
288                 return detachedContact;
289         }
290
291         /**
292          * Merges given (detached) contact's cellphone, land-line and fax numbers
293          * <p>
294          * @param detachedContact Detached contact instance
295          */
296         protected void mergeContactsCellphoneLandLineFaxNumbers (final Contact detachedContact) {
297                 // Trace message
298                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactsCellphoneLandLineFaxNumbers: detachedContact={0} - CALLED!", detachedContact)); //NOI18N
299
300                 // The contact instance must be valid
301                 if (null == detachedContact) {
302                         // Throw NPE again
303                         throw new NullPointerException("detachedContact is null"); //NOI18N
304                 } else if (detachedContact.getContactId() == null) {
305                         // Throw NPE again
306                         throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
307                 } else if (detachedContact.getContactId() < 1) {
308                         // Not valid
309                         throw new IllegalStateException(MessageFormat.format("detachedContact.contactId={0} is not valid.", detachedContact.getContactId())); //NOI18N
310                 }
311
312                 // Get all instances
313                 DialableCellphoneNumber cellphone = detachedContact.getContactCellphoneNumber();
314                 DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
315                 DialableFaxNumber fax = detachedContact.getContactFaxNumber();
316
317                 // Is there a  cellphone instance set?
318                 if (cellphone instanceof DialableCellphoneNumber) {
319                         // Debug message
320                         this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
321
322                         // Then find it, too
323                         DialableCellphoneNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
324
325                         // Should be there
326                         assert (foundCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
327
328                         // Then merge it, too
329                         DialableCellphoneNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
330
331                         // Should be there
332                         assert (detachedCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
333
334                         // Copy all
335                         detachedCellphone.copyAll(detachedContact.getContactCellphoneNumber());
336
337                         // Set it back
338                         detachedContact.setContactCellphoneNumber(detachedCellphone);
339                 }
340
341                 // Is there a  fax instance set?
342                 if (fax instanceof DialableFaxNumber) {
343                         // Debug message
344                         this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
345
346                         // Then find it, too
347                         DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
348
349                         // Should be there
350                         assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
351
352                         // Then merge it, too
353                         DialableFaxNumber detachedFax = this.getEntityManager().merge(foundFax);
354
355                         // Should be there
356                         assert (detachedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", detachedFax.getPhoneId()); //NOI18N
357
358                         // Copy all
359                         detachedFax.copyAll(detachedContact.getContactFaxNumber());
360
361                         // Set it back
362                         detachedContact.setContactFaxNumber(detachedFax);
363                 }
364
365                 // Is there a  fax instance set?
366                 if (landLine instanceof DialableLandLineNumber) {
367                         // Debug message
368                         this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
369
370                         // Then find it, too
371                         DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
372
373                         // Should be there
374                         assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
375
376                         // Then merge it, too
377                         DialableLandLineNumber detachedLandLine = this.getEntityManager().merge(foundLandLine);
378
379                         // Should be there
380                         assert (detachedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", detachedLandLine.getPhoneId()); //NOI18N
381
382                         // Copy all
383                         detachedLandLine.copyAll(detachedContact.getContactLandLineNumber());
384
385                         // Set it back
386                         detachedContact.setContactLandLineNumber(detachedLandLine);
387                 }
388
389                 // Trace message
390                 this.getLoggerBeanLocal().logTrace("mergeContactsCellphoneLandLineFaxNumbers: EXIT!"); //NOI18N
391         }
392
393         /**
394          * Updates all contact's phone instances from other contact, both contacts
395          * should be the same.
396          * <p>
397          * @param contact Contact to set instances
398          * @param other Other contact to get instances from
399          */
400         protected void setAllContactPhoneEntries (final Contact contact, final Contact other) {
401                 // Trace message
402                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntries: contact={0},other={1} - CALLED!", contact, other)); //NOI18N
403
404                 // Both must be the same and not null
405                 if (null == contact) {
406                         // Throw NPE
407                         throw new NullPointerException("contact is null"); //NOI18N
408                 } else if (null == other) {
409                         // Throw NPE
410                         throw new NullPointerException("other is null"); //NOI18N
411                 } else if (!Objects.equals(contact, other)) {
412                         // Not same instances
413                         throw new IllegalArgumentException(MessageFormat.format("contact={0} and other={1} are not equal!", contact, other)); //NOI18N
414                 }
415
416                 // Debug message
417                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactCellphoneNumber={0}", other.getContactCellphoneNumber())); //NOI18N
418
419                 // Is other cellphone not set?
420                 if ((other.getContactCellphoneNumber() == null) || (PhoneUtils.isSameCellphoneNumber(contact.getContactCellphoneNumber(), other.getContactCellphoneNumber()))) {
421                         // Debug message
422                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying cellphone entry ..."); //NOI18N
423
424                         // Is the fax number set?
425                         if (other.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
426                                 // Copy cellphone number
427                                 contact.setContactCellphoneNumber(this.getDetached(other.getContactCellphoneNumber(), contact.getContactCellphoneNumber()));
428                         } else {
429                                 // Null it
430                                 contact.setContactCellphoneNumber(null);
431                         }
432                 }
433
434                 // Debug message
435                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
436
437                 // Is other cellphone not set?
438                 if ((other.getContactLandLineNumber() == null) || (PhoneUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
439                         // Debug message
440                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying land-line entry ..."); //NOI18N
441
442                         // Is the land-line number set?
443                         if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
444                                 // Copy land-line number
445                                 contact.setContactLandLineNumber(this.getDetached(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
446                         } else {
447                                 // Null it
448                                 contact.setContactLandLineNumber(null);
449                         }
450                 }
451
452                 // Debug message
453                 this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactFaxNumber={0}", other.getContactFaxNumber())); //NOI18N
454
455                 // Is other cellphone not set?
456                 if ((other.getContactFaxNumber() == null) || (PhoneUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
457                         // Debug message
458                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying fax entry ..."); //NOI18N
459
460                         // Is the fax number set?
461                         if (other.getContactFaxNumber() instanceof DialableFaxNumber) {
462                                 // Copy fax number
463                                 contact.setContactFaxNumber(this.getDetached(other.getContactFaxNumber(), contact.getContactFaxNumber()));
464                         } else {
465                                 // Null it
466                                 contact.setContactFaxNumber(null);
467                         }
468                 }
469
470                 // Trace message
471                 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntries: EXIT!"); //NOI18N
472         }
473
474         /**
475          * Updates all contacts's phone entry's updated timestamps
476          * <p>
477          * @param contact Contact instance to update
478          * @param isCellphoneUnlinked Whether a cellphone entry has been unlinked in
479          * contact instance
480          * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
481          * contact instance
482          * @param isFaxUnlinked Whether a fax entry has been unlinked in contact
483          * instance
484          */
485         protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
486                 // Trace message
487                 this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesUpdated: contact={0},isCellphoneUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED", contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
488
489                 // The contact instance must be valid
490                 if (null == contact) {
491                         // Throw NPE again
492                         throw new NullPointerException("contact is null"); //NOI18N
493                 } else if (contact.getContactId() == null) {
494                         // Throw NPE again
495                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
496                 } else if (contact.getContactId() < 1) {
497                         // Not valid
498                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
499                 }
500
501                 // Get all phone instances
502                 DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
503                 DialableFaxNumber faxNumber = contact.getContactFaxNumber();
504                 DialableCellphoneNumber cellphoneNumber = contact.getContactCellphoneNumber();
505
506                 // Flags and instances must be constistent
507                 if (isCellphoneUnlinked && cellphoneNumber instanceof DialableCellphoneNumber) {
508                         // Bad state
509                         throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but cellphoneNumber is set."); //NOI18N
510                 } else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
511                         // Bad state
512                         throw new IllegalStateException("isLandlineUnlinked is TRUE, but landLineNumber is set."); //NOI18N
513                 } else if (isFaxUnlinked && faxNumber instanceof DialableFaxNumber) {
514                         // Bad state
515                         throw new IllegalStateException("isFaxUnlinked is TRUE, but faxNumber is set."); //NOI18N
516                 }
517
518                 // Is a phone number instance set?
519                 if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() instanceof Long) && (landLineNumber.getPhoneId() > 0)) {
520                         // Debug message
521                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ..."); //NOI18N
522
523                         // Set updated timestamp
524                         landLineNumber.setPhoneEntryUpdated(new GregorianCalendar());
525                 }
526
527                 // Is a fax number instance set?
528                 if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() instanceof Long) && (faxNumber.getPhoneId() > 0)) {
529                         // Debug message
530                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ..."); //NOI18N
531
532                         // Set updated timestamp
533                         faxNumber.setPhoneEntryUpdated(new GregorianCalendar());
534                 }
535
536                 // Is a mobile number instance set?
537                 if ((cellphoneNumber instanceof DialableCellphoneNumber) && (cellphoneNumber.getPhoneId() instanceof Long) && (cellphoneNumber.getPhoneId() > 0)) {
538                         // Debug message
539                         this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntriesUpdated: Setting updated timestamp for cellphone number ..."); //NOI18N
540
541                         // Set updated timestamp
542                         cellphoneNumber.setPhoneEntryUpdated(new GregorianCalendar());
543                 }
544
545                 // Trace message
546                 this.getLoggerBeanLocal().logTrace("setAllContactPhoneEntriesUpdated: EXIT!"); //NOI18N
547         }
548
549 }