]> git.mxchange.org Git - addressbook-war.git/blob - src/java/org/mxchange/addressbook/beans/addressbook/share/AddressbookSharesWebSessionController.java
ported project to new libraries jaddressbook-share-core/lib
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / addressbook / share / AddressbookSharesWebSessionController.java
1 /*
2  * Copyright (C) 2016 Roland Häder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as
6  * published by the Free Software Foundation, either version 3 of the
7  * License, or (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 Affero General Public License for more details.
13  *
14  * You should have received a copy of the GNU Affero General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.addressbook.beans.addressbook.share;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jaddressbook.model.addressbook.Addressbook;
22 import org.mxchange.jaddressbookshare.model.addressbook.shared.ShareableAddressbook;
23 import org.mxchange.jusercore.model.user.User;
24
25 /**
26  * Controller interface sharing address books
27  * <p>
28  * @author Roland Häder<roland@mxchange.org>
29  */
30 public interface AddressbookSharesWebSessionController extends Serializable {
31
32         /**
33          * Returns a list of all address books the user is sharing with others.
34          * <p>
35          * @return List of all shared address books
36          */
37         List<ShareableAddressbook> allShares ();
38
39         /**
40          * Getter for share instance
41          * <p>
42          * @return Share instance
43          */
44         ShareableAddressbook getShare ();
45
46         /**
47          * Setter for share instance
48          * <p>
49          * @param share Share instance
50          */
51         void setShare (final ShareableAddressbook share);
52
53         /**
54          * Getter for sharee's user id
55          * <p>
56          * @return Sharee's user id
57          */
58         Long getShareeUserId ();
59
60         /**
61          * Setter for sharee's user id
62          * <p>
63          * @param shareeUserId Sharee's user id
64          */
65         void setShareeUserId (final Long shareeUserId);
66
67         /**
68          * Checks if the sharee's user id is empty.
69          * <p>
70          * @return Whether the sharee's user id is empty.
71          */
72         boolean isShareeUserIdEmpty ();
73
74         /**
75          * Checks whether the sharee's user id is set
76          * <p>
77          * @return Whether the sharee's user id is set
78          */
79         boolean isShareeUserIdSet ();
80
81         /**
82          * Checks wether the current user is sharing address books with others
83          * <p>
84          * @return Whether the current user is sharing address books
85          */
86         boolean isSharingAddressbooks ();
87
88         /**
89          * Starts an address book share between currently logged-in user and
90          * assigned user for current address book.
91          * <p>
92          * @param user User instance
93          * @param addressbook Address book instance
94          * <p>
95          * @return Redirect target
96          */
97         String startSharing (final User user, final Addressbook addressbook);
98
99         /**
100          * Count all shared address books by given user id
101          * <p>
102          * @param user User instance to look for
103          * <p>
104          * @return Count of user's shared address books
105          */
106         Integer countAllUserSharedAddressbooks (final User user);
107
108         /**
109          * Retrieves a list of all users this user is not sharing this address book
110          * with.
111          * <p>
112          * @return List of not sharing users
113          */
114         List<User> allUsersNotSharing ();
115
116 }