OpenNMS API 1.1.4

org.opennms.netmgt.rrd
Class RRDDataSource

java.lang.Object
  extended byorg.opennms.netmgt.rrd.RRDDataSource

public class RRDDataSource
extends java.lang.Object

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_instance
          Instance identifier which is appended to the object identifier to identify a particular MIB entry.
private  java.lang.String m_max
          Maximum Expected Range.
private  java.lang.String m_min
          Minimum Expected Range.
private  java.lang.String m_name
          Data Source Name.
private  java.lang.String m_oid
          Object's identifier in dotted-decimal notation (e.g, ".1.3.6.1.2.1.1.1").
private  java.lang.String m_type
          Data Source Type.
private static int OCTETSTRING_INDEX
           
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
           
 
Constructor Summary
RRDDataSource()
          Constructor
RRDDataSource(RRDDataSource second)
          Class copy constructor.
 
Method Summary
 java.lang.Object clone()
          Used to get a duplicate of self.
 int getHeartbeat()
           
 java.lang.String getInstance()
          Returns the object's instance id.
 java.lang.String getMax()
           
 java.lang.String getMin()
           
 java.lang.String getName()
          Returns the object's name.
 java.lang.String getOid()
          Returns the object's identifier.
 java.lang.String getType()
          Returns the object's data type.
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.
 void setHeartbeat(int heartbeat)
           
 void setInstance(java.lang.String instance)
          This method is used to assign the object's instance id.
 void setMax(java.lang.String maximum)
           
 void setMin(java.lang.String minimum)
           
 void setName(java.lang.String name)
          This method is used to assign the data source name.
 void setOid(java.lang.String oid)
          This method is used to assign the object's identifier.
 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 java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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_oid

private java.lang.String m_oid
Object's identifier in dotted-decimal notation (e.g, ".1.3.6.1.2.1.1.1"). Identifies the MIB object which is the source of data values for this RRD data source.


m_instance

private java.lang.String m_instance
Instance identifier which is appended to the object identifier to identify a particular MIB entry. This value may be an integer value or "ifIndex".


m_name

private java.lang.String m_name
Data Source Name. This is not only the name of the data source but should identify the MIB object as well (e.g., "ifOctetsIn").


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(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

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.

setOid

public void setOid(java.lang.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(java.lang.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(java.lang.String name)
This method is used to assign the data source name.

Parameters:
name - object alias: "sysDescription".

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)

getOid

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

Returns:
The object's identifier string.

getInstance

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

Returns:
The object's instance id string.

getName

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

Returns:
The object's name.

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

OpenNMS API 1.1.4

Generated by eevans on November 12 2004 1715.