]> git.mxchange.org Git - jcontacts-lib.git/blobdiff - src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java
The returned instance was a managed instance that have been updated. First find it...
[jcontacts-lib.git] / src / org / mxchange / jcontacts / phone / AdminContactsPhoneSessionBeanRemote.java
index e45eeb9fc8c2ceee67f382fd18b61d8c3a4d769d..067d9ce7f97dc0560008efd4878b7d132d51e44c 100644 (file)
 package org.mxchange.jcontacts.phone;
 
 import java.io.Serializable;
-import java.util.List;
 import javax.ejb.Remote;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
+import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 
 /**
  * A remote interface for administrative purposes around contact's phone numbers
@@ -32,12 +35,129 @@ import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
 
        /**
-        * A list of all contacts having given cellphone instance linked.
+        * Links existing fax number with given contact instance. The id number
+        * should be set.
         * <p>
-        * @param cellPhone Cellphone instance
+        * @param contact Contact to link to
+        * @param faxNumber Fax number to link
         * <p>
-        * @return A list of all linked contacts
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a fax number is already
+        * linked in contact
+        */
+       Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Links existing land-line number with given contact instance. The id
+        * number should be set.
+        * <p>
+        * @param contact Contact to link to
+        * @param landLineNumber Land-line number to link
+        * <p>
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a land-line number is
+        * already linked in contact
+        */
+       Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Links existing mobile number with given contact instance. The id number
+        * should be set.
+        * <p>
+        * @param contact Contact to link to
+        * @param mobileNumber Mobile number to link
+        * <p>
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
+        * linked in contact
+        */
+       Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Links new fax number with given contact instance. The id number should
+        * NOT be set.
+        * <p>
+        * @param contact Contact to link to
+        * @param faxNumber Fax number to link
+        * <p>
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a fax number is already
+        * linked in contact
+        */
+       Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Links new land-line number with given contact instance. The id number
+        * should NOT be set.
+        * <p>
+        * @param contact Contact to link to
+        * @param landLineNumber Land-line number to link
+        * <p>
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a land-line number is
+        * already linked in contact
+        */
+       Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Links new mobile number with given contact instance. The id number should
+        * NOT be set.
+        * <p>
+        * @param contact Contact to link to
+        * @param mobileNumber Mobile number to link
+        * <p>
+        * @return Updated contact
+        * <p>
+        * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
+        * linked in contact
+        */
+       Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
+
+       /**
+        * Unlinks fax data from given contact and returns the updated (managed)
+        * version.
+        * <p>
+        * @param contact Contact to unlink mobile instance
+        * @param faxNumber Fax number being unlinked
+        * <p>
+        * @return Updated contact instance
+        * <p>
+        * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
+        * (null) with this contact
+        */
+       Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException;
+
+       /**
+        * Unlinks land-line data from given contact and returns the updated
+        * (managed) version.
+        * <p>
+        * @param contact Contact to unlink mobile instance
+        * @param landLineNumber Land-line number being unlinked
+        * <p>
+        * @return Updated contact instance
+        * <p>
+        * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
+        * (null) with this contact
+        */
+       Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException;
+
+       /**
+        * Unlinks mobile data from given contact and returns the updated (managed)
+        * version.
+        * <p>
+        * @param contact Contact to unlink mobile instance
+        * @param mobileNumber Mobile number being unlinked
+        * <p>
+        * @return Updated contact instance
+        * <p>
+        * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
+        * (null) with this contact
         */
-       List<Contact> allContacts (final DialableCellphoneNumber cellPhone);
+       Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;
 
 }