2 * Copyright (C) 2016 Roland Haeder
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.addressbook.model.shared;
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Remote;
22 import org.mxchange.addressbook.exceptions.UserAlreadySharingAddressbookException;
23 import org.mxchange.addressbook.model.addressbook.Addressbook;
24 import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
25 import org.mxchange.jusercore.model.user.User;
28 * A remote interface for sharing address books
30 * @author Roland Haeder<roland@mxchange.org>
33 public interface SharedAddressbooksSessionBeanRemote extends Serializable {
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
40 * @param user User instance to get list of shared address books (shares)
43 * @return List of shares (= shared address book entries)
45 List<ShareableAddressbook> allSharedAddressbooks (final User user);
48 * Starts an address book share between currently logged-in user and
49 * assigned user for current address book.
51 * @param sharee User sharee instance
52 * @param addressbook Address book instance
54 * @return Updated share instance
57 * org.mxchange.addressbook.exceptions.UserAlreadySharingAddressbookException
58 * When the user is already sharing the address book
60 ShareableAddressbook startSharing (final User sharee, final Addressbook addressbook) throws UserAlreadySharingAddressbookException;
63 * Checks if the given user is sharing address books with others
65 * @param user User instance
67 * @return Whether the user is sharing address books
69 Boolean isUserSharingAddressbooks (final User user);