Class DefaultChangeHistoryManager

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

public class DefaultChangeHistoryManager extends Object implements ChangeHistoryManager
  • Field Details

  • Constructor Details

  • Method Details

    • getChangeHistoryById

      @Nullable public ChangeHistory getChangeHistoryById(Long changeGroupId)
      Specified by:
      getChangeHistoryById in interface ChangeHistoryManager
      Returns:
      a ChangeHistory group with the given id, or null if not found
    • 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, ApplicationUser 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, ApplicationUser remoteUser)
      Description copied from interface: ChangeHistoryManager
      Returns a List of ChangeHistory entities for multiple issues. This method is much more efficient than #getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User) and should be preferred whenever possible.
      Specified by:
      getChangeHistoriesForUser in interface ChangeHistoryManager
      Parameters:
      issues - the issues.
      remoteUser - the user who is asking.
      Returns:
      a List of ChangeHistory entries.
    • getChangeHistoriesForUser

      public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser, Integer limit)
      Description copied from interface: ChangeHistoryManager
      Returns a List of ChangeHistory entities for multiple issues. This method is much more efficient than #getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User) and should be preferred whenever possible. Returns
      Specified by:
      getChangeHistoriesForUser in interface ChangeHistoryManager
      Parameters:
      issues - the issues.
      remoteUser - the user who is asking.
      limit - maximum amount of records to return
      Returns:
      a List of ChangeHistory entries in Ascending order by date and id
    • getChangeItemsWithFieldsForIssues

      public List<ChangeHistory> getChangeItemsWithFieldsForIssues(Iterable<Issue> issues, Iterable<String> fieldNames)
      Description copied from interface: ChangeHistoryManager
      Returns a List of ChangeHistory for the listed issues with changes only for the listed fields.
      Specified by:
      getChangeItemsWithFieldsForIssues in interface ChangeHistoryManager
      Parameters:
      issues - The list of issues to search
      fieldNames - The list of field names
      Returns:
      A list of changes.
    • getChangeItemsForField

      public List<ChangeItemBean> getChangeItemsForField(Issue issue, String changeItemFieldName)
      Description copied from interface: ChangeHistoryManager
      Returns a list of ChangeItemBean 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.
    • getChangeItemsForField

      @Nonnull public List<ChangeItemBean> getChangeItemsForField(@Nonnull Issue issue, String changeItemFieldName, @Nonnull Date since)
      Description copied from interface: ChangeHistoryManager
      Returns a list of ChangeItemBean for the given issue which also are for the provided changeItemFieldName (i.e. Link, Fix Version/s, etc) and the provided date since the changes have been created. The order of the list returned is 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.
      since - only change items created after this date will be returned, not null.
      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. Items in the returned list are ordered ascending by creation date any id.
      Specified by:
      getAllChangeItems in interface ChangeHistoryManager
      Parameters:
      issue - the issue
      Returns:
      A list containing all of the change items for a specific Issue
    • getPreviousIssueKeys

      public Collection<String> getPreviousIssueKeys(Long issueId)
    • findUserHistory

      public Collection<Issue> findUserHistory(ApplicationUser 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(ApplicationUser 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
    • findUserHistory

      public Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults, Date oldestUpdateTime)
      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
      oldestUpdateTime - issues updated prior to this time will not be included in the result
      Returns:
      An immutable collection 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