com.atlassian.jira.user
Interface UserHistoryStore

All Known Implementing Classes:
CachingUserHistoryStore, OfBizUserHistoryStore, SessionBasedAnonymousUserHistoryStore

public interface UserHistoryStore

Store interface for UserHistoryItem objects.

Since:
v4.0

Method Summary
 void addHistoryItem(com.atlassian.crowd.embedded.api.User user, UserHistoryItem historyItem)
          Add a history item to the database.
 List<UserHistoryItem> getHistory(UserHistoryItem.Type type, com.atlassian.crowd.embedded.api.User user)
          Retreive the history for a given user/type.
 Set<UserHistoryItem.Type> removeHistoryForUser(com.atlassian.crowd.embedded.api.User user)
          Remove all history items for a given user.
 

Method Detail

addHistoryItem

void addHistoryItem(@Nullable
                    com.atlassian.crowd.embedded.api.User user,
                    @NotNull
                    UserHistoryItem historyItem)
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.

Parameters:
user - The user to store the history item against
historyItem - the item to store. Containing a timestamp and referenced entity

getHistory

@NotNull
List<UserHistoryItem> getHistory(@NotNull
                                         UserHistoryItem.Type type,
                                         @NotNull
                                         com.atlassian.crowd.embedded.api.User user)
Retreive the history for a given user/type.

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

Set<UserHistoryItem.Type> removeHistoryForUser(@NotNull
                                               com.atlassian.crowd.embedded.api.User user)
Remove all history items for a given user.

Parameters:
user - The user to remove all history of.
Returns:
The set of history types that were removed;


Copyright © 2002-2012 Atlassian. All Rights Reserved.