@ThreadSafe public class OfBizUserHistoryStore extends Object implements UserHistoryStore
UserHistoryStore
Constructor and Description |
---|
OfBizUserHistoryStore(OfBizDelegator delegator,
ApplicationProperties applicationProperties) |
Modifier and Type | Method and Description |
---|---|
void |
addHistoryItem(ApplicationUser user,
UserHistoryItem item)
Add a history item to the database.
|
void |
addHistoryItemNoChecks(ApplicationUser user,
UserHistoryItem item)
Optimised method for adding a history item.
|
void |
expireOldHistoryItems(ApplicationUser user,
UserHistoryItem.Type type,
Collection<String> entityIds)
Method for expiring old items.
|
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.
|
void |
removeHistoryOlderThan(Long timestamp)
Method for removing old user history items.
|
void |
updateHistoryItemNoChecks(ApplicationUser user,
UserHistoryItem item)
Optimised method for updating a record in the database.
|
public OfBizUserHistoryStore(OfBizDelegator delegator, ApplicationProperties applicationProperties)
public void addHistoryItem(ApplicationUser user, @Nonnull UserHistoryItem item)
UserHistoryStore
addHistoryItem
in interface UserHistoryStore
user
- The user to store the history item againstitem
- the item to store. Containing a timestamp and referenced entitypublic void addHistoryItemNoChecks(@Nonnull ApplicationUser user, @Nonnull UserHistoryItem item)
This does not expire old items or try and update existing items. It is dumb.
user
- The user to insert the record foritem
- Teh item to insert into the dbpublic void updateHistoryItemNoChecks(@Nonnull ApplicationUser user, @Nonnull UserHistoryItem item)
This does not expire old items or try and update existing items. It is dumb.
user
- The user to update the record foritem
- The item to updatepublic void expireOldHistoryItems(@Nonnull ApplicationUser user, @Nonnull UserHistoryItem.Type type, Collection<String> entityIds)
user
- The user to remove entries fortype
- The type of record to removeentityIds
- The list of entity ids to remove.@Nonnull public List<UserHistoryItem> getHistory(@Nonnull UserHistoryItem.Type type, @Nonnull String userKey)
UserHistoryStore
getHistory
in interface UserHistoryStore
type
- The type of entity to retrieve history for.userKey
- The key of the user to retrieve history for.@Nonnull public List<UserHistoryItem> getHistory(@Nonnull UserHistoryItem.Type type, @Nonnull ApplicationUser user)
UserHistoryStore
getHistory
in interface UserHistoryStore
type
- The type of entity to retrieve history for.user
- The user to retrieve history for.public Set<UserHistoryItem.Type> removeHistoryForUser(@Nonnull ApplicationUser user)
UserHistoryStore
removeHistoryForUser
in interface UserHistoryStore
user
- The user to remove all history of.public void removeHistoryOlderThan(@Nonnull Long timestamp)
UserHistoryStore
removeHistoryOlderThan
in interface UserHistoryStore
timestamp
- remove elements older than this timestampCopyright © 2002-2015 Atlassian. All Rights Reserved.