]> git.mxchange.org Git - addressbook-war.git/blob - src/java/org/mxchange/addressbook/beans/shares/SharesWebController.java
Moved allShares() to proper bean
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / shares / SharesWebController.java
1 /*
2  * Copyright (C) 2015 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.beans.shares;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.addressbook.model.addressbook.Addressbook;
22 import org.mxchange.addressbook.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 Haeder
29  */
30 public interface SharesWebController extends Serializable {
31
32         /**
33          * Checks wether the current user is sharing address books with others
34          * <p>
35          * @return Whether the current user is sharing address books
36          */
37         boolean isSharingAddressbooks ();
38
39         /**
40          * Getter for sharee's user id
41          * <p>
42          * @return Sharee's user id
43          */
44         Long getShareeUserId ();
45
46         /**
47          * Setter for sharee's user id
48          * <p>
49          * @param shareeUserId Sharee's user id
50          */
51         void setShareeUserId (final Long shareeUserId);
52
53         /**
54          * Getter for share instance
55          * <p>
56          * @return Share instance
57          */
58         ShareableAddressbook getShare ();
59
60         /**
61          * Setter for share instance
62          * <p>
63          * @param share Share instance
64          */
65         void setShare (final ShareableAddressbook share);
66
67         /**
68          * Checks whether the sharee's user id is set
69          * <p>
70          * @return Whether the sharee's user id is set
71          */
72         boolean isShareeUserIdSet ();
73
74         /**
75          * Checks if the sharee's user id is empty.
76          * <p>
77          * @return Whether the sharee's user id is empty.
78          */
79         boolean isShareeUserIdEmpty ();
80
81         /**
82          * Starts an address book share between currently logged-in user and
83          * assigned user for current address book.
84          * <p>
85          * @param user User instance
86          * @param addressbook Address book instance
87          * @return Redirect target
88          */
89         String startSharing (final User user, final Addressbook addressbook);
90
91         /**
92          * Returns a list of all address books the user is sharing with others.
93          * <p>
94          * @return List of all shared address books
95          */
96         List<ShareableAddressbook> allShares ();
97 }