]> git.mxchange.org Git - jcontacts-lib.git/blob - src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java
Continued a bit:
[jcontacts-lib.git] / src / org / mxchange / jcontacts / phone / AdminContactsPhoneSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
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.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;
28
29 /**
30  * A remote interface for administrative purposes around contact's phone numbers
31  * (any type).
32  * <p>
33  * @author Roland Haeder<roland@mxchange.org>
34  */
35 @Remote
36 public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
37
38         /**
39          * Links existing fax number with given contact instance. The id number
40          * should be set.
41          * <p>
42          * @param contact Contact to link to
43          * @param faxNumber Fax number to link
44          * <p>
45          * @return Updated contact
46          */
47         Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber);
48
49         /**
50          * Links existing land-line number with given contact instance. The id
51          * number should be set.
52          * <p>
53          * @param contact Contact to link to
54          * @param landLineNumber Land-line number to link
55          * <p>
56          * @return Updated contact
57          */
58         Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber);
59
60         /**
61          * Links existing mobile number with given contact instance. The id number
62          * should be set.
63          * <p>
64          * @param contact Contact to link to
65          * @param mobileNumber Mobile number to link
66          * <p>
67          * @return Updated contact
68          */
69         Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber);
70
71         /**
72          * Links new fax number with given contact instance. The id number should
73          * NOT be set.
74          * <p>
75          * @param contact Contact to link to
76          * @param faxNumber Fax number to link
77          * <p>
78          * @return Updated contact
79          */
80         Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber);
81
82         /**
83          * Links new land-line number with given contact instance. The id number
84          * should NOT be set.
85          * <p>
86          * @param contact Contact to link to
87          * @param landLineNumber Land-line number to link
88          * <p>
89          * @return Updated contact
90          */
91         Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber);
92
93         /**
94          * Links new mobile number with given contact instance. The id number should
95          * NOT be set.
96          * <p>
97          * @param contact Contact to link to
98          * @param mobileNumber Mobile number to link
99          * <p>
100          * @return Updated contact
101          */
102         Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber);
103
104         /**
105          * Unlinks fax data from given contact and returns the updated (detached?)
106          * version.
107          * <p>
108          * @param contact Contact to unlink mobile instance
109          * @param faxNumber Fax number being unlinked
110          * <p>
111          * @return Updated contact instance
112          * <p>
113          * @throws FaxNumberNotLinkedException If a mobile instance is not linked
114          * (null) with this contact
115          */
116         Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws FaxNumberNotLinkedException;
117
118         /**
119          * Unlinks land-line data from given contact and returns the updated
120          * (detached?) version.
121          * <p>
122          * @param contact Contact to unlink mobile instance
123          * @param landLineNumber Land-line number being unlinked
124          * <p>
125          * @return Updated contact instance
126          * <p>
127          * @throws LandLineNumberNotLinkedException If a mobile instance is not
128          * linked (null) with this contact
129          */
130         Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws LandLineNumberNotLinkedException;
131
132         /**
133          * Unlinks mobile data from given contact and returns the updated
134          * (detached?) version.
135          * <p>
136          * @param contact Contact to unlink mobile instance
137          * @param mobileNumber Mobile number being unlinked
138          * <p>
139          * @return Updated contact instance
140          * <p>
141          * @throws MobileNumberNotLinkedException If a mobile instance is not linked
142          * (null) with this contact
143          */
144         Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberNotLinkedException;
145
146 }