/**
* Returnes a detached instance from given cellphone instance
* <p>
- * @param cellphoneNumber Cellphone instance
+ * @param mobileNumber Mobile instance
* @param fetchedNumber Found cellphone number in database
* <p>
* @return Detached instance
*/
- protected DialableMobileNumber getDetached (final DialableMobileNumber cellphoneNumber, final DialableMobileNumber fetchedNumber) {
+ protected DialableMobileNumber getDetached (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: cellphoneNumber={0},fetchedNumber={1} - CALLED!", cellphoneNumber, fetchedNumber)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: cellphoneNumber={0},fetchedNumber={1} - CALLED!", mobileNumber, fetchedNumber)); //NOI18N
// Should be valid
- if (null == cellphoneNumber) {
+ if (null == mobileNumber) {
// Throw NPE
throw new NullPointerException("cellphoneNumber is null"); //NOI18N
} else if (fetchedNumber.getPhoneId() == null) {
DialableMobileNumber detachedNumber = null;
// Is there a difference?
- if (!PhoneUtils.isSameCellphoneNumber(cellphoneNumber, fetchedNumber)) {
+ if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
// Merge this entry
detachedNumber = this.getEntityManager().merge(foundNumber);
* <p>
* @param detachedContact Detached contact instance
*/
- protected void mergeContactsCellphoneLandLineFaxNumbers (final Contact detachedContact) {
+ protected void mergeContactsMobileLandLineFaxNumbers (final Contact detachedContact) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactsCellphoneLandLineFaxNumbers: detachedContact={0} - CALLED!", detachedContact)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactsMobileLandLineFaxNumbers: detachedContact={0} - CALLED!", detachedContact)); //NOI18N
// The contact instance must be valid
if (null == detachedContact) {
this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
// Then find it, too
- DialableMobileNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
+ DialableMobileNumber foundMobile = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
// Should be there
- assert (foundCellphone instanceof DialableMobileNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
+ assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
// Then merge it, too
- DialableMobileNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
+ DialableMobileNumber detachedMobile = this.getEntityManager().merge(foundMobile);
// Should be there
- assert (detachedCellphone instanceof DialableMobileNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
+ assert (detachedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", detachedMobile.getPhoneId()); //NOI18N
// Copy all
- detachedCellphone.copyAll(detachedContact.getContactMobileNumber());
+ detachedMobile.copyAll(detachedContact.getContactMobileNumber());
// Set it back
- detachedContact.setContactMobileNumber(detachedCellphone);
+ detachedContact.setContactMobileNumber(detachedMobile);
}
// Is there a fax instance set?
}
// Trace message
- this.getLoggerBeanLocal().logTrace("mergeContactsCellphoneLandLineFaxNumbers: EXIT!"); //NOI18N
+ this.getLoggerBeanLocal().logTrace("mergeContactsMobileLandLineFaxNumbers: EXIT!"); //NOI18N
}
/**
}
// Debug message
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactCellphoneNumber={0}", other.getContactMobileNumber())); //NOI18N
+ this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
// Is other cellphone not set?
- if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameCellphoneNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
+ if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
// Debug message
this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying cellphone entry ..."); //NOI18N
* Updates all contacts's phone entry's updated timestamps
* <p>
* @param contact Contact instance to update
- * @param isCellphoneUnlinked Whether a cellphone entry has been unlinked in
+ * @param isMobileUnlinked Whether a cellphone entry has been unlinked in
* contact instance
* @param isLandlineUnlinked Whether a land-line entry has been unlinked in
* contact instance
* @param isFaxUnlinked Whether a fax entry has been unlinked in contact
* instance
*/
- protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
+ protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesUpdated: contact={0},isCellphoneUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED", contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllContactPhoneEntriesUpdated: contact={0},isMobileUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED", contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
// The contact instance must be valid
if (null == contact) {
DialableMobileNumber cellphoneNumber = contact.getContactMobileNumber();
// Flags and instances must be constistent
- if (isCellphoneUnlinked && cellphoneNumber instanceof DialableMobileNumber) {
+ if (isMobileUnlinked && cellphoneNumber instanceof DialableMobileNumber) {
// Bad state
throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but cellphoneNumber is set."); //NOI18N
} else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {