2 * Copyright (C) 2016, 2017 Roland Häder
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.model.phone;
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jcontacts.model.contact.Contact;
22 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
23 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
24 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
25 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
26 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
29 * A remote interface for administrative purposes around contact's phone numbers
32 * @author Roland Häder<roland@mxchange.org>
35 public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
38 * Links existing fax number with given contact instance. The id number
41 * @param contact Contact to link to
42 * @param faxNumber Fax number to link
44 * @return Updated contact
46 * @throws PhoneNumberAlreadyLinkedException If a fax number is already
49 Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
52 * Links existing land-line number with given contact instance. The id
53 * number should be set.
55 * @param contact Contact to link to
56 * @param landLineNumber Land-line number to link
58 * @return Updated contact
60 * @throws PhoneNumberAlreadyLinkedException If a land-line number is
61 * already linked in contact
63 Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
66 * Links existing mobile number with given contact instance. The id number
69 * @param contact Contact to link to
70 * @param mobileNumber Mobile number to link
72 * @return Updated contact
74 * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
77 Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
80 * Links new fax number with given contact instance. The id number should
83 * @param contact Contact to link to
84 * @param faxNumber Fax number to link
86 * @return Updated contact
88 * @throws PhoneNumberAlreadyLinkedException If a fax number is already
91 Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
94 * Links new land-line number with given contact instance. The id number
97 * @param contact Contact to link to
98 * @param landLineNumber Land-line number to link
100 * @return Updated contact
102 * @throws PhoneNumberAlreadyLinkedException If a land-line number is
103 * already linked in contact
105 Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
108 * Links new mobile number with given contact instance. The id number should
111 * @param contact Contact to link to
112 * @param mobileNumber Mobile number to link
114 * @return Updated contact
116 * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
119 Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
122 * Unlinks fax data from given contact and returns the updated (managed)
125 * @param contact Contact to unlink mobile instance
126 * @param faxNumber Fax number being unlinked
128 * @return Updated contact instance
130 * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
131 * (null) with this contact
133 Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException;
136 * Unlinks land-line data from given contact and returns the updated
139 * @param contact Contact to unlink mobile instance
140 * @param landLineNumber Land-line number being unlinked
142 * @return Updated contact instance
144 * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
145 * (null) with this contact
147 Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException;
150 * Unlinks mobile data from given contact and returns the updated (managed)
153 * @param contact Contact to unlink mobile instance
154 * @param mobileNumber Mobile number being unlinked
156 * @return Updated contact instance
158 * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
159 * (null) with this contact
161 Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;