com.atlassian.greenhopper.service.issue.callback
Class AbstractColumnStatisticsCallback

java.lang.Object
  extended by com.atlassian.greenhopper.service.issue.callback.AbstractCompoundDataCallback
      extended by com.atlassian.greenhopper.service.issue.callback.AbstractColumnStatisticsCallback
All Implemented Interfaces:
IssueDataCallback, RapidIssueEntryCallbackComponent
Direct Known Subclasses:
IssueCountExcludingSubTasksStatisticsCallback, IssueCountStatisticsCallback, JiraFieldStatisticsCallback

public abstract class AbstractColumnStatisticsCallback
extends AbstractCompoundDataCallback
implements RapidIssueEntryCallbackComponent

Common parent class for callbacks which accumulate column constraint statistics. All column statistic callbacks accumulate values per column of a board.

See Also:
ColumnStatisticsCallbackFactory

Constructor Summary
AbstractColumnStatisticsCallback(java.util.Map<java.lang.String,Column> columnsByStatusId)
           
 
Method Summary
protected  void fieldData(java.lang.Long issueId, java.lang.String issueKey, IssueFieldValueProvider data)
          This callback is being called for every issue that matches the query.
 java.util.Set<java.lang.String> getFields()
          Get the lucene fields required by this component
protected abstract  java.lang.Double getStatisticsValue(java.lang.Long issueId, java.lang.String issueKey, IssueFieldValueProvider data)
          Compute the statistics value for this column constraint based on the document data.
 java.util.Map<Column,java.lang.Double> getStatisticsValuesByColumn()
           
 void processFieldData(java.lang.Long issueId, java.lang.String issueKey, IssueFieldValueProvider data, RapidIssueEntry entry)
          Implementing RapidIssueEntryCallbackComponent.processFieldData(Long, String, IssueFieldValueProvider, com.atlassian.greenhopper.web.rapid.list.RapidIssueEntry) so that we can store the column constraint statistic value for this issue against the RapidIssueEntry.
 
Methods inherited from class com.atlassian.greenhopper.service.issue.callback.AbstractCompoundDataCallback
fieldData, issueComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractColumnStatisticsCallback

public AbstractColumnStatisticsCallback(java.util.Map<java.lang.String,Column> columnsByStatusId)
Method Detail

getFields

public java.util.Set<java.lang.String> getFields()
Description copied from interface: RapidIssueEntryCallbackComponent
Get the lucene fields required by this component

Specified by:
getFields in interface IssueDataCallback
Specified by:
getFields in interface RapidIssueEntryCallbackComponent

fieldData

protected void fieldData(java.lang.Long issueId,
                         java.lang.String issueKey,
                         IssueFieldValueProvider data)
Description copied from class: AbstractCompoundDataCallback
This callback is being called for every issue that matches the query. For memory efficiency, try to avoid buffering all results in memory but rather stream them to the target object, like a REST template.

This is only called once per issue.

Specified by:
fieldData in class AbstractCompoundDataCallback
data - : The data from the document that matches our selected fields.

processFieldData

public void processFieldData(java.lang.Long issueId,
                             java.lang.String issueKey,
                             IssueFieldValueProvider data,
                             RapidIssueEntry entry)
Implementing RapidIssueEntryCallbackComponent.processFieldData(Long, String, IssueFieldValueProvider, com.atlassian.greenhopper.web.rapid.list.RapidIssueEntry) so that we can store the column constraint statistic value for this issue against the RapidIssueEntry.

Specified by:
processFieldData in interface RapidIssueEntryCallbackComponent
Parameters:
issueId - the issue ID
issueKey - the issue key
data - the data map for the document
entry - the entry to update

getStatisticsValue

@Nonnull
protected abstract java.lang.Double getStatisticsValue(java.lang.Long issueId,
                                                               java.lang.String issueKey,
                                                               IssueFieldValueProvider data)
Compute the statistics value for this column constraint based on the document data.

Parameters:
issueId - issue ID
issueKey - issue Key
data - all document data
Returns:
the value

getStatisticsValuesByColumn

public java.util.Map<Column,java.lang.Double> getStatisticsValuesByColumn()


Copyright © 2007-2013 Atlassian. All Rights Reserved.