Class AbstractFilterMeasureProvider
- java.lang.Object
-
- de.fzi.power.interpreter.measureprovider.ExtendedMeasureProvider
-
- de.fzi.power.interpreter.measureprovider.AbstractFilterMeasureProvider
-
- All Implemented Interfaces:
IAdaptable
,org.palladiosimulator.edp2.datastream.configurable.IPropertyConfigurable
- Direct Known Subclasses:
UtilizationFilterMeasureProvider
public abstract class AbstractFilterMeasureProvider extends ExtendedMeasureProvider
Subclass that encapsulates anAbstractFilter
as measure provider. Therefore it only supports the combination of a single input and a single output metric.
Yet, it is possible that more than one metric can be used as input. The measure provider relays property configuration to the encapsulated adapter.
-
-
Constructor Summary
Constructors Constructor Description AbstractFilterMeasureProvider(org.palladiosimulator.edp2.datastream.filter.AbstractAdapter adapter)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
getAdapter(Class adapter)
protected abstract Map<String,org.palladiosimulator.metricspec.MetricDescription>
getAllowedSourceMetrics()
To be implemented by the subclasses: Each element specifies an allowed input metric.org.palladiosimulator.edp2.datastream.IDataSource
getDataSource(Set<org.palladiosimulator.edp2.datastream.IDataSource> availableDataSources)
Gets aIDataSource
which contains the new metrics.Map<? extends String,? extends Object>
getDefaultConfiguration()
Set<String>
getKeys()
Map<String,Object>
getProperties()
Class<?>
getPropertyType(String key)
protected Collection<Set<String>>
getSourceMetricIds()
Gets the ids of the different metrics that can be used as input metrics.Collection<Set<org.palladiosimulator.metricspec.MetricDescription>>
getSourceMetrics()
Gets the different metrics that can be used as input metrics.protected abstract org.palladiosimulator.metricspec.MetricDescription
getTargetMetric()
To be implemented by subclasses in order to specify the supported output metric.Set<org.palladiosimulator.metricspec.MetricDescription>
getTargetMetrics()
Gets the set of metrics the measure provider has to offer in case all of the source metrics requirements are satisfied.boolean
isPropertyNotSet(String key)
void
setProperties(Map<String,Object> properties)
void
unsetProperty(String key)
-
Methods inherited from class de.fzi.power.interpreter.measureprovider.ExtendedMeasureProvider
canProvideMetric
-
-
-
-
Method Detail
-
getTargetMetric
protected abstract org.palladiosimulator.metricspec.MetricDescription getTargetMetric()
To be implemented by subclasses in order to specify the supported output metric.- Returns:
- A
MetricDescription
denoting the output metric.
-
getAllowedSourceMetrics
protected abstract Map<String,org.palladiosimulator.metricspec.MetricDescription> getAllowedSourceMetrics()
To be implemented by the subclasses: Each element specifies an allowed input metric.- Returns:
- A collection of the different supported input metrics, mapped by their corresponding
ids.
For each contained metric it should hold that:
adapter.canAccept(dataSource) == true <=> this.getSourceMetrics().contains(dataSource.getMetricDescription())
, whereadapter
is theAbstractFilter
associated with this instance.
-
getSourceMetrics
public final Collection<Set<org.palladiosimulator.metricspec.MetricDescription>> getSourceMetrics()
Gets the different metrics that can be used as input metrics.- Specified by:
getSourceMetrics
in classExtendedMeasureProvider
- Returns:
- A
Collection
of singleton sets ofMetricDescription
s, each of which containing an allowed input metric.
-
getSourceMetricIds
protected final Collection<Set<String>> getSourceMetricIds()
Gets the ids of the different metrics that can be used as input metrics.- Specified by:
getSourceMetricIds
in classExtendedMeasureProvider
- Returns:
- A
Collection
of singleton sets of Strings, each of which containing an id of an allowed input metric.
-
getTargetMetrics
public final Set<org.palladiosimulator.metricspec.MetricDescription> getTargetMetrics()
Description copied from class:ExtendedMeasureProvider
Gets the set of metrics the measure provider has to offer in case all of the source metrics requirements are satisfied.- Specified by:
getTargetMetrics
in classExtendedMeasureProvider
- Returns:
- Since instances of this class do only support one output metric, this method simply
returns
Collections.singleton(getTargetMetric()).
-
getDataSource
public org.palladiosimulator.edp2.datastream.IDataSource getDataSource(Set<org.palladiosimulator.edp2.datastream.IDataSource> availableDataSources)
Description copied from class:ExtendedMeasureProvider
Gets aIDataSource
which contains the new metrics.- Specified by:
getDataSource
in classExtendedMeasureProvider
- Parameters:
availableDataSources
- the available data sources- Returns:
- the respective IDataSource
-
isPropertyNotSet
public boolean isPropertyNotSet(String key)
-
unsetProperty
public void unsetProperty(String key)
-
-