|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dracoware.module.RspModuleBackend
public class RspModuleBackend
The RspModuleBackend
object handles all communications between
an RSP module and an rspd.
Field Summary | |
---|---|
static int |
ERROR
Specifies a log message of highest priority. |
static int |
NOTE
Specifies a log message of lowest priority. |
static int |
WARN
Specifies a log message of normal priority. |
Constructor Summary | |
---|---|
RspModuleBackend(java.lang.String name)
This function is called in a module before anything is done. |
Method Summary | |
---|---|
static java.lang.String |
bigSizeConvert(java.lang.String data)
Convert sizes from a computer into megabytes. |
static java.lang.String |
boolConvert(java.lang.String data)
Convert strings which describe data with 2 values. |
java.lang.String[] |
getConfigData(java.lang.String name)
Give an array of the data for config element "name", or null if there is no such config element with "name". |
java.lang.String[] |
getConfigNames()
Give an array of all of the config element names, or null if there is no config data for this module. |
java.lang.String |
getConfigValue(java.lang.String name)
Give the first piece of data associated with the config element with name "name", or null if there is no element with such a name. |
int |
getPolltime()
Specifies how long to wait between posting data. |
java.lang.String[] |
getThresholds()
Give an array of the thresholds, or null if there are no thresholds for this module. |
void |
giveData(java.lang.String data)
Specify that the given piece of data should be sent to the rspd when the postMessage() function is called. |
void |
giveGraphData(RspGraphReturnData graphData)
Specify that the given piece of graph data should be sent to the rspd when the postMessage() function is called. |
void |
log(int priority,
java.lang.String message)
Sends a message to the rspd app asking it to log a message. |
static java.lang.String |
percentConvert(java.lang.String data)
Convert strings of the form "2 %" or "0.4 %" or "204 percent" or "2" into a floating point number. |
boolean |
postMessage()
Sends data to the RSP daemon as well as crossed thresholds. |
void |
setThreshold(java.lang.String thresholdToSet,
boolean forceAlert)
Specify that the given threshold is currently crossed. |
static java.lang.String |
smallSizeConvert(java.lang.String data)
Convert sizes from a computer into bytes. |
static java.lang.String |
smallTimeConvert(java.lang.String data)
Converts data in small time form, that is, seconds or less into the number of microseconds. |
static java.lang.String |
timeConvert(java.lang.String data)
Convert data in time form (such as "2 days, 5 hours, 6 minutes") into a String which is the time in seconds. |
boolean |
waitNextEvent(int secs)
Waits specified amount of time for events from the rspd parent. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NOTE
public static final int WARN
public static final int ERROR
Constructor Detail |
---|
public RspModuleBackend(java.lang.String name) throws RspModuleException
name
- The name of this module.
RspModuleException
- If the module is unable to communicate with the RSPD.Method Detail |
---|
public void log(int priority, java.lang.String message)
priority
- The priority for this message.message
- The message to log.public boolean waitNextEvent(int secs) throws RspModuleException
secs
- Number of seconds to wait for an event before returning.
RspModuleException
- If the module is unable to communicate with the RSPD.public java.lang.String getConfigValue(java.lang.String name)
name
- The name of the config element.
public java.lang.String[] getConfigNames()
public java.lang.String[] getConfigData(java.lang.String name)
public java.lang.String[] getThresholds()
public void giveData(java.lang.String data)
data
- The data to report to the rspd.public void setThreshold(java.lang.String thresholdToSet, boolean forceAlert) throws RspModuleException
thresholdToSet
- The given threshold which is crossed.forceAlert
- Specifies that the RSPD should force an alert for this threshold.
RspModuleException
- If thresholdToSet
is not a threshoold.public void giveGraphData(RspGraphReturnData graphData)
graphData
- The graph data to send to the rspd.public boolean postMessage() throws RspModuleException
RspModuleException
- If the module is unable to communicate with the RSPD.public int getPolltime()
public static java.lang.String timeConvert(java.lang.String data) throws RspModuleException
data
- Data to convert.
RspModuleException
- If the data given was invalid or could not be converted.public static java.lang.String smallTimeConvert(java.lang.String data) throws RspModuleException
data
- The data to convert.
RspModuleException
- If the data given was invalid or could not be converted.public static java.lang.String bigSizeConvert(java.lang.String data) throws RspModuleException
data
- The data to convert.
RspModuleException
- If the data given was invalid or could not be converted.public static java.lang.String smallSizeConvert(java.lang.String data) throws RspModuleException
data
- The data to convert.
RspModuleException
- If the data given was invalid or could not be converted.public static java.lang.String percentConvert(java.lang.String data) throws RspModuleException
data
- The data to convert.
RspModuleException
- If the data given was invalid or could not be converted.public static java.lang.String boolConvert(java.lang.String data) throws RspModuleException
data
- The data to convert
RspModuleException
- If the data given was invalid or could not be converted.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |