com.atlassian.greenhopper.service.rapid.view.statistics
Class EstimateStatisticServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.rapid.view.statistics.EstimateStatisticServiceImpl
All Implemented Interfaces:
EstimateStatisticService

@Service
public class EstimateStatisticServiceImpl
extends java.lang.Object
implements EstimateStatisticService

Implementation of EstimateStatisticService. Similar to StatisticsFieldServiceImpl.

Since:
v5.9.5

Field Summary
static java.lang.String ISSUE_COUNT_NAME_KEY
           
static java.lang.String NONE_NAME_KEY
           
 
Fields inherited from interface com.atlassian.greenhopper.service.rapid.view.statistics.EstimateStatisticService
ORIGINAL_ESTIMATE_FIELD_ID
 
Constructor Summary
EstimateStatisticServiceImpl()
           
 
Method Summary
 java.util.List<StatisticsField> getAvailableEstimateStatistics()
          Returns the list of StatisticsFields which represent the available StatisticsFieldConfigs.
 StatisticsField getEstimateStatistic(RapidView rapidView)
          Will always return a StatisticsField, which may or may not be valid.
 ServiceOutcome<StatisticsField> getEstimateStatisticStrict(RapidView rapidView)
          Attempts to get the StatisticsField of a rapid view.
 ServiceOutcome<StatisticsField> getInstanceOf(StatisticsFieldConfig config)
           
 StatisticsField getInvalidEstimateStatistic(RapidView rapidView)
          Returns a StatisticsField instance which represents an invalid StatisticsFieldConfig.
 boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic, com.atlassian.jira.issue.Issue issue)
          Is the StatisticsField field based but not applicable for the given issue? (Due to Custom Field configuration contexts, for example.)
 boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic, java.lang.Long projectId, java.lang.String issueTypeId)
          Is the StatisticsField field based but not applicable for the given project and issue type? (Due to Custom Field configuration contexts, for example.)
 boolean isEstimateStatisticValidAndEnabled(StatisticsField estimateStatistic)
          Is the StatisticsField valid and enabled (i.e.
 ServiceOutcome<java.lang.Void> updateEstimateStatistic(com.atlassian.crowd.embedded.api.User user, RapidView rapidView, StatisticsFieldConfig estimateStatistic)
          Updates the specified rapid view to a new configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISSUE_COUNT_NAME_KEY

public static final java.lang.String ISSUE_COUNT_NAME_KEY
See Also:
Constant Field Values

NONE_NAME_KEY

public static final java.lang.String NONE_NAME_KEY
See Also:
Constant Field Values
Constructor Detail

EstimateStatisticServiceImpl

public EstimateStatisticServiceImpl()
Method Detail

getAvailableEstimateStatistics

public java.util.List<StatisticsField> getAvailableEstimateStatistics()
Returns the list of StatisticsFields which represent the available StatisticsFieldConfigs.

Specified by:
getAvailableEstimateStatistics in interface EstimateStatisticService
Returns:
the list.
See Also:
getAvailableConfigs()

updateEstimateStatistic

public ServiceOutcome<java.lang.Void> updateEstimateStatistic(com.atlassian.crowd.embedded.api.User user,
                                                              RapidView rapidView,
                                                              StatisticsFieldConfig estimateStatistic)
Description copied from interface: EstimateStatisticService
Updates the specified rapid view to a new configuration.

Specified by:
updateEstimateStatistic in interface EstimateStatisticService
Parameters:
user - the user
rapidView - the rapid view
estimateStatistic - the new configuration
Returns:
the outcome; possibly with errors

getEstimateStatisticStrict

public ServiceOutcome<StatisticsField> getEstimateStatisticStrict(RapidView rapidView)
Description copied from interface: EstimateStatisticService
Attempts to get the StatisticsField of a rapid view. Outcome will contain errors if the configured estimate statistic is invalid. You may wish to call EstimateStatisticService.getInvalidEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView) in that case.

If you just want either the valid or invalid StatisticsField to be returned, call EstimateStatisticService.getEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView).

Specified by:
getEstimateStatisticStrict in interface EstimateStatisticService
Parameters:
rapidView - the rapid view
Returns:
strict outcome of valid statistics field; or errors
See Also:
EstimateStatisticService.getInvalidEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView), EstimateStatisticService.getEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView)

getEstimateStatistic

public StatisticsField getEstimateStatistic(RapidView rapidView)
Description copied from interface: EstimateStatisticService
Will always return a StatisticsField, which may or may not be valid.

Specified by:
getEstimateStatistic in interface EstimateStatisticService
Parameters:
rapidView - the rapid view
Returns:
the statistic field

getInvalidEstimateStatistic

public StatisticsField getInvalidEstimateStatistic(RapidView rapidView)
Description copied from interface: EstimateStatisticService
Returns a StatisticsField instance which represents an invalid StatisticsFieldConfig. This only really makes sense to call if you have previously called EstimateStatisticService.getEstimateStatisticStrict(com.atlassian.greenhopper.model.rapid.RapidView) and were returned errors.

Specified by:
getInvalidEstimateStatistic in interface EstimateStatisticService
Parameters:
rapidView - the rapid view
Returns:
the invalid instance representing the configuration

getInstanceOf

@NotNull
public ServiceOutcome<StatisticsField> getInstanceOf(StatisticsFieldConfig config)

isEstimateStatisticFieldAndNotApplicable

public boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic,
                                                        com.atlassian.jira.issue.Issue issue)
Description copied from interface: EstimateStatisticService
Is the StatisticsField field based but not applicable for the given issue? (Due to Custom Field configuration contexts, for example.)

Specified by:
isEstimateStatisticFieldAndNotApplicable in interface EstimateStatisticService
Parameters:
estimateStatistic - the estimate statistic
issue - the issue
Returns:
the result
See Also:
EstimateStatisticService.isEstimateStatisticFieldAndNotApplicable(com.atlassian.greenhopper.model.rapid.StatisticsField, Long, String)

isEstimateStatisticFieldAndNotApplicable

public boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic,
                                                        java.lang.Long projectId,
                                                        java.lang.String issueTypeId)
Description copied from interface: EstimateStatisticService
Is the StatisticsField field based but not applicable for the given project and issue type? (Due to Custom Field configuration contexts, for example.)

Specified by:
isEstimateStatisticFieldAndNotApplicable in interface EstimateStatisticService
Parameters:
estimateStatistic - the estimate statistic
projectId - the ID of the project
issueTypeId - the ID of the issue type
Returns:
the result
See Also:
EstimateStatisticService.isEstimateStatisticFieldAndNotApplicable(StatisticsField, Issue)

isEstimateStatisticValidAndEnabled

public boolean isEstimateStatisticValidAndEnabled(StatisticsField estimateStatistic)
Description copied from interface: EstimateStatisticService
Is the StatisticsField valid and enabled (i.e. should it take part in accumulating statistics over issues)?

Specified by:
isEstimateStatisticValidAndEnabled in interface EstimateStatisticService
Parameters:
estimateStatistic - the estimate statistic
Returns:
the result
See Also:
StatisticsField.isValid(), StatisticsField.isEnabled()


Copyright © 2007-2012 Atlassian. All Rights Reserved.