From 808e35fab6cc2b2b67d4b2675319daa1d0697622 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Aug 2016 16:48:58 +0200 Subject: [PATCH] Continued a bit: - added thrown exceptions - renamed specific exceptions as a generic is fine here --- .../AdminContactsPhoneSessionBeanRemote.java | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java b/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java index fb7d8fe..4f65fe7 100644 --- a/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java +++ b/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java @@ -19,9 +19,8 @@ package org.mxchange.jcontacts.phone; import java.io.Serializable; import javax.ejb.Remote; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.exceptions.FaxNumberNotLinkedException; -import org.mxchange.jphone.exceptions.LandLineNumberNotLinkedException; -import org.mxchange.jphone.exceptions.MobileNumberNotLinkedException; +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; @@ -43,8 +42,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param faxNumber Fax number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a fax number is already + * linked in contact */ - Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber); + Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException; /** * Links existing land-line number with given contact instance. The id @@ -54,8 +56,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param landLineNumber Land-line number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a land-line number is + * already linked in contact */ - Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber); + Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException; /** * Links existing mobile number with given contact instance. The id number @@ -65,8 +70,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param mobileNumber Mobile number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a mobile number is already + * linked in contact */ - Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber); + Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException; /** * Links new fax number with given contact instance. The id number should @@ -76,8 +84,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param faxNumber Fax number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a fax number is already + * linked in contact */ - Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber); + Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException; /** * Links new land-line number with given contact instance. The id number @@ -87,8 +98,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param landLineNumber Land-line number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a land-line number is + * already linked in contact */ - Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber); + Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException; /** * Links new mobile number with given contact instance. The id number should @@ -98,8 +112,11 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { * @param mobileNumber Mobile number to link *

* @return Updated contact + *

+ * @throws PhoneNumberAlreadyLinkedException If a mobile number is already + * linked in contact */ - Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber); + Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException; /** * Unlinks fax data from given contact and returns the updated (detached?) @@ -110,10 +127,10 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { *

* @return Updated contact instance *

- * @throws FaxNumberNotLinkedException If a mobile instance is not linked + * @throws PhoneNumberNotLinkedException If a mobile instance is not linked * (null) with this contact */ - Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws FaxNumberNotLinkedException; + Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException; /** * Unlinks land-line data from given contact and returns the updated @@ -124,10 +141,10 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { *

* @return Updated contact instance *

- * @throws LandLineNumberNotLinkedException If a mobile instance is not - * linked (null) with this contact + * @throws PhoneNumberNotLinkedException If a mobile instance is not linked + * (null) with this contact */ - Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws LandLineNumberNotLinkedException; + Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException; /** * Unlinks mobile data from given contact and returns the updated @@ -138,9 +155,9 @@ public interface AdminContactsPhoneSessionBeanRemote extends Serializable { *

* @return Updated contact instance *

- * @throws MobileNumberNotLinkedException If a mobile instance is not linked + * @throws PhoneNumberNotLinkedException If a mobile instance is not linked * (null) with this contact */ - Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberNotLinkedException; + Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException; } -- 2.39.2