]> git.mxchange.org Git - jaddressbook-share-lib.git/blob - src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java
Refacture:
[jaddressbook-share-lib.git] / src / org / mxchange / addressbook / model / shared / SharedAddressbooksSessionBeanRemote.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
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.addressbook.model.shared;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Remote;
22 import org.mxchange.jaddressbookcore.exceptions.UserAlreadySharingAddressbookException;
23 import org.mxchange.jaddressbookcore.model.addressbook.Addressbook;
24 import org.mxchange.jaddressbookcore.model.addressbook.shared.ShareableAddressbook;
25 import org.mxchange.jusercore.model.user.User;
26
27 /**
28  * A remote interface for sharing address books
29  * <p>
30  * @author Roland Haeder<roland@mxchange.org>
31  */
32 @Remote
33 public interface SharedAddressbooksSessionBeanRemote extends Serializable {
34
35         /**
36          * Retrieves a list of all user's shared address books. The list contains
37          * only the shares. But the address books and sharee can be easily
38          * extracted.
39          * <p>
40          * @param user User instance to get list of shared address books (shares)
41          * from
42          *
43          * @return List of shares (= shared address book entries)
44          */
45         List<ShareableAddressbook> allSharedAddressbooks (final User user);
46
47         /**
48          * Starts an address book share between currently logged-in user and
49          * assigned user for current address book.
50          * <p>
51          * @param sharee User sharee instance
52          * @param addressbook Address book instance
53          *
54          * @return Updated share instance
55          *
56          * @throws
57          * org.mxchange.addressbook.exceptions.UserAlreadySharingAddressbookException
58          * When the user is already sharing the address book
59          */
60         ShareableAddressbook startSharing (final User sharee, final Addressbook addressbook) throws UserAlreadySharingAddressbookException;
61
62         /**
63          * Checks if the given user is sharing address books with others
64          * <p>
65          * @param user User instance
66          *
67          * @return Whether the user is sharing address books
68          */
69         Boolean isUserSharingAddressbooks (final User user);
70
71 }