Package org.opennms.systemreport
Class AbstractSystemReportPlugin
- java.lang.Object
-
- org.opennms.systemreport.AbstractSystemReportPlugin
-
- All Implemented Interfaces:
java.lang.Comparable<SystemReportPlugin>
,SystemReportPlugin
- Direct Known Subclasses:
ConfigurationReportPlugin
,JavaReportPlugin
,LogReportPlugin
,LsofReportPlugin
,OpenNMSReportPlugin
,OSReportPlugin
,ThreadReportPlugin
,TopEventReportPlugin
,TopReportPlugin
public abstract class AbstractSystemReportPlugin extends java.lang.Object implements SystemReportPlugin
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceLocator
m_resourceLocator
protected static long
MAX_PROCESS_WAIT
-
Constructor Summary
Constructors Constructor Description AbstractSystemReportPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addGetters(java.lang.Object o, java.util.Map<java.lang.String,org.springframework.core.io.Resource> map)
int
compareTo(SystemReportPlugin o)
protected java.io.File
createTemporaryFileFromString(java.lang.String text)
protected <T> T
getBean(java.lang.String mxBeanName, java.lang.Class<T> clazz)
protected <T> T
getBean(java.lang.String mxBeanName, java.util.List<? extends java.lang.Class<T>> classes)
protected <T> java.util.List<T>
getBeans(java.lang.String mxBeanName, java.lang.Class<T> clazz)
java.util.Map<java.lang.String,org.springframework.core.io.Resource>
getEntries()
Get a map of key/value pairs of data exposed by the plugin.protected java.util.Set<java.lang.Integer>
getOpenNMSProcesses()
int
getPriority()
Get the priority of this plugin.protected org.springframework.core.io.Resource
getResource(java.lang.String text)
protected org.springframework.core.io.Resource
getResourceFromProperty(java.lang.String propertyName)
protected ResourceLocator
getResourceLocator()
protected void
setResourceLocator(ResourceLocator resourceLocator)
protected java.lang.String
slurp(java.io.File lsb)
protected java.lang.String
slurpCommand(java.lang.String[] command)
protected java.util.Map<java.lang.String,java.lang.String>
splitMultilineString(java.lang.String regex, java.lang.String text)
java.lang.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
-
m_resourceLocator
protected ResourceLocator m_resourceLocator
-
-
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 interfaceSystemReportPlugin
- Returns:
- the priority, from 1 to 99
-
getResourceLocator
protected ResourceLocator getResourceLocator()
-
setResourceLocator
protected void setResourceLocator(ResourceLocator resourceLocator)
-
getEntries
public java.util.Map<java.lang.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 interfaceSystemReportPlugin
- Returns:
- the plugin's data
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(SystemReportPlugin o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SystemReportPlugin>
-
slurp
protected java.lang.String slurp(java.io.File lsb)
-
slurpCommand
protected java.lang.String slurpCommand(java.lang.String[] command)
-
splitMultilineString
protected java.util.Map<java.lang.String,java.lang.String> splitMultilineString(java.lang.String regex, java.lang.String text)
-
getResourceFromProperty
protected org.springframework.core.io.Resource getResourceFromProperty(java.lang.String propertyName)
-
getResource
protected org.springframework.core.io.Resource getResource(java.lang.String text)
-
createTemporaryFileFromString
protected java.io.File createTemporaryFileFromString(java.lang.String text)
-
getOpenNMSProcesses
protected java.util.Set<java.lang.Integer> getOpenNMSProcesses()
-
addGetters
protected void addGetters(java.lang.Object o, java.util.Map<java.lang.String,org.springframework.core.io.Resource> map)
-
getBeans
protected <T> java.util.List<T> getBeans(java.lang.String mxBeanName, java.lang.Class<T> clazz)
-
getBean
protected <T> T getBean(java.lang.String mxBeanName, java.lang.Class<T> clazz)
-
getBean
protected <T> T getBean(java.lang.String mxBeanName, java.util.List<? extends java.lang.Class<T>> classes)
-
-