jetbrains.buildServer.serverSide.statistics.build
Class CompositeVTB

java.lang.Object
  extended by jetbrains.buildServer.serverSide.statistics.build.StorageValueProvider
      extended by jetbrains.buildServer.serverSide.statistics.build.BuildValueTypeBase
          extended by jetbrains.buildServer.serverSide.statistics.build.BuildFinishAwareValueTypeBase
              extended by jetbrains.buildServer.serverSide.statistics.build.CompositeVTB
All Implemented Interfaces:
BuildFinishAware, BuildValueProvider, ValueProvider, ValueType
Direct Known Subclasses:
DeclarativeCompositeValueType

public abstract class CompositeVTB
extends BuildFinishAwareValueTypeBase

Base class for composite value types. It just gathers results of several other VTS for display in one chart.


Field Summary
protected  ValueProviderRegistry myValueProviderRegistry
           
 
Fields inherited from class jetbrains.buildServer.serverSide.statistics.build.BuildValueTypeBase
myServer
 
Fields inherited from class jetbrains.buildServer.serverSide.statistics.build.StorageValueProvider
myStorage
 
Constructor Summary
protected CompositeVTB(BuildDataStorage buildDataStorage, ValueProviderRegistry valueProviderRegistry, SBuildServer server, java.lang.String key)
           
protected CompositeVTB(BuildDataStorage buildDataStorage, ValueProviderRegistry valueProviderRegistry, SBuildServer server, java.lang.String key, java.lang.String format)
           
 
Method Summary
protected  BuildValueProvider createValueProviderForSubkey(java.lang.String subKey)
           
 java.util.Map<java.lang.String,BuildValue> getData(SBuild build)
           
 java.util.List<BuildValue> getDataSet(ChartSettings _chartSettings)
          use default storage, provided chartSettings and getValueProcessor() to obtain dataset
 java.util.List<BuildValue> getDataSet(ChartSettings _chartSettings, java.lang.String subKey, int index)
           
protected  BuildValueProvider getOrCreateValueProviderFor(java.lang.String subKey)
           
abstract  java.lang.String getSeriesName(java.lang.String subKey, int idx)
          Return series name for the data
abstract  java.lang.String[] getSubKeys()
          Return an array of the data subkeys - the keys reference ValueProvider.getKey call
 boolean hasData(ChartSettings buildChartSettings)
          Returns true if at least one not-null value is available for this ValueProvider for given settings
protected  BuildChartSettings updateSettingsForSubType(ChartSettings chartSettings, java.lang.String subKey, int idx)
          Update and return BuildChartSettings object
 
Methods inherited from class jetbrains.buildServer.serverSide.statistics.build.BuildFinishAwareValueTypeBase
buildFinished, buildTypeTitle, calculateBuildMetric, publishValue, toString
 
Methods inherited from class jetbrains.buildServer.serverSide.statistics.build.BuildValueTypeBase
getExtendedDescription, getSeriesColor, getSeriesGenericName, getValueFormat, hasAtLeastOneBuild, isAvailable
 
Methods inherited from class jetbrains.buildServer.serverSide.statistics.build.StorageValueProvider
getKey, getValueProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jetbrains.buildServer.serverSide.statistics.ValueType
getDescription
 
Methods inherited from interface jetbrains.buildServer.serverSide.statistics.ValueProvider
getKey
 

Field Detail

myValueProviderRegistry

protected final ValueProviderRegistry myValueProviderRegistry
Constructor Detail

CompositeVTB

protected CompositeVTB(BuildDataStorage buildDataStorage,
                       ValueProviderRegistry valueProviderRegistry,
                       SBuildServer server,
                       java.lang.String key)

CompositeVTB

protected CompositeVTB(BuildDataStorage buildDataStorage,
                       ValueProviderRegistry valueProviderRegistry,
                       SBuildServer server,
                       java.lang.String key,
                       java.lang.String format)
Method Detail

getSubKeys

public abstract java.lang.String[] getSubKeys()
Return an array of the data subkeys - the keys reference ValueProvider.getKey call

Returns:
keys for the data

getSeriesName

public abstract java.lang.String getSeriesName(java.lang.String subKey,
                                               int idx)
Return series name for the data

Parameters:
subKey - key for the series, see getSubKeys
idx - index for the subKey, zero-based, 0..getSubKeys.length - 1
Returns:
name of the serie to be shown on the UI in the combo box

updateSettingsForSubType

protected BuildChartSettings updateSettingsForSubType(ChartSettings chartSettings,
                                                      java.lang.String subKey,
                                                      int idx)
Update and return BuildChartSettings object

Parameters:
chartSettings - chart settings object - initial chart settings, de facto instance of BuildChartSettings, but this may change in the future.
subKey - key for the series, see getSubKeys
idx - index for the subKey, zero-based, 0..getSubKeys.length - 1
Returns:
name of the serie to be shown on the UI in the combo box

getDataSet

@NotNull
public java.util.List<BuildValue> getDataSet(@NotNull
                                                     ChartSettings _chartSettings)
Description copied from class: StorageValueProvider
use default storage, provided chartSettings and getValueProcessor() to obtain dataset

Specified by:
getDataSet in interface ValueProvider
Overrides:
getDataSet in class StorageValueProvider
Parameters:
_chartSettings - dataset chartSettings
Returns:
dataset

getDataSet

@NotNull
public java.util.List<BuildValue> getDataSet(@NotNull
                                                     ChartSettings _chartSettings,
                                                     @NotNull
                                                     java.lang.String subKey,
                                                     int index)

getData

@NotNull
public java.util.Map<java.lang.String,BuildValue> getData(@NotNull
                                                                  SBuild build)
Specified by:
getData in interface BuildValueProvider
Overrides:
getData in class BuildValueTypeBase
Parameters:
build - build to return statistics value for
Returns:
map of build values provided by this value provider for a given build (each value provider can report more than one statistics value, see CompositeVTB).

getOrCreateValueProviderFor

@Nullable
protected BuildValueProvider getOrCreateValueProviderFor(@NotNull
                                                                  java.lang.String subKey)

createValueProviderForSubkey

protected BuildValueProvider createValueProviderForSubkey(java.lang.String subKey)

hasData

public boolean hasData(ChartSettings buildChartSettings)
Description copied from interface: ValueProvider
Returns true if at least one not-null value is available for this ValueProvider for given settings

Specified by:
hasData in interface ValueProvider
Overrides:
hasData in class BuildValueTypeBase
Parameters:
buildChartSettings - dataset chartSettings
Returns:
true if there are some data available for this ValueProvider with given settings