com.atlassian.jira.user
Class DefaultUserHistoryManager

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

@ThreadSafe
public class DefaultUserHistoryManager
extends Object
implements UserHistoryManager

Default implementation of the UserHistoryManager.

Since:
v4.0

Constructor Summary
DefaultUserHistoryManager(UserHistoryStore store)
           
 
Method Summary
 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)
           
 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, 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(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

DefaultUserHistoryManager

public DefaultUserHistoryManager(@NotNull
                                 UserHistoryStore store)
Method Detail

addItemToHistory

public void addItemToHistory(@NotNull
                             UserHistoryItem.Type type,
                             @NotNull
                             com.atlassian.crowd.embedded.api.User user,
                             @NotNull
                             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(@NotNull
                             UserHistoryItem.Type type,
                             @Nullable
                             com.atlassian.crowd.embedded.api.User user,
                             @NotNull
                             String entityId,
                             @Nullable
                             String data)
Specified by:
addItemToHistory in interface UserHistoryManager

hasHistory

public boolean hasHistory(@NotNull
                          UserHistoryItem.Type type,
                          @NotNull
                          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

getHistory

@NotNull
public List<UserHistoryItem> getHistory(@NotNull
                                                UserHistoryItem.Type type,
                                                @Nullable
                                                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.

removeHistoryForUser

public void removeHistoryForUser(@NotNull
                                 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.


Copyright © 2002-2012 Atlassian. All Rights Reserved.