com.atlassian.jira.mock.user
Class MockUserHistoryManager

java.lang.Object
  extended by com.atlassian.jira.mock.user.MockUserHistoryManager
All Implemented Interfaces:
UserHistoryManager

public class MockUserHistoryManager
extends Object
implements UserHistoryManager

Since:
v4.4

Constructor Summary
MockUserHistoryManager()
           
MockUserHistoryManager(List<UserHistoryItem> userHistoryItems)
           
 
Method Summary
 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 addItemToHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User user, String entityId)
          Create and add an UserHistoryItem to the Users history list.
 void addItemToHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User 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.
 void addUserToHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.User 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.
 List<UserHistoryItem> getHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User 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.
 boolean hasHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User 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.
 void removeHistoryForUser(com.atlassian.crowd.embedded.api.User user)
          Remove the user's history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockUserHistoryManager

public MockUserHistoryManager()

MockUserHistoryManager

public MockUserHistoryManager(List<UserHistoryItem> userHistoryItems)
Method Detail

addUserToHistory

public void addUserToHistory(UserHistoryItem.Type type,
                             com.atlassian.crowd.embedded.api.User user,
                             com.atlassian.crowd.embedded.api.User entity)
Description copied from interface: UserHistoryManager
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.

Specified by:
addUserToHistory in interface UserHistoryManager
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.

addUserToHistory

public void addUserToHistory(UserHistoryItem.Type type,
                             ApplicationUser user,
                             ApplicationUser entity)
Description copied from interface: UserHistoryManager
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.

Specified by:
addUserToHistory in interface UserHistoryManager
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.

addItemToHistory

public void addItemToHistory(UserHistoryItem.Type type,
                             com.atlassian.crowd.embedded.api.User user,
                             String entityId)
Description copied from interface: UserHistoryManager
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.

Specified by:
addItemToHistory in interface UserHistoryManager
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.

addItemToHistory

public void addItemToHistory(UserHistoryItem.Type type,
                             ApplicationUser user,
                             String entityId)
Description copied from interface: UserHistoryManager
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.

Specified by:
addItemToHistory in interface UserHistoryManager
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.

addItemToHistory

public void addItemToHistory(UserHistoryItem.Type type,
                             com.atlassian.crowd.embedded.api.User user,
                             String entityId,
                             String data)
Description copied from interface: UserHistoryManager
Create and add an UserHistoryItem to the Users history list. Allows to store data related to the user history item.

Specified by:
addItemToHistory in interface UserHistoryManager
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.

addItemToHistory

public void addItemToHistory(UserHistoryItem.Type type,
                             ApplicationUser user,
                             String entityId,
                             String data)
Description copied from interface: UserHistoryManager
Create and add an UserHistoryItem to the Users history list. Allows to store data related to the user history item.

Specified by:
addItemToHistory in interface UserHistoryManager
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.

hasHistory

public boolean hasHistory(UserHistoryItem.Type type,
                          com.atlassian.crowd.embedded.api.User user)
Description copied from interface: UserHistoryManager
Determines whether a user has any items in their history for a given UserHistoryItem.Type This method performs no permission checks.

Specified by:
hasHistory in interface UserHistoryManager
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

hasHistory

public boolean hasHistory(UserHistoryItem.Type type,
                          ApplicationUser user)
Description copied from interface: UserHistoryManager
Determines whether a user has any items in their history for a given UserHistoryItem.Type This method performs no permission checks.

Specified by:
hasHistory in interface UserHistoryManager
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

getHistory

public List<UserHistoryItem> getHistory(UserHistoryItem.Type type,
                                        com.atlassian.crowd.embedded.api.User user)
Description copied from interface: UserHistoryManager
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.

Specified by:
getHistory in interface UserHistoryManager
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.

getHistory

public List<UserHistoryItem> getHistory(UserHistoryItem.Type type,
                                        ApplicationUser user)
Description copied from interface: UserHistoryManager
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.

Specified by:
getHistory in interface UserHistoryManager
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.

removeHistoryForUser

public void removeHistoryForUser(@Nonnull
                                 com.atlassian.crowd.embedded.api.User user)
Description copied from interface: UserHistoryManager
Remove the user's history.

Specified by:
removeHistoryForUser in interface UserHistoryManager
Parameters:
user - The User to remove the history for.

removeHistoryForUser

public void removeHistoryForUser(@Nonnull
                                 ApplicationUser user)
Description copied from interface: UserHistoryManager
Remove the user's history.

Specified by:
removeHistoryForUser in interface UserHistoryManager
Parameters:
user - The User to remove the history for.

getAddedUsers

public List<String> getAddedUsers()


Copyright © 2002-2014 Atlassian. All Rights Reserved.