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

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

@Service
public class TrackingStatisticServiceImpl
extends java.lang.Object
implements TrackingStatisticService

Implementation of TrackingStatisticService. Similar to EstimateStatisticServiceImpl.

Since:
v5.9.8

Field Summary
static java.lang.String NONE_NAME_KEY
           
 
Fields inherited from interface com.atlassian.greenhopper.service.rapid.view.statistics.TrackingStatisticService
REMAINING_ESTIMATE_FIELD_ID
 
Constructor Summary
TrackingStatisticServiceImpl()
           
 
Method Summary
 java.util.List<StatisticsField> getAvailableTrackingStatistics()
          Returns the list of StatisticsFields which represent the available StatisticsFieldConfigs.
 ServiceOutcome<StatisticsField> getInstanceOf(StatisticsFieldConfig config)
           
 StatisticsField getInvalidTrackingStatistic(RapidView rapidView)
          Returns a StatisticsField instance which represents an invalid StatisticsFieldConfig.
 StatisticsField getTrackingStatistic(RapidView rapidView)
          Will always return a StatisticsField, which may or may not be valid.
 ServiceOutcome<StatisticsField> getTrackingStatisticStrict(RapidView rapidView)
          Attempts to get the StatisticsField of a rapid view.
 boolean isRemainingEstimateStatisticsField(StatisticsField statisticsField)
          Is the passed StatisticsField of type remaining estimate?
 boolean isTrackingStatisticFieldAndNotApplicable(StatisticsField trackingStatistic, 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 isTrackingStatisticFieldAndNotApplicable(StatisticsField trackingStatistic, 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 isTrackingStatisticValidAndEnabled(StatisticsField trackingStatistic)
          Is the StatisticsField valid and enabled (i.e.
 ServiceOutcome<java.lang.Void> updateTrackingStatistic(com.atlassian.crowd.embedded.api.User user, RapidView rapidView, StatisticsFieldConfig trackingStatistic)
          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

NONE_NAME_KEY

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

TrackingStatisticServiceImpl

public TrackingStatisticServiceImpl()
Method Detail

getAvailableTrackingStatistics

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

Specified by:
getAvailableTrackingStatistics in interface TrackingStatisticService
Returns:
the list.
See Also:
getAvailableConfigs()

updateTrackingStatistic

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

Specified by:
updateTrackingStatistic in interface TrackingStatisticService
Parameters:
user - the user
rapidView - the rapid view
trackingStatistic - the new configuration
Returns:
the outcome; possibly with errors

getTrackingStatisticStrict

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

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

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

getTrackingStatistic

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

Specified by:
getTrackingStatistic in interface TrackingStatisticService
Parameters:
rapidView - the rapid view
Returns:
the statistic field

getInvalidTrackingStatistic

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

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

getInstanceOf

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

isTrackingStatisticFieldAndNotApplicable

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

Specified by:
isTrackingStatisticFieldAndNotApplicable in interface TrackingStatisticService
Parameters:
trackingStatistic - the tracking statistic
issue - the issue
Returns:
the result
See Also:
TrackingStatisticService.isTrackingStatisticFieldAndNotApplicable(com.atlassian.greenhopper.model.rapid.StatisticsField, Long, String)

isTrackingStatisticFieldAndNotApplicable

public boolean isTrackingStatisticFieldAndNotApplicable(StatisticsField trackingStatistic,
                                                        java.lang.Long projectId,
                                                        java.lang.String issueTypeId)
Description copied from interface: TrackingStatisticService
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:
isTrackingStatisticFieldAndNotApplicable in interface TrackingStatisticService
Parameters:
trackingStatistic - the tracking statistic
projectId - the ID of the project
issueTypeId - the ID of the issue type
Returns:
the result
See Also:
TrackingStatisticService.isTrackingStatisticFieldAndNotApplicable(StatisticsField, Issue)

isTrackingStatisticValidAndEnabled

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

Specified by:
isTrackingStatisticValidAndEnabled in interface TrackingStatisticService
Parameters:
trackingStatistic - the tracking statistic
Returns:
the result
See Also:
StatisticsField.isValid(), StatisticsField.isEnabled()

isRemainingEstimateStatisticsField

public boolean isRemainingEstimateStatisticsField(StatisticsField statisticsField)
Description copied from interface: TrackingStatisticService
Is the passed StatisticsField of type remaining estimate?

Specified by:
isRemainingEstimateStatisticsField in interface TrackingStatisticService


Copyright © 2007-2012 Atlassian. All Rights Reserved.