Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.product
Class MeasurementPlugin

    java.lang.Object
      org.hyperic.hq.product.GenericPlugin
          org.hyperic.hq.product.MeasurementPlugin

Direct Known Subclasses:
  ExecutableMeasurementPlugin, JDBCMeasurementPlugin, MxMeasurementPlugin, SigarMeasurementPlugin, SNMPMeasurementPlugin, Win32MeasurementPlugin

    public class MeasurementPlugin

extends GenericPlugin

Define and collect metrics.

Field Summary
`static String` | `PROP_TEMPLATE_CONFIG`
`static String` | `TYPE_COLLECTOR`

Fields inherited from class org.hyperic.hq.product.GenericPlugin
`config, FILE_DELIM, FILE_DELIM_ESC, PROP_NAME`

Constructor Summary
`MeasurementPlugin()`

Method Summary
`Properties` | `getCollectorProperties(Metric metric)`
`org.hyperic.util.config.ConfigSchema` | `getConfigSchema(TypeInfo info, org.hyperic.util.config.ConfigResponse config)` The ConfigSchema used to render config options for this resource in the UI and client shell.
`String` | `getHelp(TypeInfo info, Map props)`
`protected MeasurementPluginManager` | `getManager()`
`protected Map` | `getMeasurementProperties()` Allow xml template properties to be added by a plugin.
`MeasurementInfo[]` | `getMeasurements(TypeInfo info)`
`Collector` | `getNewCollector()`
`protected String[][]` | `getPlatformHelpProperties()`
`protected String` | `getPluginXMLHelp(TypeInfo info, String name, Map props)`
`org.hyperic.hq.product.MetricValue` | `getValue(Metric metric)` This method is called when the plugin is asked for a metric value.
`void` | `init(PluginManager manager)` Called when the plugin is loaded on the server and on the agent side.
`String` | `translate(String template, org.hyperic.util.config.ConfigResponse config)` Translate a measurement as returned from getMeasurements() into a value which can be passed into the plugin's getValue() routine.

Methods inherited from class org.hyperic.hq.product.GenericPlugin
`adjustClassPath, configure, getAbsoluteFiles, getConfig, getConfig, getCustomPropertiesSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getDefaultInstallPath, getLog, getLogName, getManagerProperty, getName, getPlatformName, getPluginClassName, getPluginData, getPluginProperty, getProductPlugin, getProperties, getScriptExtension, getScriptExtension, getScriptExtension, getTypeInfo, getTypeNameProperty, getTypeNameProperty, getTypeProperties, getTypeProperty, getTypeProperty, getTypeProperty, isNetStatEnabled, isWin32, openResource, setData, setName, setTypeInfo, shutdown, toFileList`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PROP_TEMPLATE_CONFIG

    public static final String PROP_TEMPLATE_CONFIG

See Also:
  Constant Field Values

### TYPE_COLLECTOR

    public static final String TYPE_COLLECTOR

See Also:
  Constant Field Values

Constructor Detail

### MeasurementPlugin

    public MeasurementPlugin()

Method Detail

### init

    public void init(PluginManager manager)
              throws PluginException

  Description copied from class: `GenericPlugin`
  Called when the plugin is loaded on the server and on the agent side.

  Overrides:
    `init` in class `GenericPlugin`
  Parameters:
    `manager` - The plugin manager for this plugin type.
  Throws:
    `PluginException`

### getManager

    protected MeasurementPluginManager getManager()

### getMeasurementProperties

    protected Map getMeasurementProperties()

  Allow xml template properties to be added by a plugin. The properties can be used as if the hq-plugin.xml defined <property name="..." value="..."/> for each entry in the Map returned. Properties with the same name in the xml file will override these.

### getMeasurements

    public MeasurementInfo[] getMeasurements(TypeInfo info)

### getPlatformHelpProperties

    protected String[][] getPlatformHelpProperties()

### getPluginXMLHelp

    protected String getPluginXMLHelp(TypeInfo info,
                                      String name,
                                      Map props)

### getHelp

    public String getHelp(TypeInfo info,
                          Map props)

### getValue

    public org.hyperic.hq.product.MetricValue getValue(Metric metric)
                                                throws PluginException,
                                                       MetricNotFoundException,
                                                       MetricUnreachableException

  This method is called when the plugin is asked for a metric value. The Metric is a translated value as returned by the getMeasurements() routine, and then run through the translate() method.

  Parameters:
    `metric` - Value returned from translate(), representing a specific metric to retrieve
  Returns:
    The value of the Metric and timestamp of collection time
  Throws:
    `MetricInvalidException` - The plugin is unable to use the metric, generally a developer bug where the template is malformed. I.e. JMX MalformedObjectNameException
    `MetricNotFoundException` - The monitored resource does not know about the requested Metric. I.e. JMX AttributeNotFoundException
    `MetricUnreachableException` - The monitored resource is unreachable. I.e. ConnectException
    `PluginException` - Thrown when an internal plugin error occurs

### getNewCollector

    public Collector getNewCollector()

### getCollectorProperties

    public Properties getCollectorProperties(Metric metric)

### translate

    public String translate(String template,
                            org.hyperic.util.config.ConfigResponse config)

  Translate a measurement as returned from getMeasurements() into a value which can be passed into the plugin's getValue() routine.

  Parameters:
    `template` - Measurement template from one of the plugins measurements returned from getMeasurements()
    `config` - Configuration used to perform translation on the template
  Throws:
    `PluginException` - When an internal plugin error occurs
    `MetricInvalidException` - When the template passed cannot be mapped to a template returned via getMeasurements()

### getConfigSchema

    public org.hyperic.util.config.ConfigSchema getConfigSchema(TypeInfo info,
                                                                org.hyperic.util.config.ConfigResponse config)

  Description copied from class: `GenericPlugin`
  The ConfigSchema used to render config options for this resource in the UI and client shell.

  Overrides:
    `getConfigSchema` in class `GenericPlugin`
  Parameters:
    `info` - The TypeInfo of this plugin from ProductPlugin.getTypes
    `config` - ConfigReponse of the parent resource (if any).
  Returns:
    ConfigSchema for this resource.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2010 Hyperic, Inc. support@hyperic.net, All Rights Reserved.