org.opennms.systemreport
Class AbstractSystemReportPlugin

java.lang.Object
  extended by org.opennms.systemreport.AbstractSystemReportPlugin
All Implemented Interfaces:
Comparable<SystemReportPlugin>, SystemReportPlugin
Direct Known Subclasses:
ConfigurationReportPlugin, JavaReportPlugin, LogReportPlugin, LsofReportPlugin, OpenNMSReportPlugin, OSReportPlugin, ThreadReportPlugin, TopEventReportPlugin, TopReportPlugin

public abstract class AbstractSystemReportPlugin
extends Object
implements SystemReportPlugin


Field Summary
protected static long MAX_PROCESS_WAIT
           
 
Constructor Summary
AbstractSystemReportPlugin()
           
 
Method Summary
protected  void addGetters(Object o, Map<String,org.springframework.core.io.Resource> map)
           
 int compareTo(SystemReportPlugin o)
           
protected  File createTemporaryFileFromString(String text)
           
protected  String findBinary(String name)
           
protected
<T> T
getBean(String mxBeanName, Class<T> clazz)
           
protected
<T> T
getBean(String mxBeanName, List<? extends Class<T>> classes)
           
protected
<T> List<T>
getBeans(String mxBeanName, Class<T> clazz)
           
 TreeMap<String,org.springframework.core.io.Resource> getEntries()
          Get a map of key/value pairs of data exposed by the plugin.
protected  Set<Integer> getOpenNMSProcesses()
           
 int getPriority()
          Get the priority of this plugin.
protected  org.springframework.core.io.Resource getResource(String text)
           
protected  org.springframework.core.io.Resource getResourceFromProperty(String propertyName)
           
protected  String slurp(File lsb)
           
protected  String slurpCommand(String[] command)
           
protected  String slurpOutput(org.apache.commons.exec.CommandLine command, boolean ignoreExitCode)
           
protected  Map<String,String> splitMultilineString(String regex, String text)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opennms.systemreport.SystemReportPlugin
getDescription, getName
 

Field Detail

MAX_PROCESS_WAIT

protected static final long MAX_PROCESS_WAIT
See Also:
Constant Field Values
Constructor Detail

AbstractSystemReportPlugin

public AbstractSystemReportPlugin()
Method Detail

getPriority

public int getPriority()
Description copied from interface: SystemReportPlugin
Get the priority of this plugin. This will be used to sort the various plugins' output when creating an aggregate report. 1-10: system-level plugins 11-50: related to core system functionality (eg, events, alarms, notifications) 51-98: related to non-essential system functionality (eg, UI, reporting) 99: unknown priority

Specified by:
getPriority in interface SystemReportPlugin
Returns:
the priority, from 1 to 99

getEntries

public TreeMap<String,org.springframework.core.io.Resource> getEntries()
Description copied from interface: SystemReportPlugin
Get a map of key/value pairs of data exposed by the plugin.

Specified by:
getEntries in interface SystemReportPlugin
Returns:
the plugin's data

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(SystemReportPlugin o)
Specified by:
compareTo in interface Comparable<SystemReportPlugin>

slurp

protected String slurp(File lsb)

slurpCommand

protected String slurpCommand(String[] command)

splitMultilineString

protected Map<String,String> splitMultilineString(String regex,
                                                  String text)

getResourceFromProperty

protected org.springframework.core.io.Resource getResourceFromProperty(String propertyName)

getResource

protected org.springframework.core.io.Resource getResource(String text)

findBinary

protected String findBinary(String name)

slurpOutput

protected String slurpOutput(org.apache.commons.exec.CommandLine command,
                             boolean ignoreExitCode)

createTemporaryFileFromString

protected File createTemporaryFileFromString(String text)

getOpenNMSProcesses

protected Set<Integer> getOpenNMSProcesses()

addGetters

protected void addGetters(Object o,
                          Map<String,org.springframework.core.io.Resource> map)

getBeans

protected <T> List<T> getBeans(String mxBeanName,
                               Class<T> clazz)

getBean

protected <T> T getBean(String mxBeanName,
                        Class<T> clazz)

getBean

protected <T> T getBean(String mxBeanName,
                        List<? extends Class<T>> classes)


Copyright © 2011. All Rights Reserved.