com.atlassian.jira.issue.changehistory
Class DefaultChangeHistoryManager

java.lang.Object
  extended by com.atlassian.jira.issue.changehistory.DefaultChangeHistoryManager
All Implemented Interfaces:
ChangeHistoryManager

public class DefaultChangeHistoryManager
extends Object
implements ChangeHistoryManager


Constructor Summary
DefaultChangeHistoryManager(IssueManager issueManager, OfBizDelegator ofBizDelegator, PermissionManager permissionManager, ComponentLocator componentLocator, UserManager userManager)
           
 
Method Summary
 Map<String,String> findAllPossibleValues(String field)
          Deprecated. 
 Issue findMovedIssue(String originalKey)
          Returns an issue that has been moved by searching on the old issue key.
 Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults)
          Find a list of issues that the given users have acted on with the option to limit the projects included in the search.
 Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser, Collection<String> userkeys, int maxResults)
          Find a list of issues that the given users have acted on.
 List<ChangeHistoryItem> getAllChangeItems(Issue issue)
          Returns a List of ChangeHistoryItem's for the given issue
 List<ChangeHistory> getChangeHistories(Issue issue)
          Returns a List of ChangeHistory entities
 List<ChangeHistory> getChangeHistoriesForUser(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a List of ChangeHistory entities for a single issue.
 List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a List of ChangeHistory entities for multiple issues.
 List<ChangeHistory> getChangeHistoriesSince(Issue issue, Date since)
          Returns a List of ChangeHistory entities that occurred after the provided date.
 List<ChangeItemBean> getChangeItemsForField(Issue issue, String changeItemFieldName)
          Returns a List of ChangeItemBean's for the given issue which also are for the provided changeItemFieldName (i.e.
 Collection<String> getPreviousIssueKeys(Long issueId)
          Returns the same as ChangeHistoryManager.getPreviousIssueKeys(String) but is slightly more efficient since no lookup of the issue id needs to be performed.
 Collection<String> getPreviousIssueKeys(String issueKey)
          Given an issue key, this method returns a list of previous issue keys this issue was moved from.
 void removeAllChangeItems(Issue issue)
          Remove all change items associated with an issue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChangeHistoryManager

public DefaultChangeHistoryManager(IssueManager issueManager,
                                   OfBizDelegator ofBizDelegator,
                                   PermissionManager permissionManager,
                                   ComponentLocator componentLocator,
                                   UserManager userManager)
Method Detail

getChangeHistories

public List<ChangeHistory> getChangeHistories(Issue issue)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeHistory entities

Specified by:
getChangeHistories in interface ChangeHistoryManager
Parameters:
issue - the issue.
Returns:
a List of ChangeHistory entries.

getChangeHistoriesSince

@Nonnull
public List<ChangeHistory> getChangeHistoriesSince(@Nonnull
                                                           Issue issue,
                                                           @Nonnull
                                                           Date since)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeHistory entities that occurred after the provided date.

Specified by:
getChangeHistoriesSince in interface ChangeHistoryManager
Parameters:
issue - the issue. Must not be null.
since - only change histories made after this date will be returned. Must not be null.
Returns:
a possibly empty List of ChangeHistory entries made after the provided date. Will not be null.

getChangeHistoriesForUser

public List<ChangeHistory> getChangeHistoriesForUser(Issue issue,
                                                     com.atlassian.crowd.embedded.api.User remoteUser)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeHistory entities for a single issue.

Specified by:
getChangeHistoriesForUser in interface ChangeHistoryManager
Parameters:
issue - the issue.
remoteUser - the user who is asking.
Returns:
a List of ChangeHistory entries.
See Also:
for a more efficient way to read change histories for multiple issues

getChangeHistoriesForUser

public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues,
                                                     com.atlassian.crowd.embedded.api.User remoteUser)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeHistory entities for multiple issues. This method is much more efficient than ChangeHistoryManager.getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User) and should be prefered whenever possible.

Specified by:
getChangeHistoriesForUser in interface ChangeHistoryManager
Parameters:
issues - the issues.
remoteUser - the user who is asking.
Returns:
a List of ChangeHistory entries.

getChangeItemsForField

