|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.rrd.Interface
This is a singleton class which provides an interface through which RRD (Round Robin Database) functions (rrd_create(), rrd_update(), and others) can be accessed from Java code.
The native method 'launch()' takes a single argument which is a RRD command string of similar format to what RRDtool takes. Please note the following examples: "create test.rrd --start N DS:ifOctetsIn:COUNTER:600:U:U \ RRA:AVERAGE:0.5:1:24" "update test.rrd --template:ifOctetsIn N:123456789" Refer to www.rrdtool.org for additional examples and information on the format of rrdtool command strings. Currently only 'create', 'update', and 'fetch' commands are supported.
Field Summary | |
private static boolean |
m_loaded
This member is set to true if the 'jrrd' library (libjrrd.so on linux/unix) has has been loaded. |
private static Interface |
m_singleton
The singleton instance of the interface |
Constructor Summary | |
private |
Interface()
Constructor. |
Method Summary | |
static Interface |
getInstance()
Return the singleton instance of this class. |
static void |
init()
Load the jrrd library and create the singleton instance of the interface. |
static java.lang.String[] |
launch(java.lang.String cmd)
Native method implemented in C which provides an interface to the lower-level RRD functions WARNING: The RRD C api (rrd_update(), rrd_create(), etc...) relies on getopt() & therefore is not thread safe. |
static void |
main(java.lang.String[] argv)
Debug purposes only |
static void |
reload()
Reload the jrrd library and create the singleton instance of the interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Interface m_singleton
private static boolean m_loaded
Constructor Detail |
private Interface() throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
- if we don't have permission to load the library
java.lang.UnsatisfiedLinkError
- if the library doesn't existMethod Detail |
public static java.lang.String[] launch(java.lang.String cmd)
cmd
- RRDtool style command string to be executed. Currently
supported RRD commands are: 'create' - calls rrd_create()
'update' - calls rrd_update() 'fetch' - calls rrd_fetch()
public static void init() throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
- if we don't have permission to load the library
java.lang.UnsatisfiedLinkError
- if the library doesn't existpublic static void reload() throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
- if we don't have permission to load the library
java.lang.UnsatisfiedLinkError
- if the library doesn't existpublic static Interface getInstance()
java.lang.IllegalStateException
- Thrown if the interface has not yet been initialized.public static void main(java.lang.String[] argv)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |