]> 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 - 2022 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          */
64         Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
65
66         /**
67          * Links new fax number with given contact instance. The id number should
68          * NOT be set.
69          * <p>
70          * @param contact   Contact to link to
71          * @param faxNumber Fax number to link
72          * <p>
73          * @return Updated contact
74          * <p>
75          * @throws PhoneNumberAlreadyLinkedException If a fax number is already
76          * linked in contact
77          * @throws ContactNotFoundException If the contact instance was not found
78          */
79         Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
80
81         /**
82          * Links new land-line number with given contact instance. The id number
83          * should NOT be set.
84          * <p>
85          * @param contact        Contact to link to
86          * @param landLineNumber Land-line number to link
87          * <p>
88          * @return Updated contact
89          * <p>
90          * @throws PhoneNumberAlreadyLinkedException If a land-line number is
91          * already linked in contact
92          * @throws ContactNotFoundException If the contact instance was not found
93          */
94         Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
95
96         /**
97          * Unlinks fax data from given contact and returns the updated (managed)
98          * version.
99          * <p>
100          * @param contact   Contact to unlink fax instance
101          * @param faxNumber Fax number being unlinked
102          * <p>
103          * @return Updated contact instance
104          * <p>
105          * @throws PhoneNumberNotLinkedException If a fax instance is not linked
106          * (null) with this contact
107          * @throws ContactNotFoundException If the contact instance was not found
108          */
109         Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
110
111         /**
112          * Unlinks land-line data from given contact and returns the updated
113          * (managed) version.
114          * <p>
115          * @param contact        Contact to unlink land-line instance
116          * @param landLineNumber Land-line number being unlinked
117          * <p>
118          * @return Updated contact instance
119          * <p>
120          * @throws PhoneNumberNotLinkedException If a land-line instance is not
121          * linked (null) with this contact
122          * @throws ContactNotFoundException If the contact instance was not found
123          */
124         Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
125
126 }