OpenNMS API 1.2.9

## org.opennms.netmgt.rrd
Class RRDDataSource

    java.lang.Object
      org.opennms.netmgt.collectd.DataSource
          org.opennms.netmgt.rrd.RRDDataSource

public class RRDDataSource
extends DataSource

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

Field Summary
`private static int` `COUNTER_INDEX` Index of data type in supportedObjectTypes string array.
`private static java.lang.String` `DST_COUNTER`
`private static java.lang.String` `DST_GAUGE` RRDTool defined Data Source Types NOTE: "DERIVE" and "ABSOLUTE" not currently supported.
`private static int` `GAUGE_INDEX`
`private static int` `INTEGER_INDEX`
`private int` `m_heartbeat` Data Source Heartbeat.
`private java.lang.String` `m_max` Maximum Expected Range.
`private java.lang.String` `m_min` Minimum Expected Range.
`private java.lang.String` `m_type` Data Source Type.
`private static int` `MAX_DS_NAME_LENGTH`
`private static int` `OCTETSTRING_INDEX`
`static java.lang.String` `RRD_ERROR`
`private static java.lang.String[]` `supportedObjectTypes` Defines the list of supported (MIB) object types whic may be mapped to one of the supported RRD data source types.
`private static int` `TIMETICKS_INDEX`

Fields inherited from class org.opennms.netmgt.collectd.DataSource
`m_instance, m_name, m_oid`

Constructor Summary
`RRDDataSource()` Constructor
`RRDDataSource(MibObject obj, java.lang.String collectionName)`
`RRDDataSource(RRDDataSource second)` Class copy constructor.

Method Summary
`java.lang.Object` `clone()` Used to get a duplicate of self.
`int` `getHeartbeat()`
`java.lang.String` `getMax()`
`java.lang.String` `getMin()`
`java.lang.String` `getStorableValue(SnmpSyntax snmpVar)` This method extracts from snmpVar a string which can be passed as the val parameter of performUpdate.
`java.lang.String` `getType()` Returns the object's data type.
`static boolean` `handlesType(java.lang.String objectType)`
`static java.lang.String` `mapType(java.lang.String objectType)` Static method which takes a MIB object type (counter, counter32, octetstring, etc...) and returns the appropriate RRD data type.
`boolean` `performUpdate(java.lang.String collectionName, java.lang.String owner, java.lang.String repository, java.lang.String dsName, java.lang.String val)` Stores the value `val` in the datasource named dsName, in repository repository.
`void` `setHeartbeat(int heartbeat)`
`void` `setMax(java.lang.String maximum)`
`void` `setMin(java.lang.String minimum)`
`void` `setType(java.lang.String type)` This method is used to assign the object's expected data type.
`java.lang.String` `toString()` This method is responsible for returning a String object which represents the content of this RRDDataSource object.

Methods inherited from class org.opennms.netmgt.collectd.DataSource
`dataSourceForMibObject, getFullOid, getInstance, getName, getOid, setInstance, setName, setOid`

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

Field Detail

### MAX_DS_NAME_LENGTH

    private static final int MAX_DS_NAME_LENGTH

See Also:
  Constant Field Values

### RRD_ERROR

    public static final java.lang.String RRD_ERROR

See Also:
  Constant Field Values

### supportedObjectTypes

    private static final java.lang.String[] supportedObjectTypes

  Defines the list of supported (MIB) object types whic may be mapped to one of the supported RRD data source types. Currently the only two supported RRD data source types are: COUNTER & GAUGE. A simple string comparison is performed against this list of supported types to determine if an object can be represented by an RRD data source. NOTE: String comparison uses String.startsWith() method so "counter32" & "counter64" values will match "counter" entry. Comparison is case sensitive.

### COUNTER_INDEX

    private static final int COUNTER_INDEX

  Index of data type in supportedObjectTypes string array.

  See Also:
    Constant Field Values

### GAUGE_INDEX

    private static final int GAUGE_INDEX

See Also:
  Constant Field Values

### TIMETICKS_INDEX

    private static final int TIMETICKS_INDEX

See Also:
  Constant Field Values

### INTEGER_INDEX

    private static final int INTEGER_INDEX

See Also:
  Constant Field Values

### OCTETSTRING_INDEX

    private static final int OCTETSTRING_INDEX

See Also:
  Constant Field Values

### DST_GAUGE

    private static final java.lang.String DST_GAUGE

  RRDTool defined Data Source Types NOTE: "DERIVE" and "ABSOLUTE" not currently supported.

  See Also:
    Constant Field Values

### DST_COUNTER

    private static final java.lang.String DST_COUNTER

See Also:
  Constant Field Values

### m_type

    private java.lang.String m_type

  Data Source Type. This must be one of the available RRDTool data source type values: GAUGE, COUNTER, DERIVE, or ABSOLUTE

### m_heartbeat

    private int m_heartbeat

  Data Source Heartbeat. This is the maximum number of seconds that may pass between updates of this data source before the value of the data source is assumed to be 'Unknown'.

### m_min

    private java.lang.String m_min

  Minimum Expected Range. Together with m_max defines the expected range of the data supplied by this data source. May be set to "U" for 'Unknown'.

### m_max

    private java.lang.String m_max

  Maximum Expected Range. Together with m_min defines the expected range of the data supplied by this data source. May be set to "U" for Unknown.

Constructor Detail

### RRDDataSource

    public RRDDataSource()

  Constructor

### RRDDataSource

    public RRDDataSource(MibObject obj,
                         java.lang.String collectionName)

### RRDDataSource

    public RRDDataSource(RRDDataSource 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(java.lang.String objectType)

  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 java.lang.String mapType(java.lang.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.

### setType

    public void setType(java.lang.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)

### setMin

    public void setMin(java.lang.String minimum)

### setMax

    public void setMax(java.lang.String maximum)

### getType

    public java.lang.String getType()

  Returns the object's data type.

  Returns:
    The object's data type

### getHeartbeat

    public int getHeartbeat()

### getMin

    public java.lang.String getMin()

### getMax

    public java.lang.String getMax()

### clone

    public java.lang.Object clone()

  Used to get a duplicate of self. The duplicate is identical to self but shares no common data.

  Returns:
    A newly created copy of self.

### toString

    public java.lang.String toString()

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

  Returns:
    String which represents the content of this RRDDataSource object

### performUpdate

    public boolean performUpdate(java.lang.String collectionName,
                                 java.lang.String owner,
                                 java.lang.String repository,
                                 java.lang.String dsName,
                                 java.lang.String val)

  Description copied from class: `DataSource`
  Stores the value `val` in the datasource named dsName, in repository repository. Creates the store if need be (e.g. an rrd file, or a properties file, or whatever)

  Specified by:
    `performUpdate` in class `DataSource`

### getStorableValue

    public java.lang.String getStorableValue(SnmpSyntax snmpVar)

  Description copied from class: `DataSource`
  This method extracts from snmpVar a string which can be passed as the val parameter of performUpdate.

  Specified by:
    `getStorableValue` in class `DataSource`

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.