com.atlassian.jira.user
Class SessionBasedAnonymousUserHistoryStore

java.lang.Object
  extended by com.atlassian.jira.user.SessionBasedAnonymousUserHistoryStore
All Implemented Interfaces:
UserHistoryStore

public class SessionBasedAnonymousUserHistoryStore
extends Object
implements UserHistoryStore

Session based caching implementation of UserHistoryStore. Allows anonymous users to have history.

Since:
v4.0

Constructor Summary
SessionBasedAnonymousUserHistoryStore(UserHistoryStore delegatingStore, ApplicationProperties applicationProperties, UserManager userManager, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 void addHistoryItem(ApplicationUser user, UserHistoryItem historyItem)
          Add a history item to the database.
 List<UserHistoryItem> getHistory(UserHistoryItem.Type type, ApplicationUser user)
          Retrieve the history for a given user/type.
 List<UserHistoryItem> getHistory(UserHistoryItem.Type type, String userKey)
          Retrieve the history for a given user/type.
 Set<UserHistoryItem.Type> removeHistoryForUser(ApplicationUser user)
          Remove all history items for a given user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionBasedAnonymousUserHistoryStore

public SessionBasedAnonymousUserHistoryStore(UserHistoryStore delegatingStore,
                                             ApplicationProperties applicationProperties,
                                             UserManager userManager,
                                             VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

addHistoryItem

public void addHistoryItem(ApplicationUser user,
                           @Nonnull
                           UserHistoryItem historyItem)
Description copied from interface: UserHistoryStore
Add a history item to the database. This removes the currently referred to entity (user, type, id) from the list and then adds it. If adding it causes the history items stored for that user/type to exceed the max (jira.max.history.items) items allowed, it should remove the oldest items.

Specified by:
addHistoryItem in interface UserHistoryStore
Parameters:
user - The user to store the history item against
historyItem - the item to store. Containing a timestamp and referenced entity

getHistory

@Nonnull
public List<UserHistoryItem> getHistory(@Nonnull
                                                UserHistoryItem.Type type,
                                                String userKey)
Description copied from interface: UserHistoryStore
Retrieve the history for a given user/type.

Specified by:
getHistory in interface UserHistoryStore
Parameters:
type - The type of entity to retrieve history for.
userKey - The key of the user to retrieve history for.
Returns:
a list containing all stored history items for the passed in user/type.

getHistory

@Nonnull
public List<UserHistoryItem> getHistory(@Nonnull
                                                UserHistoryItem.Type type,
                                                ApplicationUser user)
Description copied from interface: UserHistoryStore
Retrieve the history for a given user/type.

Specified by:
getHistory in interface UserHistoryStore
Parameters:
type - The type of entity to retrieve history for.
user - The user to retrieve history for.
Returns:
a list containing all stored history items for the passed in user/type.

removeHistoryForUser

public Set<UserHistoryItem.Type> removeHistoryForUser(@Nonnull
                                                      ApplicationUser user)
Description copied from interface: UserHistoryStore
Remove all history items for a given user.

Specified by:
removeHistoryForUser in interface UserHistoryStore
Parameters:
user - The user to remove all history of.
Returns:
The set of history types that were removed;


Copyright © 2002-2014 Atlassian. All Rights Reserved.