/*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import java.io.Serializable;
import javax.ejb.Remote;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
-import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
+import org.mxchange.jphone.exceptions.phone.PhoneNumberAlreadyLinkedException;
+import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* A remote interface for administrative purposes around contact's phone numbers
* Links existing fax number with given contact instance. The id number
* should be set.
* <p>
- * @param contact Contact to link to
+ * @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
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
+ Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
/**
* Links existing land-line number with given contact instance. The id
* number should be set.
* <p>
- * @param contact Contact to link to
+ * @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
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- 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;
+ Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
/**
* Links new fax number with given contact instance. The id number should
* NOT be set.
* <p>
- * @param contact Contact to link to
+ * @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
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
+ Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
/**
* Links new land-line number with given contact instance. The id number
* should NOT be set.
* <p>
- * @param contact Contact to link to
+ * @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
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- 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;
+ Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
/**
* Unlinks fax data from given contact and returns the updated (managed)
* version.
* <p>
- * @param contact Contact to unlink mobile instance
+ * @param contact Contact to unlink fax instance
* @param faxNumber Fax number being unlinked
* <p>
* @return Updated contact instance
* <p>
- * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
+ * @throws PhoneNumberNotLinkedException If a fax instance is not linked
* (null) with this contact
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException;
+ Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
/**
* Unlinks land-line data from given contact and returns the updated
* (managed) version.
* <p>
- * @param contact Contact to unlink mobile instance
+ * @param contact Contact to unlink land-line 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
+ * @throws PhoneNumberNotLinkedException If a land-line instance is not
+ * linked (null) with this contact
+ * @throws ContactNotFoundException If the contact instance was not found
*/
- Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;
+ Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
}