Package com.atlassian.jira.user
Class DefaultUserHistoryManager
java.lang.Object
com.atlassian.jira.user.DefaultUserHistoryManager
- All Implemented Interfaces:
UserHistoryManager
Default implementation of the UserHistoryManager.
- Since:
- v4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemToHistory
(UserHistoryItem.Type type, ApplicationUser user, String entityId) Create and add anUserHistoryItem
to the Users history list.void
addItemToHistory
(UserHistoryItem.Type type, ApplicationUser user, String entityId, String data) Create and add anUserHistoryItem
to the Users history list.void
addUserToHistory
(UserHistoryItem.Type type, ApplicationUser user, ApplicationUser entity) Create and add anUserHistoryItem
to the Users history list.getHistory
(UserHistoryItem.Type type, ApplicationUser user) Retreive the user's history queue for the givenUserHistoryItem.Type
.boolean
hasHistory
(UserHistoryItem.Type type, ApplicationUser user) Determines whether a user has any items in their history for a givenUserHistoryItem.Type
This method performs no permission checks.void
Remove the user's history.
-
Constructor Details
-
DefaultUserHistoryManager
-
-
Method Details
-
addUserToHistory
public void addUserToHistory(UserHistoryItem.Type type, ApplicationUser user, ApplicationUser entity) Description copied from interface:UserHistoryManager
Create and add anUserHistoryItem
to the Users history list. A null users history should still be stored, even if only for duration of session.- Specified by:
addUserToHistory
in interfaceUserHistoryManager
- Parameters:
type
- The type queue to add the history item touser
- The user to add the history item toentity
- The entity to add to the history queue.
-
addItemToHistory
public void addItemToHistory(@Nonnull UserHistoryItem.Type type, @Nonnull ApplicationUser user, @Nonnull String entityId) Description copied from interface:UserHistoryManager
Create and add anUserHistoryItem
to the Users history list. A null users history should still be stored, even if only for duration of session.- Specified by:
addItemToHistory
in interfaceUserHistoryManager
- Parameters:
type
- The type queue to add the history item touser
- The user to add the history item toentityId
- The entity id of the entity to add to the history queue.
-
addItemToHistory
public void addItemToHistory(UserHistoryItem.Type type, ApplicationUser user, String entityId, String data) Description copied from interface:UserHistoryManager
Create and add anUserHistoryItem
to the Users history list. Allows to store data related to the user history item.- Specified by:
addItemToHistory
in interfaceUserHistoryManager
- Parameters:
type
- The type queue to add the history item touser
- The user to add the history item toentityId
- The entity id of the entity to add to the history queuedata
- Data related to the history item. Can be null.
-
hasHistory
Description copied from interface:UserHistoryManager
Determines whether a user has any items in their history for a givenUserHistoryItem.Type
This method performs no permission checks.- Specified by:
hasHistory
in interfaceUserHistoryManager
- Parameters:
type
- The type to check foruser
- The user to check for.- Returns:
- true if the user has any entities in their queue of the give type, false otherwise
-
getHistory
Description copied from interface:UserHistoryManager
Retreive the user's history queue for the givenUserHistoryItem.Type
. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks.- Specified by:
getHistory
in interfaceUserHistoryManager
- Parameters:
type
- The type of entity to get the history foruser
- The user to get the history items for.- Returns:
- a list of history items sort by desc lastViewed date.
-
removeHistoryForUser
Description copied from interface:UserHistoryManager
Remove the user's history.- Specified by:
removeHistoryForUser
in interfaceUserHistoryManager
- Parameters:
user
- The User to remove the history for.
-