2 * Copyright (C) 2016 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcontacts.phone;
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jcontacts.contact.Contact;
22 import org.mxchange.jphone.exceptions.FaxNumberNotLinkedException;
23 import org.mxchange.jphone.exceptions.LandLineNumberNotLinkedException;
24 import org.mxchange.jphone.exceptions.MobileNumberNotLinkedException;
25 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
26 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
27 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
30 * A remote interface for administrative purposes around contact's phone numbers
33 * @author Roland Haeder<roland@mxchange.org>
36 public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
39 * Links existing fax number with given contact instance. The id number
42 * @param contact Contact to link to
43 * @param faxNumber Fax number to link
45 * @return Updated contact
47 Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber);
50 * Links existing land-line number with given contact instance. The id
51 * number should be set.
53 * @param contact Contact to link to
54 * @param landLineNumber Land-line number to link
56 * @return Updated contact
58 Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber);
61 * Links existing mobile number with given contact instance. The id number
64 * @param contact Contact to link to
65 * @param mobileNumber Mobile number to link
67 * @return Updated contact
69 Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber);
72 * Links new fax number with given contact instance. The id number should
75 * @param contact Contact to link to
76 * @param faxNumber Fax number to link
78 * @return Updated contact
80 Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber);
83 * Links new land-line number with given contact instance. The id number
86 * @param contact Contact to link to
87 * @param landLineNumber Land-line number to link
89 * @return Updated contact
91 Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber);
94 * Links new mobile number with given contact instance. The id number should
97 * @param contact Contact to link to
98 * @param mobileNumber Mobile number to link
100 * @return Updated contact
102 Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber);
105 * Unlinks fax data from given contact and returns the updated (detached?)
108 * @param contact Contact to unlink mobile instance
109 * @param faxNumber Fax number being unlinked
111 * @return Updated contact instance
113 * @throws FaxNumberNotLinkedException If a mobile instance is not linked
114 * (null) with this contact
116 Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws FaxNumberNotLinkedException;
119 * Unlinks land-line data from given contact and returns the updated
120 * (detached?) version.
122 * @param contact Contact to unlink mobile instance
123 * @param landLineNumber Land-line number being unlinked
125 * @return Updated contact instance
127 * @throws LandLineNumberNotLinkedException If a mobile instance is not
128 * linked (null) with this contact
130 Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws LandLineNumberNotLinkedException;
133 * Unlinks mobile data from given contact and returns the updated
134 * (detached?) version.
136 * @param contact Contact to unlink mobile instance
137 * @param mobileNumber Mobile number being unlinked
139 * @return Updated contact instance
141 * @throws MobileNumberNotLinkedException If a mobile instance is not linked
142 * (null) with this contact
144 Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberNotLinkedException;