2 * Copyright (C) 2016 Roland Haeder<rhaeder@cho-time.de>
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.
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.
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/>.
17 package org.mxchange.jjobs.beans.user.activity;
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Local;
22 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
23 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
24 import org.mxchange.jusercore.events.logout.ObserveableUserLogoutEvent;
25 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
26 import org.mxchange.jusercore.events.resendlink.UserResendLinkAccountEvent;
27 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
28 import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent;
29 import org.mxchange.jusercore.events.user.locked.AdminLockedUserEvent;
30 import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
31 import org.mxchange.jusercore.events.user.unlocked.AdminUnlockedUserEvent;
32 import org.mxchange.jusercore.events.user.update.AdminUpdatedUserDataEvent;
33 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
34 import org.mxchange.jusercore.model.user.User;
35 import org.mxchange.jusercore.model.user.activity.LogableUserActivity;
38 * A controller (bean) interface for user activity log
40 * @author Roland Haeder<rhaeder@cho-time.de>
43 public interface JobsUserActivityWebApplicationController extends Serializable {
46 * Event observer for newly added users by adminstrator
48 * @param event Event being fired
50 void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
53 * Event observer for linked users with existing contact data
55 * @param event Event being fired
57 void afterAdminLinkedUserEvent (final AdminLinkedUserEvent event);
60 * Event observer for locked users
62 * @param event Event being fired
64 void afterAdminLockedUserEvent (final AdminLockedUserEvent event);
67 * Event observer for unlocked users
69 * @param event Event being fired
71 void afterAdminUnlockedUserEvent (final AdminUnlockedUserEvent event);
74 * Event observer for updated user data by administrator
76 * @param event Event being updated
78 void afterAdminUpdatedUserDataEvent (final AdminUpdatedUserDataEvent event);
81 * Event observer when user confirmed account.
83 * @param event Event being fired
85 void afterUserConfirmedAccountEvent (final UserConfirmedAccountEvent event);
88 * Event observer for logged-out user
90 * @param event Event instance
92 void afterUserLogoutEvent (final ObserveableUserLogoutEvent event);
95 * Method being call after user's password has been updated (and history
96 * entry has been created).
98 * @param event Event being observed
100 void afterUserUpdatedPasswordEvent (final UpdatedUserPasswordEvent event);
103 * Listens to fired event when user updated personal data
105 * @param event Event being fired
107 void afterUserUpdatedPersonalDataEvent (final UpdatedUserPersonalDataEvent event);
110 * Event observer for new user registrations
112 * @param event Event being fired
114 void afterUserRegistrationEvent (final UserRegisteredEvent event);
117 * Event observer for logged-in user
119 * @param event Event being fired
121 void afterUserLoginEvent (final UserLoggedInEvent event);
124 * Event observer for users resending their confirmation link
126 * @param event Event being fired
128 void afterUserResendConfirmationLinkEvent (final UserResendLinkAccountEvent event);
131 * Adds user activity entry with given type
133 * @param user User instance
134 * @param activityType Activity type
136 void addUserActivity (final User user, final String activityType);
139 * Adds user activity log with type and message
141 * @param user User instance
142 * @param activityType Activity type
143 * @param message Activity message
145 void addUserActivity (final User user, final String activityType, final String message);
148 * Returns a list of in beanHelper set user instance's activity log
150 * @return List of user's activity log
152 List<LogableUserActivity> allCurrentUsersActivityLog ();
155 * Expands given activity type into a i18n string for administrators
157 * @param activityType Activity type
159 * @return Expanded i18n string
161 String expandAdminActivityType (final String activityType);
164 * Expands given activity type into a i18n string for users
166 * @param activityType Activity type
168 * @return Expanded i18n string
170 String expandUserActivityType (final String activityType);