2 * Copyright (C) 2016 - 2024 Free Software Foundation
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.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;
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
48 * @throws ContactNotFoundException If the contact instance was not found
50 Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
53 * Links existing land-line number with given contact instance. The id
54 * number should be set.
56 * @param contact Contact to link to
57 * @param landLineNumber Land-line number to link
59 * @return Updated contact
61 * @throws PhoneNumberAlreadyLinkedException If a land-line number is
62 * already linked in contact
63 * @throws ContactNotFoundException If the contact instance was not found
65 Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
68 * Links new fax number with given contact instance. The id number should
71 * @param contact Contact to link to
72 * @param faxNumber Fax number to link
74 * @return Updated contact
76 * @throws PhoneNumberAlreadyLinkedException If a fax number is already
78 * @throws ContactNotFoundException If the contact instance was not found
80 Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
83 * Links new land-line number with given contact instance. The id number
86 * @param contact Contact to link to
87 * @param landLineNumber Land-line number to link
89 * @return Updated contact
91 * @throws PhoneNumberAlreadyLinkedException If a land-line number is
92 * already linked in contact
93 * @throws ContactNotFoundException If the contact instance was not found
95 Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
98 * Unlinks fax data from given contact and returns the updated (managed)
101 * @param contact Contact to unlink fax instance
102 * @param faxNumber Fax number being unlinked
104 * @return Updated contact instance
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
110 Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
113 * Unlinks land-line data from given contact and returns the updated
116 * @param contact Contact to unlink land-line instance
117 * @param landLineNumber Land-line number being unlinked
119 * @return Updated contact instance
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
125 Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;