Class ActivityStreamClientInteraction

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.activities.activitystream.ActivityStreamClientInteraction
All Implemented Interfaces:
LogEnabled, Component, Serviceable

Component gathering methods for the activity stream service
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      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

      public ZonedDateTime getDateOfLastActivity(String projectName, List<String> excludeActivityTypes)
      Get the date of last activity regardless the current user's rights
      Parameters:
      projectName - The project's name
      excludeActivityTypes - 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 name
      includeActivityTypes - 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

      public Set<String> getAllowedEventTypes(Set<Project> projects)
      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

      public List<Map<String,Object>> getActivitiesForCurrentUser(Set<Project> projects, int limit)
      Get the activities for the current user with the allowed event types get from the given projects.
      Parameters:
      projects - the projects
      limit - The max number of results
      Returns:
      The activities for the user projects