public List<ChangeItemBean> getChangeItemsForField(Issue issue,
                                                   String changeItemFieldName)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeItemBean's for the given issue which also are for the provided changeItemFieldName (i.e. Link, Fix Version/s, etc). The order of the list will from oldest to newest.

Specified by:
getChangeItemsForField in interface ChangeHistoryManager
Parameters:
issue - the issue the change items are associated with, not null.
changeItemFieldName - the field name the change item is stored under, not null or empty.
Returns:
a List of ChangeItemBean's for the given issue.

getAllChangeItems

public List<ChangeHistoryItem> getAllChangeItems(Issue issue)
Description copied from interface: ChangeHistoryManager
Returns a List of ChangeHistoryItem's for the given issue

Specified by:
getAllChangeItems in interface ChangeHistoryManager
Parameters:
issue - the issue
Returns:
A list containing all of the change items for a specific Issue

findMovedIssue

public Issue findMovedIssue(String originalKey)
Description copied from interface: ChangeHistoryManager
Returns an issue that has been moved by searching on the old issue key.

Specified by:
findMovedIssue in interface ChangeHistoryManager
Parameters:
originalKey - the original key of an issue that has since been moved (moving between projects assigns a new key to an issue)
Returns:
the moved Issue object

getPreviousIssueKeys

public Collection<String> getPreviousIssueKeys(Long issueId)
Description copied from interface: ChangeHistoryManager
Returns the same as ChangeHistoryManager.getPreviousIssueKeys(String) but is slightly more efficient since no lookup of the issue id needs to be performed. If you have an issue object available with the issue's id use this method.

Specified by:
getPreviousIssueKeys in interface ChangeHistoryManager
Parameters:
issueId - The id of the issue being looked up.
Returns:
A collection of previous issue keys or an empty list if none exist.

getPreviousIssueKeys

public Collection<String> getPreviousIssueKeys(String issueKey)
Description copied from interface: ChangeHistoryManager
Given an issue key, this method returns a list of previous issue keys this issue was moved from. This may be useful for source control plugins for example, where a given changeset should be displayed even after an issue has been moved and it's issue key has changed.

Note: The list of previous issue keys is no longer returned in chronological order.

Specified by:
getPreviousIssueKeys in interface ChangeHistoryManager
Parameters:
issueKey - The current issue key.
Returns:
A collection of previous issue keys or an empty list if none exist.

findUserHistory

public Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser,
                                         Collection<String> userkeys,
                                         int maxResults)
Description copied from interface: ChangeHistoryManager
Find a list of issues that the given users have acted on.

Specified by:
findUserHistory in interface ChangeHistoryManager
Parameters:
remoteUser - The user executing this request.
userkeys - The keys of users to find the history for. If null, returns the history for all users. If empty, no results will be found.
maxResults - The maxmimum number of issues to return
Returns:
An immutable collection of issue objects sorted by creation date in descending order

findUserHistory

public Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser,
                                         Collection<String> userkeys,
                                         Collection<Project> projects,
                                         int maxResults)
Description copied from interface: ChangeHistoryManager
Find a list of issues that the given users have acted on with the option to limit the projects included in the search.

Specified by:
findUserHistory in interface ChangeHistoryManager
Parameters:
remoteUser - The user executing this request.
userkeys - The keys of users to find the history for. If null, returns the history for all users. If empty, no results will be found.
projects - The projects to include issues from
maxResults - The maxmimum number of issues to return
Returns:
An immutable collection of issue objects sorted by creation date in descending order

findAllPossibleValues

@Deprecated
public Map<String,String> findAllPossibleValues(String field)
Deprecated. 

Description copied from interface: ChangeHistoryManager
Find a map of all names ever used in the change history.

Specified by:
findAllPossibleValues in interface ChangeHistoryManager
Parameters:
field - The field name.
Returns:
An immutable map of issue objects sorted by creation date in descending order

removeAllChangeItems

public void removeAllChangeItems(Issue issue)
Description copied from interface: ChangeHistoryManager
Remove all change items associated with an issue.

Specified by:
removeAllChangeItems in interface ChangeHistoryManager
Parameters:
issue - affected issue


Copyright © 2002-2014 Atlassian. All Rights Reserved.