2 * Copyright (C) 2016 - 2022 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.mobile;
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.mobile.MobileNumberAlreadyLinkedException;
24 import org.mxchange.jphone.exceptions.mobile.MobileNumberNotLinkedException;
25 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
28 * A remote interface for administrative purposes around contact's phone numbers
31 * @author Roland Häder<roland@mxchange.org>
34 public interface AdminContactsMobileSessionBeanRemote extends Serializable {
37 * Links existing mobile number with given contact instance. The id number
40 * @param contact Contact to link to
41 * @param mobileNumber Mobile number to link
43 * @return Updated contact
45 * @throws MobileNumberAlreadyLinkedException If a mobile number is already
48 Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberAlreadyLinkedException, ContactNotFoundException;
51 * Links new mobile number with given contact instance. The id number should
54 * @param contact Contact to link to
55 * @param mobileNumber Mobile number to link
57 * @return Updated contact
59 * @throws MobileNumberAlreadyLinkedException If a mobile number is already
61 * @throws ContactNotFoundException If contact instance was not found
63 Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberAlreadyLinkedException, ContactNotFoundException;
66 * Unlinks mobile data from given contact and returns the updated (managed)
69 * @param contact Contact to unlink mobile instance
70 * @param mobileNumber Mobile number being unlinked
72 * @return Updated contact instance
74 * @throws MobileNumberNotLinkedException If a mobile instance is not linked
75 * (null) with this contact
76 * @throws ContactNotFoundException If contact instance was not found
78 Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberNotLinkedException, ContactNotFoundException;