]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Tue, 25 Apr 2017 11:59:38 +0000 (13:59 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 25 Apr 2017 12:03:12 +0000 (14:03 +0200)
- renamed cellphone -> mobile
- renamed carrier -> provider
- renamed phone* -> landLine*
- all more common over all (other) projects

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java

index 91a8c59f7639db033b1b67c70338d74aab9acd62..6495cc19f7d9b48365bf4a4d5d2a4b7abf7a2175 100644 (file)
@@ -182,44 +182,44 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private boolean isLandLineUnlinked;
 
        /**
-        * Whether a mobile entry has been unlinked
+        * Whether a cellphone entry has been unlinked
         */
-       private boolean isMobileUnlinked;
+       private boolean isMobileNumberUnlinked;
 
        /**
-        * Land-line id number
+        * Phone number area code
         */
-       private Long landLineId;
+       private Integer landLineAreaCode;
 
        /**
-        * Mobile number's carrier
+        * Country instance for phone number
         */
-       private MobileProvider mobileCarrier;
+       private Country landLineCountry;
 
        /**
-        * Mobile id number
+        * Land-line id number
         */
-       private Long mobileId;
+       private Long landLineId;
 
        /**
-        * Mobile number
+        * Phone number
         */
-       private Long mobileNumber;
+       private Long landLineNumber;
 
        /**
-        * Phone number area code
+        * Mobile id number
         */
-       private Integer phoneAreaCode;
+       private Long mobileId;
 
        /**
-        * Country instance for phone number
+        * Mobile number
         */
-       private Country phoneCountry;
+       private Long mobileNumber;
 
        /**
-        * Phone number
+        * Mobile number's provider
         */
-       private Long phoneNumber;
+       private MobileProvider mobileProvider;
 
        /**
         * Street
@@ -304,6 +304,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
 
        @Override
        public void copyContactToController (final Contact contact) {
+               // Log message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::copyContactToController(): contact={0} - CALLED!", contact)); //NOI18N
+
                // The contact instance must be valid
                if (null == contact) {
                        // Throw NPE again
@@ -332,63 +335,134 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.setStreet(contact.getContactStreet());
                this.setZipCode(contact.getContactZipCode());
 
-               // ... mobile data
+               // Is the cell phone set?
                if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
+                       // ... cellphone data
                        this.setMobileId(contact.getContactMobileNumber().getPhoneId());
-                       this.setMobileCarrier(contact.getContactMobileNumber().getMobileProvider());
+                       this.setMobileProvider(contact.getContactMobileNumber().getMobileProvider());
                        this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
                }
 
-               // ... fax data
+               // Is the fax set?
                if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
+                       // ... fax data
                        this.setFaxId(contact.getContactFaxNumber().getPhoneId());
                        this.setFaxAreaCode(contact.getContactFaxNumber().getPhoneAreaCode());
                        this.setFaxCountry(contact.getContactFaxNumber().getPhoneCountry());
                        this.setFaxNumber(contact.getContactFaxNumber().getPhoneNumber());
                }
 
-               // .. land-line data
+               // Is the land-line number set?
                if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+                       // .. land-line data
                        this.setLandLineId(contact.getContactLandLineNumber().getPhoneId());
-                       this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
-                       this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry());
-                       this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber());
+                       this.setLandLineAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
+                       this.setLandLineCountry(contact.getContactLandLineNumber().getPhoneCountry());
+                       this.setLandLineNumber(contact.getContactLandLineNumber().getPhoneNumber());
                }
+
+               // Log message
+               //* NOISY-DEBUG: */ System.out.println("AdminContactController::copyContactToController(): EXIT!"); //NOI18N
        }
 
        @Override
        public Contact createContactInstance () {
+               // Are all minimum fields set?
+               if (this.getGender() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("gender is null"); //NOI18N
+               } else if (this.getFirstName() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("firstName is null"); //NOI18N
+               } else if (this.getFirstName().isEmpty()) {
+                       // Empty string
+                       throw new IllegalStateException("firstName is empty"); //NOI18N
+               } else if (this.getFamilyName() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("familyName is null"); //NOI18N
+               } else if (this.getFamilyName().isEmpty()) {
+                       // Empty string
+                       throw new IllegalStateException("familyName is empty"); //NOI18N
+               }
+
                // Generate phone number
-               DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
+               DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new instance
                Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
 
-               // Check if contact instance is in helper and valid
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("beanHelper.contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Invalid id
-                       throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+               // Add all others
+               contact.setContactBirthday(this.getBirthday());
+               contact.setContactStreet(this.getStreet());
+               contact.setContactHouseNumber(this.getHouseNumber());
+               contact.setContactZipCode(this.getZipCode());
+               contact.setContactCity(this.getCity());
+               contact.setContactCountry(this.getCountry());
+               contact.setContactEmailAddress(this.getEmailAddress());
+               contact.setContactBirthday(this.getBirthday());
+               contact.setContactComment(this.getComment());
+
+               // Set ownContact
+               contact.setContactOwnContact(Boolean.TRUE);
+
+               // Don't set null or wrong references
+               if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
+                       // Now the number must be given
+                       if (landLine.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
+                       } else if (landLine.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (landLine.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
+                       } else if (landLine.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
+                       }
+
+                       // Set phone number
+                       contact.setContactLandLineNumber(landLine);
                }
 
-               // Update all data in contact
-               this.updateContactData(contact);
+               // Don't set null or wrong references
+               if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
+                       // Now the number must be given
+                       if (fax.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
+                       } else if (fax.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (fax.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
+                       } else if (fax.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
+                       }
 
-               // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+                       // Set fax number
+                       contact.setContactFaxNumber(fax);
+               }
 
-               // Fire event
-               this.updatedContactEvent.fire(new AdminUpdatedContactEvent(updatedContact));
+               // Is the provider set?
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
+                       // Is the number set?
+                       if (mobile.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N
+                       } else if (mobile.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N
+                       }
 
-               // Clear bean
-               this.clear();
+                       // Set cellphone number
+                       contact.setContactMobileNumber(mobile);
+               }
 
                // Return it
                return contact;
@@ -415,7 +489,7 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.updateContactData(contact);
 
                // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileNumberUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
 
                // Fire event
                this.updatedContactEvent.fire(new AdminUpdatedContactEvent(updatedContact));
@@ -428,9 +502,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        }
 
        @Override
