com.atlassian.jira.user
Class SessionBasedAnonymousUserHistoryStore

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

public class SessionBasedAnonymousUserHistoryStore
extends java.lang.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, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 void addHistoryItem(com.opensymphony.user.User user, UserHistoryItem historyItem)
          Add a history item to the database.
 java.util.List<UserHistoryItem> getHistory(UserHistoryItem.Type type, com.opensymphony.user.User user)
          Retreive the history for a given user/type.
 VelocityRequestSession getSession()
           
 java.util.Set<UserHistoryItem.Type> removeHistoryForUser(com.opensymphony.user.User 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,
                                             VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

getSession

public VelocityRequestSession getSession()

addHistoryItem

public void addHistoryItem(@NotNull
                           com.opensymphony.user.User user,
                           @NotNull
                           UserHistoryItem historyItem)
Description copied from interface: UserHistoryStore
Add a history item to the database. This removes the currently refered 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

@NotNull
public java.util.List<UserHistoryItem> getHistory(UserHistoryItem.Type type,
                                                          com.opensymphony.user.User user)
Description copied from interface: UserHistoryStore
Retreive the history for a given user/type.

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

removeHistoryForUser

public java.util.Set<UserHistoryItem.Type> removeHistoryForUser(@NotNull
                                                                com.opensymphony.user.User 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-2010 Atlassian. All Rights Reserved.