]> git.mxchange.org Git - jcontacts-lib.git/blob - src/org/mxchange/jcontacts/model/phone/AdminContactsPhoneSessionBeanRemote.java
Updated copyright year
[jcontacts-lib.git] / src / org / mxchange / jcontacts / model / phone / AdminContactsPhoneSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 - 2024 Free Software Foundation
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.model.phone;
18
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
22 import org.mxchange.jcontacts.model.contact.Contact;
23 import org.mxchange.jphone.exceptions.phone.PhoneNumberAlreadyLinkedException;
24 import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
25 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
26 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
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          * @throws ContactNotFoundException If the contact instance was not found
49          */
50         Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
51
52         /**
53          * Links existing land-line number with given contact instance. The id
54          * number should be set.
55          * <p>
56          * @param contact        Contact to link to
57          * @param landLineNumber Land-line number to link
58          * <p>
59          * @return Updated contact
60          * <p>
61          * @throws PhoneNumberAlreadyLinkedException If a land-line number is
62          * already linked in contact
63          * @throws ContactNotFoundException If the contact instance was not found
64          */
65         Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
66
67         /**
68          * Links new fax number with given contact instance. The id number should
69          * NOT be set.
70          * <p>
71          * @param contact   Contact to link to
72          * @param faxNumber Fax number to link
73          * <p>
74          * @return Updated contact
75          * <p>
76          * @throws PhoneNumberAlreadyLinkedException If a fax number is already
77          * linked in contact
78          * @throws ContactNotFoundException If the contact instance was not found
79          */
80         Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
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          * <p>
91          * @throws PhoneNumberAlreadyLinkedException If a land-line number is
92          * already linked in contact
93          * @throws ContactNotFoundException If the contact instance was not found
94          */
95         Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
96
97         /**
98          * Unlinks fax data from given contact and returns the updated (managed)
99          * version.
100          * <p>
101          * @param contact   Contact to unlink fax instance
102          * @param faxNumber Fax number being unlinked
103          * <p>
104          * @return Updated contact instance
105          * <p>
106          * @throws PhoneNumberNotLinkedException If a fax instance is not linked
107          * (null) with this contact
108          * @throws ContactNotFoundException If the contact instance was not found
109          */
110         Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
111
112         /**
113          * Unlinks land-line data from given contact and returns the updated
114          * (managed) version.
115          * <p>
116          * @param contact        Contact to unlink land-line instance
117          * @param landLineNumber Land-line number being unlinked
118          * <p>
119          * @return Updated contact instance
120          * <p>
121          * @throws PhoneNumberNotLinkedException If a land-line instance is not
122          * linked (null) with this contact
123          * @throws ContactNotFoundException If the contact instance was not found
124          */
125         Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
126
127 }