-       public String generateMobileNumber (final DialableMobileNumber mobileNumber) {
+       public String generateMobileNumber (final DialableMobileNumber cellphoneNumber) {
                // Is it null?
-               if (null == mobileNumber) {
+               if (null == cellphoneNumber) {
                        // Return null
                        return null;
                }
@@ -438,9 +512,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                // Get all data
                String number = String.format(
                           "%s%d%d", //NOI18N
-                          mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
-                          mobileNumber.getMobileProvider().getProviderDialPrefix(),
-                          mobileNumber.getPhoneNumber()
+                          cellphoneNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
+                          cellphoneNumber.getMobileProvider().getProviderDialPrefix(),
+                          cellphoneNumber.getPhoneNumber()
           );
 
                // Return it
@@ -509,6 +583,17 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.contactId = contactId;
        }
 
+       @Override
+       public String getControllerType () {
+               return "admin"; //NOI18N
+       }
+
+       @Override
+       @Deprecated
+       public void setControllerType (final String controllerType) {
+               throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
+       }
+
        @Override
        public Country getCountry () {
                return this.country;
@@ -620,73 +705,73 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        }
 
        @Override
-       public Long getLandLineId () {
-               return this.landLineId;
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
        }
 
        @Override
-       public void setLandLineId (final Long landLineId) {
-               this.landLineId = landLineId;
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
        }
 
        @Override
-       public MobileProvider getMobileCarrier () {
-               return this.mobileCarrier;
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
        }
 
        @Override
-       public void setMobileCarrier (final MobileProvider mobileCarrier) {
-               this.mobileCarrier = mobileCarrier;
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
        }
 
        @Override
-       public Long getMobileId () {
-               return this.mobileId;
+       public Long getLandLineId () {
+               return this.landLineId;
        }
 
        @Override
-       public void setMobileId (final Long mobileId) {
-               this.mobileId = mobileId;
+       public void setLandLineId (final Long landLineId) {
+               this.landLineId = landLineId;
        }
 
        @Override
-       public Long getMobileNumber () {
-               return this.mobileNumber;
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
        }
 
        @Override
-       public void setMobileNumber (Long mobileNumber) {
-               this.mobileNumber = mobileNumber;
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
        }
 
        @Override
-       public Integer getPhoneAreaCode () {
-               return this.phoneAreaCode;
+       public Long getMobileId () {
+               return this.mobileId;
        }
 
        @Override
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               this.phoneAreaCode = phoneAreaCode;
+       public void setMobileId (final Long mobileId) {
+               this.mobileId = mobileId;
        }
 
        @Override
-       public Country getPhoneCountry () {
-               return this.phoneCountry;
+       public Long getMobileNumber () {
+               return this.mobileNumber;
        }
 
        @Override
-       public void setPhoneCountry (final Country phoneCountry) {
-               this.phoneCountry = phoneCountry;
+       public void setMobileNumber (Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
        }
 
        @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
        }
 
        @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
        }
 
        @Override
@@ -730,7 +815,10 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                        Context context = new InitialContext();
 
                        // Try to lookup
-                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/addressbook-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+
+                       // Try to lookup (administative)
+                       this.adminContactBean = (AdminContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/adminContact!org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote"); //NOI18N
                } catch (final NamingException e) {
                        // Throw again
                        throw new FaceletException(e);
@@ -755,7 +843,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private void clear () {
                // Clear all data
                // - personal data
-               this.setGender(null);
                this.setTitle(null);
                this.setFirstName(null);
                this.setFamilyName(null);
@@ -768,10 +855,10 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
 
                // - contact data
                this.setEmailAddress(null);
-               this.setPhoneCountry(null);
-               this.setPhoneAreaCode(null);
-               this.setPhoneNumber(null);
-               this.setMobileCarrier(null);
+               this.setLandLineCountry(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineNumber(null);
+               this.setMobileProvider(null);
                this.setMobileNumber(null);
                this.setFaxCountry(null);
                this.setFaxAreaCode(null);
@@ -843,11 +930,11 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                contact.setContactCity(this.getCity());
                contact.setContactCountry(this.getCountry());
 
-               // Update contact's mobile number
-               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
+               // Update contact's cellphone number
+               this.isMobileNumberUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
+               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
                this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
index 42251b96a094d53853dddd75e78736b5a946c642..7581196e87f83f51a1c1299b64ee2645545d6657 100644 (file)
@@ -62,18 +62,18 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        String editContactData ();
 
        /**
-        * Getter for mobile id
+        * Getter for cellphone id
         * <p>
         * @return Mobile id
         */
        Long getMobileId ();
 
        /**
-        * Setter for mobile id
+        * Setter for cellphone id
         * <p>
-        * @param mobileId Mobile id
+        * @param cellphoneId Mobile id
         */
-       void setMobileId (final Long mobileId);
+       void setMobileId (final Long cellphoneId);
 
        /**
         * Getter for fax id
@@ -118,32 +118,32 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        void setBirthday (final Date birthday);
 
        /**
-        * Getter for mobile number's carrier
+        * Getter for ellphone number's carrier
         * <p>
         * @return Mobile number's carrier
         */
-       MobileProvider getMobileCarrier ();
+       MobileProvider getMobileProvider ();
 
        /**
-        * Setter for mobile number's carrier prefix
+        * Setter for cellphone number's carrier prefix
         * <p>
-        * @param mobileCarrier Mobile number's carrier prefix
+        * @param cellphoneCarrier Mobile number's carrier prefix
         */
-       void setMobileCarrier (final MobileProvider mobileCarrier);
+       void setMobileProvider (final MobileProvider cellphoneCarrier);
 
        /**
-        * Getter for mobile number
+        * Getter for ellphone number
         * <p>
         * @return Mobile number
         */
        Long getMobileNumber ();
 
        /**
-        * Setter for mobile number
+        * Setter for ellphone number
         * <p>
-        * @param mobileNumber Mobile number
+        * @param cellphoneNumber Mobile number
         */
-       void setMobileNumber (final Long mobileNumber);
+       void setMobileNumber (final Long cellphoneNumber);
 
        /**
         * City
@@ -333,42 +333,42 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
         * <p>
         * @return Phone number's area code
         */
-       Integer getPhoneAreaCode ();
+       Integer getLandLineAreaCode ();
 
        /**
         * Setter for phone number's area code
         * <p>
         * @param phoneAreaCode Phone number's area code
         */
-       void setPhoneAreaCode (final Integer phoneAreaCode);
+       void setLandLineAreaCode (final Integer phoneAreaCode);
 
        /**
         * Getter for phone number's country instance
         * <p>
         * @return Phone number's country instance
         */
-       Country getPhoneCountry ();
+       Country getLandLineCountry ();
 
        /**
         * Setter for phone number's country instance
         * <p>
         * @param phoneCountry Phone number's country instance
         */
-       void setPhoneCountry (final Country phoneCountry);
+       void setLandLineCountry (final Country phoneCountry);
 
        /**
         * Getter for phone number
         * <p>
         * @return Phone number
         */
-       Long getPhoneNumber ();
+       Long getLandLineNumber ();
 
        /**
         * Setter for phone number
         * <p>
         * @param phoneNumber Phone number
         */
-       void setPhoneNumber (final Long phoneNumber);
+       void setLandLineNumber (final Long phoneNumber);
 
        /**
         * Street
@@ -412,6 +412,23 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
         */
        void setZipCode (final Integer zipCode);
 
+       /**
+        * Getter for controller type
+        * <p>
+        * @return controller type
+        */
+       String getControllerType ();
+
+       /**
+        * Setter for controller type
+        * <p>
+        * @param controllerType Controller type
+        * <p>
+        * @deprecated Don't use this method
+        */
+       @Deprecated
+       void setControllerType (final String controllerType);
+
        /**
         * Returns a text respresentation of given phone number or null if not set.
         * <p>
@@ -422,14 +439,14 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        String generatePhoneNumber (final DialableNumber phoneNumber);
 
        /**
-        * Returns a text representation of given mobile number or null if not
+        * Returns a text representation of given cellphone number or null if not
         * set.
         * <p>
-        * @param mobileNumber Mobile number
+        * @param cellphoneNumber Mobile number
         * <p>
         * @return Text respresentation or null
         */
-       String generateMobileNumber (final DialableMobileNumber mobileNumber);
+       String generateMobileNumber (final DialableMobileNumber cellphoneNumber);
 
        /**
         * Checks/returns whether the gender/salutation is required for this
index 82dcded2a9341a8eb32f8657fbd101cf5d8a5943..0b6902a615d76d07fa88e9053a979fcb703cc093 100644 (file)
@@ -174,29 +174,29 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
        private boolean isMobileUnlinked;
 
        /**
-        * Mobile number's carrier
+        * Phone number area code
         */
-       private MobileProvider mobileCarrier;
+       private Integer landLineAreaCode;
 
        /**
-        * Mobile number
+        * Country instance for phone number
         */
-       private Long mobileNumber;
+       private Country landLineCountry;
 
        /**
-        * Phone number area code
+        * Phone number
         */
-       private Integer phoneAreaCode;
+       private Long landLineNumber;
 
        /**
-        * Country instance for phone number
+        * Mobile number
         */
-       private Country phoneCountry;
+       private Long mobileNumber;
 
        /**
-        * Phone number
+        * Mobile number's carrier
         */
-       private Long phoneNumber;
+       private MobileProvider mobileProvider;
 
        /**
         * A list of all selectable contacts
@@ -465,8 +465,8 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
 
                // Generate phone number
-               DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
+               DialableLandLineNumber phone = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new contact
@@ -482,7 +482,7 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                contact.setContactComment(this.getComment());
 
                // Don't set null or wrong references
-               if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) {
+               if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
                        // Now the number must be given
                        if (phone.getPhoneAreaCode() == null) {
                                // Is null
@@ -524,7 +524,7 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                }
 
                // Is the provider set?
-               if ((mobile instanceof DialableMobileNumber) && (this.getMobileCarrier() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
                        // Is the number set?
                        if (mobile.getPhoneNumber() == null) {
                                // Is null
@@ -577,10 +577,10 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                contact.setContactCountry(this.getCountry());
 
                // Update contact's mobile number
-               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
+               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
+               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
                this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
@@ -746,53 +746,53 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
        }
 
        @Override
-       public MobileProvider getMobileCarrier () {
-               return this.mobileCarrier;
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
        }
 
        @Override
-       public void setMobileCarrier (final MobileProvider mobileCarrier) {
-               this.mobileCarrier = mobileCarrier;
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
        }
 
        @Override
-       public Long getMobileNumber () {
-               return this.mobileNumber;
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
        }
 
        @Override
-       public void setMobileNumber (final Long mobileNumber) {
-               this.mobileNumber = mobileNumber;
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
        }
 
        @Override
-       public Integer getPhoneAreaCode () {
-               return this.phoneAreaCode;
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
        }
 
        @Override
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               this.phoneAreaCode = phoneAreaCode;
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
        }
 
        @Override
-       public Country getPhoneCountry () {
-               return this.phoneCountry;
+       public Long getMobileNumber () {
+               return this.mobileNumber;
        }
 
        @Override
-       public void setPhoneCountry (final Country phoneCountry) {
-               this.phoneCountry = phoneCountry;
+       public void setMobileNumber (final Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
        }
 
        @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
        }
 
        @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
        }
 
        @Override
@@ -1023,10 +1023,10 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                // - contact data
                this.setEmailAddress(null);
                this.setEmailAddressRepeat(null);
-               this.setPhoneAreaCode(null);
-               this.setPhoneCountry(null);
-               this.setPhoneNumber(null);
-               this.setMobileCarrier(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineCountry(null);
+               this.setLandLineNumber(null);
+               this.setMobileProvider(null);
                this.setMobileNumber(null);
                this.setFaxAreaCode(null);
                this.setFaxCountry(null);
@@ -1078,13 +1078,13 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
                // - contact data
                if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
-                       this.setPhoneCountry(phone.getPhoneCountry());
-                       this.setPhoneAreaCode(phone.getPhoneAreaCode());
-                       this.setPhoneNumber(phone.getPhoneNumber());
+                       this.setLandLineCountry(phone.getPhoneCountry());
+                       this.setLandLineAreaCode(phone.getPhoneAreaCode());
+                       this.setLandLineNumber(phone.getPhoneNumber());
                }
 
                if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
-                       this.setMobileCarrier(mobile.getMobileProvider());
+                       this.setMobileProvider(mobile.getMobileProvider());
                        this.setMobileNumber(mobile.getPhoneNumber());
                }
 
index 131028cc6b2eda2be3a288e91777a38567ffb2b6..414bc5f38141ca72fd125ce64f38c044e4aa86f6 100644 (file)
@@ -91,14 +91,14 @@ public interface AddressbookContactWebSessionController extends Serializable {
         * <p>
         * @return Mobile number's carrier
         */
-       MobileProvider getMobileCarrier ();
+       MobileProvider getMobileProvider ();
 
        /**
         * Setter for mobile number's carrier prefix
         * <p>
         * @param mobileCarrier Mobile number's carrier prefix
         */
-       void setMobileCarrier (final MobileProvider mobileCarrier);
+       void setMobileProvider (final MobileProvider mobileCarrier);
 
        /**
         * Getter for mobile number
@@ -302,42 +302,42 @@ public interface AddressbookContactWebSessionController extends Serializable {
         * <p>
         * @return Phone number's area code
         */
-       Integer getPhoneAreaCode ();
+       Integer getLandLineAreaCode ();
 
        /**
         * Setter for phone number's area code
         * <p>
         * @param phoneAreaCode Phone number's area code
         */
-       void setPhoneAreaCode (final Integer phoneAreaCode);
+       void setLandLineAreaCode (final Integer phoneAreaCode);
 
        /**
         * Getter for phone number's country instance
         * <p>
         * @return Phone number's country instance
         */
-       Country getPhoneCountry ();
+       Country getLandLineCountry ();
 
        /**
         * Setter for phone number's country instance
         * <p>
         * @param phoneCountry Phone number's country instance
         */
-       void setPhoneCountry (final Country phoneCountry);
+       void setLandLineCountry (final Country phoneCountry);
 
        /**
         * Getter for phone number
         * <p>
         * @return Phone number
         */
-       Long getPhoneNumber ();
+       Long getLandLineNumber ();
 
        /**
         * Setter for phone number
         * <p>
         * @param phoneNumber Phone number
         */
-       void setPhoneNumber (final Long phoneNumber);
+       void setLandLineNumber (final Long phoneNumber);
 
        /**
         * Street