]> git.mxchange.org Git - addressbook-war.git/blob - src/java/org/mxchange/addressbook/beans/shares/SharesWebSessionController.java
Added email address for author
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / shares / SharesWebSessionController.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.beans.shares;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.addressbook.events.sharing.AddressbookSharingEvent;
22 import org.mxchange.addressbook.model.addressbook.Addressbook;
23 import org.mxchange.addressbook.model.addressbook.shared.ShareableAddressbook;
24 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
25 import org.mxchange.jusercore.model.user.User;
26
27 /**
28  * Controller interface sharing address books
29  * <p>
30  * @author Roland Haeder<roland@mxchange.org>
31  */
32 public interface SharesWebSessionController extends Serializable {
33
34         /**
35          * Observer method for ended sharing events
36          * <p>
37          * @param event Event instance
38          */
39         void afterAdressbookShareEnded (final AddressbookSharingEvent event);
40
41         /**
42          * Observer method for started sharing events
43          * <p>
44          * @param event Event instance
45          */
46         void afterAdressbookShareStarted (final AddressbookSharingEvent event);
47
48         /**
49          * This method is called when a user has successfully logged in his/her
50          * account.
51          * <p>
52          * @param event
53          */
54         void afterLoginEvent (final UserLoggedInEvent event);
55
56         /**
57          * Returns a list of all address books the user is sharing with others.
58          * <p>
59          * @return List of all shared address books
60          */
61         List<ShareableAddressbook> allShares ();
62
63         /**
64          * Getter for share instance
65          * <p>
66          * @return Share instance
67          */
68         ShareableAddressbook getShare ();
69
70         /**
71          * Setter for share instance
72          * <p>
73          * @param share Share instance
74          */
75         void setShare (final ShareableAddressbook share);
76
77         /**
78          * Getter for sharee's user id
79          * <p>
80          * @return Sharee's user id
81          */
82         Long getShareeUserId ();
83
84         /**
85          * Setter for sharee's user id
86          * <p>
87          * @param shareeUserId Sharee's user id
88          */
89         void setShareeUserId (final Long shareeUserId);
90
91         /**
92          * Checks if the sharee's user id is empty.
93          * <p>
94          * @return Whether the sharee's user id is empty.
95          */
96         boolean isShareeUserIdEmpty ();
97
98         /**
99          * Checks whether the sharee's user id is set
100          * <p>
101          * @return Whether the sharee's user id is set
102          */
103         boolean isShareeUserIdSet ();
104
105         /**
106          * Checks wether the current user is sharing address books with others
107          * <p>
108          * @return Whether the current user is sharing address books
109          */
110         boolean isSharingAddressbooks ();
111
112         /**
113          * Starts an address book share between currently logged-in user and
114          * assigned user for current address book.
115          * <p>
116          * @param user User instance
117          * @param addressbook Address book instance
118          * <p>
119          * @return Redirect target
120          */
121         String startSharing (final User user, final Addressbook addressbook);
122 }