2 * Copyright (C) 2016 - 2020 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
64 Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
67 * Links new fax number with given contact instance. The id number should
70 * @param contact Contact to link to
71 * @param faxNumber Fax number to link
73 * @return Updated contact
75 * @throws PhoneNumberAlreadyLinkedException If a fax number is already
77 * @throws ContactNotFoundException If the contact instance was not found
79 Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
82 * Links new land-line number with given contact instance. The id number
85 * @param contact Contact to link to
86 * @param landLineNumber Land-line number to link
88 * @return Updated contact
90 * @throws PhoneNumberAlreadyLinkedException If a land-line number is
91 * already linked in contact
92 * @throws ContactNotFoundException If the contact instance was not found
94 Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException, ContactNotFoundException;
97 * Unlinks fax data from given contact and returns the updated (managed)
100 * @param contact Contact to unlink fax instance
101 * @param faxNumber Fax number being unlinked
103 * @return Updated contact instance
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
109 Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;
112 * Unlinks land-line data from given contact and returns the updated
115 * @param contact Contact to unlink land-line instance
116 * @param landLineNumber Land-line number being unlinked
118 * @return Updated contact instance
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
124 Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException, ContactNotFoundException;