public abstract class AbstractSampleManager extends Object implements SampleManager, MonitoringConstants, ThreadSafe, LogEnabled, Configurable, PluginAware
SampleManager
.MonitoringConstants.Period
Modifier and Type | Field and Description |
---|---|
protected I18nizableText |
_description
description
|
protected String |
_featureName
The name of the feature that has declared this component
|
protected String |
_id
id
|
protected I18nizableText |
_label
label
|
protected Logger |
_logger
Logger available to subclasses.
|
protected String |
_pluginName
The name of the plugin that has declared this component
|
FEEDING_PERIOD, RRD_EXT, RRD_STORAGE_DIRECTORY
Constructor and Description |
---|
AbstractSampleManager() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_configureDatasources(org.rrd4j.core.RrdDef rrdDef)
Provides the data sources.
|
protected void |
_configureValueRange(org.rrd4j.graph.RrdGraphDef graphDef)
Configure the value range to be displayed.
Default implementation set min value to 0 . |
protected abstract String |
_getGraphTitle()
Provide the graph title.
|
protected abstract Map<String,Object> |
_internalCollect(org.rrd4j.core.Sample sample)
Collect data into the Round Robin Database.
|
protected void |
_registerDatasources(org.rrd4j.core.RrdDef rrdDef,
String dsName,
org.rrd4j.DsType dsType,
double minValue,
double maxValue)
Register a new data source where heartbeat property is set internally.
|
protected void |
_setCommonParameters(org.rrd4j.graph.RrdGraphDef graphDef)
Set common graph definition parameters (graph style, ...)
|
Map<String,Object> |
collect(org.rrd4j.core.Sample sample)
Collect data into the Round Robin Database.
|
void |
configure(Configuration configuration) |
void |
configureRRDDef(org.rrd4j.core.RrdDef rrdDef)
Provides the definition to use for this RRD file.
|
void |
enableLogging(Logger logger) |
I18nizableText |
getDescription()
Provides the human readable description.
|
String |
getId()
Provides the id of this manager.
Must be unique in the application. |
I18nizableText |
getLabel()
Provides the human readable name to use.
|
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
protected String _pluginName
protected String _featureName
protected I18nizableText _label
protected I18nizableText _description
public AbstractSampleManager()
public String getId()
SampleManager
getId
in interface SampleManager
public I18nizableText getLabel()
SampleManager
getLabel
in interface SampleManager
public I18nizableText getDescription()
SampleManager
getDescription
in interface SampleManager
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void enableLogging(Logger logger)
enableLogging
in interface LogEnabled
public void configureRRDDef(org.rrd4j.core.RrdDef rrdDef)
SampleManager
configureRRDDef
in interface SampleManager
rrdDef
- the Round Robin Database definition.protected abstract void _configureDatasources(org.rrd4j.core.RrdDef rrdDef)
rrdDef
- the Round Robin Database definition.protected void _registerDatasources(org.rrd4j.core.RrdDef rrdDef, String dsName, org.rrd4j.DsType dsType, double minValue, double maxValue)
rrdDef
- the Round Robin Database definition.dsName
- the data source name.dsType
- the data source type.minValue
- the minimal acceptable value. Use Double.NaN
if unknown.maxValue
- the maximal acceptable value. Use Double.NaN
if unknown.public Map<String,Object> collect(org.rrd4j.core.Sample sample) throws IOException
SampleManager
collect
in interface SampleManager
sample
- the sample to collect.IOException
- thrown in case of I/O error.protected abstract Map<String,Object> _internalCollect(org.rrd4j.core.Sample sample) throws IOException
sample
- the sample to collect.IOException
- thrown in case of I/O error.protected void _setCommonParameters(org.rrd4j.graph.RrdGraphDef graphDef)
graphDef
- the prepared graph definition.protected void _configureValueRange(org.rrd4j.graph.RrdGraphDef graphDef)
0
.graphDef
- the graph definition.protected abstract String _getGraphTitle()