]> git.mxchange.org Git - jcontacts-lib.git/blob - src/org/mxchange/jcontacts/model/mobile/AdminContactsMobileSessionBeanRemote.java
Continued:
[jcontacts-lib.git] / src / org / mxchange / jcontacts / model / mobile / AdminContactsMobileSessionBeanRemote.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.mobile;
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.mobile.MobileNumberAlreadyLinkedException;
24 import org.mxchange.jphone.exceptions.mobile.MobileNumberNotLinkedException;
25 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
26
27 /**
28  * A remote interface for administrative purposes around contact's phone numbers
29  * (any type).
30  * <p>
31  * @author Roland Häder<roland@mxchange.org>
32  */
33 @Remote
34 public interface AdminContactsMobileSessionBeanRemote extends Serializable {
35
36         /**
37          * Links existing mobile number with given contact instance.The id number
38          * should be set.<p>
39          * @param contact      Contact to link to
40          * @param mobileNumber Mobile number to link
41          * <p>
42          * @return Updated contact
43          * <p>
44          * @throws MobileNumberAlreadyLinkedException If a mobile number is already
45          * linked in contact
46          * @throws ContactNotFoundException If the given contact wasn't found
47          */
48         Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberAlreadyLinkedException, ContactNotFoundException;
49
50         /**
51          * Links new mobile number with given contact instance. The id number should
52          * NOT be set.
53          * <p>
54          * @param contact      Contact to link to
55          * @param mobileNumber Mobile number to link
56          * <p>
57          * @return Updated contact
58          * <p>
59          * @throws MobileNumberAlreadyLinkedException If a mobile number is already
60          * linked in contact
61          * @throws ContactNotFoundException If contact instance was not found
62          */
63         Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberAlreadyLinkedException, ContactNotFoundException;
64
65         /**
66          * Unlinks mobile data from given contact and returns the updated (managed)
67          * version.
68          * <p>
69          * @param contact      Contact to unlink mobile instance
70          * @param mobileNumber Mobile number being unlinked
71          * <p>
72          * @return Updated contact instance
73          * <p>
74          * @throws MobileNumberNotLinkedException If a mobile instance is not linked
75          * (null) with this contact
76          * @throws ContactNotFoundException If contact instance was not found
77          */
78         Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws MobileNumberNotLinkedException, ContactNotFoundException;
79
80 }