Class ActivityStreamClientInteraction
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.activities.activitystream.ActivityStreamClientInteraction
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ActivityStreamClientInteraction
extends AbstractLogEnabled
implements Component, Serviceable
Component gathering methods for the activity stream service
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetActivities
(List<String> projectNames, List<String> filterEventTypes, int limit) Get the activities of the given projects and of the given event typesgetActivitiesForCurrentUser
(int limit) Get the activities for the current user with the allowed event types get from the user projects.getActivitiesForCurrentUser
(Set<Project> projects, int limit) Get the activities for the current user with the allowed event types get from the given projects.getAllowedEventTypes
(Set<Project> projects) Get the list of allowed event types for the given projectsgetDateOfLastActivity
(String projectName, List<String> excludeActivityTypes) Get the date of last activity regardless the current user's rightsgetDateOfLastActivityByActivityType
(String projectName, Collection<String> includeActivityTypes) Get the date of last activity regardless the current user's rightslong
Get the number of unread events for the current uservoid
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
ACTIVITY_STREAM_USER_PREF_CONTEXT
the user preferences context for activity stream- See Also:
-
ACTIVITY_STREAM_USER_PREF_LAST_UPDATE
the id of user preferences for the last update of activity stream- See Also:
-
-
Constructor Details
-
ActivityStreamClientInteraction
public ActivityStreamClientInteraction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getActivities
public List<Map<String,Object>> getActivities(List<String> projectNames, List<String> filterEventTypes, int limit) Get the activities of the given projects and of the given event types- Parameters:
projectNames
- the names of the projects. Can not be null.filterEventTypes
- the type of events to retain. Can be empty to get all activities.limit
- The max number of activities- Returns:
- the retained activities
-
getDateOfLastActivity
Get the date of last activity regardless the current user's rights- Parameters:
projectName
- The project's nameexcludeActivityTypes
- the types of activity to ignore from this search- Returns:
- the date of last activity or null if no activity found or an error occurred
-
getDateOfLastActivityByActivityType
public ZonedDateTime getDateOfLastActivityByActivityType(String projectName, Collection<String> includeActivityTypes) Get the date of last activity regardless the current user's rights- Parameters:
projectName
- The project's nameincludeActivityTypes
- the types of activity to ignore from this search- Returns:
- the date of last activity or null if no activity found or an error occurred
-
getAllowedEventTypes
Get the list of allowed event types for the given projects- Parameters:
projects
- The projects- Returns:
- The allowed event types
-
getNumberOfUnreadActivitiesForCurrentUser
Get the number of unread events for the current user- Returns:
- the number of unread events or -1 if user never read events
-
getActivitiesForCurrentUser
Get the activities for the current user with the allowed event types get from the user projects.- Parameters:
limit
- The max number of results- Returns:
- The activities for the user projects
-
getActivitiesForCurrentUser
Get the activities for the current user with the allowed event types get from the given projects.- Parameters:
projects
- the projectslimit
- The max number of results- Returns:
- The activities for the user projects
-