public class MockUserHistoryManager extends Object implements UserHistoryManager
Constructor and Description |
---|
MockUserHistoryManager() |
MockUserHistoryManager(List<UserHistoryItem> userHistoryItems) |
Modifier and Type | Method and Description |
---|---|
void |
addItemToHistory(UserHistoryItem.Type type,
ApplicationUser user,
String entityId)
Create and add an
UserHistoryItem to the Users history list. |
void |
addItemToHistory(UserHistoryItem.Type type,
ApplicationUser user,
String entityId,
String data)
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<String> |
getAddedUsers() |
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.
|
public MockUserHistoryManager()
public MockUserHistoryManager(List<UserHistoryItem> userHistoryItems)
public void addUserToHistory(UserHistoryItem.Type type, ApplicationUser user, ApplicationUser entity)
UserHistoryManager
UserHistoryItem
to the Users history list.
A null users history should still be stored, even if only for duration of session.addUserToHistory
in interface UserHistoryManager
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.public void addItemToHistory(UserHistoryItem.Type type, ApplicationUser user, String entityId)
UserHistoryManager
UserHistoryItem
to the Users history list.
A null users history should still be stored, even if only for duration of session.addItemToHistory
in interface UserHistoryManager
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.public void addItemToHistory(UserHistoryItem.Type type, ApplicationUser user, String entityId, String data)
UserHistoryManager
UserHistoryItem
to the Users history list.
Allows to store data related to the user history item.addItemToHistory
in interface UserHistoryManager
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.public boolean hasHistory(UserHistoryItem.Type type, ApplicationUser user)
UserHistoryManager
UserHistoryItem.Type
This method performs no permission checks.hasHistory
in interface UserHistoryManager
type
- The type to check foruser
- The user to check for.public List<UserHistoryItem> getHistory(UserHistoryItem.Type type, ApplicationUser user)
UserHistoryManager
UserHistoryItem.Type
.
The list is returned ordered by DESC lastViewed date (i.e. newest is first).
This method performs no permission checks.getHistory
in interface UserHistoryManager
type
- The type of entity to get the history foruser
- The user to get the history items for.public void removeHistoryForUser(@Nonnull ApplicationUser user)
UserHistoryManager
removeHistoryForUser
in interface UserHistoryManager
user
- The User to remove the history for.Copyright © 2002-2019 Atlassian. All Rights Reserved.