Class DaysInColumnCallback

java.lang.Object
com.atlassian.greenhopper.service.charts.AbstractIssueHistoryStatusCallback
com.atlassian.greenhopper.web.rapid.list.DaysInColumnCallback
All Implemented Interfaces:
ChangeHistoryCallback<com.atlassian.jira.issue.status.Status>, IssueStatusHistoryCallback

public class DaysInColumnCallback extends AbstractIssueHistoryStatusCallback
Collector to find out the total time an issue spent in the column it's currently in. The idea works like this: The query defines which issues we're looking into. We're sending that off to the history index, and collect the change history for every status. Then we aggregate the time spent per issue and fill it into the REST template.
Author:
ahennecke
  • Field Summary

    Fields inherited from class com.atlassian.greenhopper.service.charts.AbstractIssueHistoryStatusCallback

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    DaysInColumnCallback(Map<Long,RapidIssueEntry> issues, Map<com.atlassian.jira.issue.status.Status,Column> columnsByStatus, List<com.atlassian.jira.issue.status.Status> statuses, com.atlassian.jira.config.ConstantsManager constantsManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    after(com.atlassian.jira.issue.status.Status status)
    We're done with one status, all changes to and from have been collected.
    void
    changedFrom(Long issueId, String issueKey, org.joda.time.DateTime changeTime, com.atlassian.jira.issue.status.Status changedFromStatus)
    Pick up changes from a status that's in the same column like the current issue status.
    void
    changedTo(Long issueId, String issueKey, org.joda.time.DateTime changeTime, com.atlassian.jira.issue.status.Status changedToStatus)
    Same like above, but for changes into the column
    Collection<com.atlassian.jira.issue.status.Status>
     

    Methods inherited from class com.atlassian.greenhopper.service.charts.AbstractIssueHistoryStatusCallback

    before

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DaysInColumnCallback

      public DaysInColumnCallback(Map<Long,RapidIssueEntry> issues, Map<com.atlassian.jira.issue.status.Status,Column> columnsByStatus, List<com.atlassian.jira.issue.status.Status> statuses, com.atlassian.jira.config.ConstantsManager constantsManager)
  • Method Details

    • getStatuses

      public Collection<com.atlassian.jira.issue.status.Status> getStatuses()
      Returns:
      The statuses to query for. Callbacks will be for each status in the collection, for all issues according to getQuery(), in the order of the collection.
    • changedFrom

      public void changedFrom(Long issueId, String issueKey, org.joda.time.DateTime changeTime, com.atlassian.jira.issue.status.Status changedFromStatus)
      Pick up changes from a status that's in the same column like the current issue status. These are the only ones we're interested in, all other status changes just get ignored. We only want to know how long the issue has been in the _current_ column.
      Specified by:
      changedFrom in interface ChangeHistoryCallback<com.atlassian.jira.issue.status.Status>
      Overrides:
      changedFrom in class AbstractIssueHistoryStatusCallback
      changeTime - : time when the change was performed, in UTC
      changedFromStatus - : the old value the issue has changed from (e.g. old status or version ID)
    • changedTo

      public void changedTo(Long issueId, String issueKey, org.joda.time.DateTime changeTime, com.atlassian.jira.issue.status.Status changedToStatus)
      Same like above, but for changes into the column
      Specified by:
      changedTo in interface ChangeHistoryCallback<com.atlassian.jira.issue.status.Status>
      Overrides:
      changedTo in class AbstractIssueHistoryStatusCallback
      changeTime - : time when the change was performed, in UTC
      changedToStatus - : the new value (e.g. Status or fix version ID) the issue has changed to
    • after

      public void after(com.atlassian.jira.issue.status.Status status)
      We're done with one status, all changes to and from have been collected. Now we want "time in column", not "time in status", but that's just an additive. Basically, we only have collected data that relates to the current column, which makes things a little easier.
      Specified by:
      after in interface ChangeHistoryCallback<com.atlassian.jira.issue.status.Status>
      Overrides:
      after in class AbstractIssueHistoryStatusCallback