org.opennms.netmgt.collectd
Class JMXDataSource

java.lang.Object
  extended by org.opennms.netmgt.collectd.JMXDataSource
All Implemented Interfaces:
Cloneable

public class JMXDataSource
extends Object
implements Cloneable

This class encapsulates an RRDTool data source. Data source information parsed from the DataCollection.xml file is stored in RRDDataSource objects. For additional information on RRD and RRDTool see: http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/

Version:
1.1.1.1
Author:
Mike , OpenNMS , Mike , OpenNMS

Field Summary
static String RRD_ERROR
          Constant RRD_ERROR="RRD_ERROR"
 
Constructor Summary
JMXDataSource()
          Constructor
JMXDataSource(JMXDataSource second)
          Class copy constructor.
JMXDataSource(MibObject obj, String collectionName)
          Constructor for JMXDataSource.
 
Method Summary
 Object clone()
           Used to get a duplicate of self.
 int getHeartbeat()
          getHeartbeat
 String getInstance()
          Returns the object's instance id.
 String getMax()
          getMax
 String getMin()
          getMin
 String getName()
          Returns the object's name.
 String getOid()
          Returns the object's identifier.
 String getStorableValue(SnmpValue snmpVal)
          getStorableValue
 String getType()
          Returns the object's data type.
static boolean handlesType(String objectType)
          handlesType
static String mapType(String objectType)
          Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type.
 boolean performUpdate(String owner, File repository, SnmpValue value)
          performUpdate
 void setHeartbeat(int heartbeat)
          setHeartbeat
 void setInstance(String instance)
          This method is used to assign the object's instance id.
 void setMax(String maximum)
          setMax
 void setMin(String minimum)
          setMin
 void setName(String name)
          This method is used to assign the data source name.
 void setOid(String oid)
          This method is used to assign the object's identifier.
 void setType(String type)
          This method is used to assign the object's expected data type.
 String toString()
          This method is responsible for returning a String object which represents the content of this RRDDataSource object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RRD_ERROR

public static final String RRD_ERROR
Constant RRD_ERROR="RRD_ERROR"

See Also:
Constant Field Values
Constructor Detail

JMXDataSource

public JMXDataSource()
Constructor


JMXDataSource

public JMXDataSource(MibObject obj,
                     String collectionName)

Constructor for JMXDataSource.

Parameters:
obj - a MibObject object.
collectionName - a String object.

JMXDataSource

public JMXDataSource(JMXDataSource second)
Class copy constructor. Constructs a new object that is an identical to the passed object, however no data is shared between the two objects. Any changes to one will not affect the other.

Parameters:
second - The object to make a duplicate of.
Method Detail

handlesType

public static boolean handlesType(String objectType)

handlesType

Parameters:
objectType - MIB object type being inquired about
Returns:
true if RRDDataSource can handle the given type, false if it can't

mapType

public static String mapType(String objectType)
Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type. If the object type cannot be mapped to an RRD type, null is returned. RRD only supports integer data so MIB objects of type 'octetstring' are not supported.

Parameters:
objectType - - MIB object type to be mapped.
Returns:
RRD type string or NULL object type is not supported.

setOid

public void setOid(String oid)
This method is used to assign the object's identifier.

Parameters:
oid - - object identifier in dotted decimal notation (e.g., ".1.3.6.1.2.1.1.1")

setInstance

public void setInstance(String instance)
This method is used to assign the object's instance id.

Parameters:
instance - - instance identifier (to be appended to oid)

setName

public void setName(String name)
This method is used to assign the data source name.

Parameters:
name - a String object.

getOid

public String getOid()
Returns the object's identifier.

Returns:
The object's identifier string.

getInstance

public String getInstance()
Returns the object's instance id.

Returns:
The object's instance id string.

getName

public String getName()
Returns the object's name.

Returns:
The object's name.

setType

public void setType(String type)
This method is used to assign the object's expected data type.

Parameters:
type - - object's data type

setHeartbeat

public void setHeartbeat(int heartbeat)

setHeartbeat

Parameters:
heartbeat - a int.

setMin

public void setMin(String minimum)

setMin

Parameters:
minimum - a String object.

setMax

public void setMax(String maximum)

setMax

Parameters:
maximum - a String object.

getType

public String getType()
Returns the object's data type.

Returns:
The object's data type

getHeartbeat

public int getHeartbeat()

getHeartbeat

Returns:
a int.

getMin

public String getMin()

getMin

Returns:
a String object.

getMax

public String getMax()

getMax

Returns:
a String object.

clone

public Object clone()
Used to get a duplicate of self. The duplicate is identical to self but shares no common data.

Overrides:
clone in class Object

toString

public String toString()
This method is responsible for returning a String object which represents the content of this RRDDataSource object. Primarily used for debugging purposes.

Overrides:
toString in class Object
Returns:
String which represents the content of this RRDDataSource object

performUpdate

public boolean performUpdate(String owner,
                             File repository,
                             SnmpValue value)

performUpdate

Parameters:
owner - a String object.
repository - a File object.
value - a SnmpValue object.
Returns:
a boolean.

getStorableValue

public String getStorableValue(SnmpValue snmpVal)

getStorableValue

Parameters:
snmpVal - a SnmpValue object.
Returns:
a String object.


Copyright © 2011. All Rights Reserved.