]> git.mxchange.org Git - jcontacts-business-lib.git/blob - src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java
842ca8c5af3cec537eeb601cbb2b2cca53b0cf67
[jcontacts-business-lib.git] / src / org / mxchange / jcontacts / phone / AdminContactsPhoneSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 Roland Häder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jcontacts.phone;
18
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jcontacts.contact.Contact;
22 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
23 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
24 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
25 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
26 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
27
28 /**
29  * A remote interface for administrative purposes around contact's phone numbers
30  * (any type).
31  * <p>
32  * @author Roland Häder<roland@mxchange.org>
33  */
34 @Remote
35 public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
36
37         /**
38          * Links existing fax number with given contact instance. The id number
39          * should be set.
40          * <p>
41          * @param contact Contact to link to
42          * @param faxNumber Fax number to link
43          * <p>
44          * @return Updated contact
45          * <p>
46          * @throws PhoneNumberAlreadyLinkedException If a fax number is already
47          * linked in contact
48          */
49         Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
50
51         /**
52          * Links existing land-line number with given contact instance. The id
53          * number should be set.
54          * <p>
55          * @param contact Contact to link to
56          * @param landLineNumber Land-line number to link
57          * <p>
58          * @return Updated contact
59          * <p>
60          * @throws PhoneNumberAlreadyLinkedException If a land-line number is
61          * already linked in contact
62          */
63         Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
64
65         /**
66          * Links existing mobile number with given contact instance. The id number
67          * should be set.
68          * <p>
69          * @param contact Contact to link to
70          * @param mobileNumber Mobile number to link
71          * <p>
72          * @return Updated contact
73          * <p>
74          * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
75          * linked in contact
76          */
77         Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
78
79         /**
80          * Links new fax number with given contact instance. The id number should
81          * NOT be set.
82          * <p>
83          * @param contact Contact to link to
84          * @param faxNumber Fax number to link
85          * <p>
86          * @return Updated contact
87          * <p>
88          * @throws PhoneNumberAlreadyLinkedException If a fax number is already
89          * linked in contact
90          */
91         Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException;
92
93         /**
94          * Links new land-line number with given contact instance. The id number
95          * should NOT be set.
96          * <p>
97          * @param contact Contact to link to
98          * @param landLineNumber Land-line number to link
99          * <p>
100          * @return Updated contact
101          * <p>
102          * @throws PhoneNumberAlreadyLinkedException If a land-line number is
103          * already linked in contact
104          */
105         Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException;
106
107         /**
108          * Links new mobile number with given contact instance. The id number should
109          * NOT be set.
110          * <p>
111          * @param contact Contact to link to
112          * @param mobileNumber Mobile number to link
113          * <p>
114          * @return Updated contact
115          * <p>
116          * @throws PhoneNumberAlreadyLinkedException If a mobile number is already
117          * linked in contact
118          */
119         Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException;
120
121         /**
122          * Unlinks fax data from given contact and returns the updated (managed)
123          * version.
124          * <p>
125          * @param contact Contact to unlink mobile instance
126          * @param faxNumber Fax number being unlinked
127          * <p>
128          * @return Updated contact instance
129          * <p>
130          * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
131          * (null) with this contact
132          */
133         Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException;
134
135         /**
136          * Unlinks land-line data from given contact and returns the updated
137          * (managed) version.
138          * <p>
139          * @param contact Contact to unlink mobile instance
140          * @param landLineNumber Land-line number being unlinked
141          * <p>
142          * @return Updated contact instance
143          * <p>
144          * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
145          * (null) with this contact
146          */
147         Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException;
148
149         /**
150          * Unlinks mobile data from given contact and returns the updated (managed)
151          * version.
152          * <p>
153          * @param contact Contact to unlink mobile instance
154          * @param mobileNumber Mobile number being unlinked
155          * <p>
156          * @return Updated contact instance
157          * <p>
158          * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
159          * (null) with this contact
160          */
161         Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;
162
163 }