Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.product
Class Metric

java.lang.Object
  extended by org.hyperic.hq.product.Metric

public class Metric
extends java.lang.Object

this class parses Metrics in the form of: jmx-domain:jmx-properties:jmx-attribute:metric-properties For example: jboss.system:type=ServerInfo,lang=eng:FreeMemory:naming=jnp://localhost:1099,password=xxx where: jmx-domain = jboss.system jmx-properties = type=ServerInfo,lang=eng jmx-attribute = FreeMemory metric-properties = naming=jnp://localhost:1099,password=xxx


Field Summary
static java.lang.String ATTR_AVAIL
           
static double AVAIL_DOWN
           
static double AVAIL_PAUSED
           
static double AVAIL_POWERED_OFF
           
static double AVAIL_UNKNOWN
           
static double AVAIL_UP
           
static double AVAIL_WARN
           
 
Method Summary
static void addSecret(java.lang.String key)
           
static java.lang.String configTemplate(java.lang.String[] props)
           
static java.lang.String decode(java.lang.String val)
           
static java.lang.String encode(java.lang.String val)
           
 java.lang.String getAttributeName()
          The attribute name
 java.lang.String getCategory()
           
 java.lang.String getDomainName()
          The domain name - corresponding the the ObjectName domain.
 java.lang.String getId()
           
 long getInterval()
           
 java.lang.String getObjectName()
          The full JMX object name - domain : objectName
 java.util.Properties getObjectProperties()
          Properties in the local part of the ObjectName.
 java.lang.String getObjectProperty(java.lang.String property)
           
 java.lang.String getObjectPropString()
          The local part of the ObjectName.
 java.util.Properties getProperties()
           
 java.lang.String getPropString()
           
static java.util.Map getSecretFields()
           
 boolean isAvail()
           
static void main(java.lang.String[] args)
           
static Metric parse(java.lang.String template)
           
 void setCategory(java.lang.String category)
           
 void setDomainName(java.lang.String domain)
           
 void setId(int type, int id)
           
 void setInterval(long interval)
           
 void setObjectName(java.lang.String objectName)
          Set the JMX object name.
 void setPropString(java.lang.String propString)
           
 java.lang.String toDebugString()
           
 java.lang.String toString()
           
static java.lang.String translate(java.lang.String template, ConfigResponse config)
           
static java.lang.String translate(java.lang.String template, java.util.Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_AVAIL

public static final java.lang.String ATTR_AVAIL
See Also:
Constant Field Values

AVAIL_UNKNOWN

public static final double AVAIL_UNKNOWN
See Also:
Constant Field Values

AVAIL_UP

public static final double AVAIL_UP
See Also:
Constant Field Values

AVAIL_DOWN

public static final double AVAIL_DOWN
See Also:
Constant Field Values

AVAIL_WARN

public static final double AVAIL_WARN
See Also:
Constant Field Values

AVAIL_PAUSED

public static final double AVAIL_PAUSED
See Also:
Constant Field Values

AVAIL_POWERED_OFF

public static final double AVAIL_POWERED_OFF
See Also:
Constant Field Values
Method Detail

addSecret

public static void addSecret(java.lang.String key)

encode

public static java.lang.String encode(java.lang.String val)

decode

public static java.lang.String decode(java.lang.String val)

getDomainName

public java.lang.String getDomainName()
The domain name - corresponding the the ObjectName domain.


setDomainName

public void setDomainName(java.lang.String domain)

getObjectName

public java.lang.String getObjectName()
The full JMX object name - domain : objectName


setObjectName

public void setObjectName(java.lang.String objectName)
Set the JMX object name.


getAttributeName

public java.lang.String getAttributeName()
The attribute name


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSecretFields

public static java.util.Map getSecretFields()

toDebugString

public java.lang.String toDebugString()

getProperties

public java.util.Properties getProperties()

setPropString

public void setPropString(java.lang.String propString)

getPropString

public java.lang.String getPropString()

getObjectProperty

public java.lang.String getObjectProperty(java.lang.String property)

getObjectProperties

public java.util.Properties getObjectProperties()
Properties in the local part of the ObjectName.


getObjectPropString

public java.lang.String getObjectPropString()
The local part of the ObjectName.


getId

public java.lang.String getId()

setId

public void setId(int type,
                  int id)

getCategory

public java.lang.String getCategory()

setCategory

public void setCategory(java.lang.String category)

getInterval

public long getInterval()

setInterval

public void setInterval(long interval)

isAvail

public boolean isAvail()

parse

public static Metric parse(java.lang.String template)
                    throws MetricInvalidException
Parameters:
template - The metric string to be parsed.
Returns:
A Metric that can be used by the plugins.
Throws:
MetricInvalidException - If the metric string is malformed.

translate

public static java.lang.String translate(java.lang.String template,
                                         ConfigResponse config)

translate

public static java.lang.String translate(java.lang.String template,
                                         java.util.Properties props)

configTemplate

public static java.lang.String configTemplate(java.lang.String[] props)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

Hyperic HQ Plugin API v. 4.4.0.2

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