@ThreadSafe public class

DefaultUserHistoryManager

extends Object
implements UserHistoryManager
java.lang.Object
   ↳ com.atlassian.jira.user.DefaultUserHistoryManager

Class Overview

Default implementation of the UserHistoryManager.

Summary

Public Constructors
DefaultUserHistoryManager(UserHistoryStore store)
Public Methods
void addItemToHistory(UserHistoryItem.Type type, ApplicationUser user, String entityId, String data)
Create and add an UserHistoryItem to the Users history list.
void addItemToHistory(UserHistoryItem.Type type, ApplicationUser user, String entityId)
Create and add an UserHistoryItem to the Users history list.
void addUserToHistory(UserHistoryItem.Type type, ApplicationUser user, ApplicationUser entity)
Create and add an UserHistoryItem to the Users history list.
List<UserHistoryItem> getHistory(UserHistoryItem.Type type, ApplicationUser user)
Retreive the user's history queue for the given UserHistoryItem.Type.
boolean hasHistory(UserHistoryItem.Type type, ApplicationUser user)
Determines whether a user has any items in their history for a given UserHistoryItem.Type This method performs no permission checks.
void removeHistoryForUser(ApplicationUser user)
Remove the user's history.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.user.UserHistoryManager

Public Constructors

public DefaultUserHistoryManager (UserHistoryStore store)

Public Methods

public void addItemToHistory (UserHistoryItem.Type type, ApplicationUser user, String entityId, String data)

Create and add an UserHistoryItem to the Users history list. Allows to store data related to the user history item.

Parameters
type The type queue to add the history item to
user The user to add the history item to
entityId The entity id of the entity to add to the history queue
data Data related to the history item. Can be null.

public void addItemToHistory (UserHistoryItem.Type type, ApplicationUser user, String entityId)

Create and add an UserHistoryItem to the Users history list. A null users history should still be stored, even if only for duration of session.

Parameters
type The type queue to add the history item to
user The user to add the history item to
entityId The entity id of the entity to add to the history queue.

public void addUserToHistory (UserHistoryItem.Type type, ApplicationUser user, ApplicationUser entity)

Create and add an UserHistoryItem to the Users history list. A null users history should still be stored, even if only for duration of session.

Parameters
type The type queue to add the history item to
user The user to add the history item to
entity The entity to add to the history queue.

public List<UserHistoryItem> getHistory (UserHistoryItem.Type type, ApplicationUser user)

Retreive the user's history queue for the given UserHistoryItem.Type. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks.

Parameters
type The type of entity to get the history for
user The user to get the history items for.
Returns
  • a list of history items sort by desc lastViewed date.

public boolean hasHistory (UserHistoryItem.Type type, ApplicationUser user)

Determines whether a user has any items in their history for a given UserHistoryItem.Type This method performs no permission checks.

Parameters
type The type to check for
user The user to check for.
Returns
  • true if the user has any entities in their queue of the give type, false otherwise

public void removeHistoryForUser (ApplicationUser user)

Remove the user's history.

Parameters
user The User to remove the history for.