Class AbstractServiceMonitor
- java.lang.Object
-
- org.opennms.netmgt.poller.support.AbstractServiceMonitor
-
- All Implemented Interfaces:
ServiceMonitor
- Direct Known Subclasses:
AbstractVmwareMonitor
,ActiveMQMonitor
,AsteriskSIPPeerMonitor
,AvailabilityMonitor
,BSFMonitor
,CitrixMonitor
,DeviceConfigMonitor
,DhcpMonitor
,DnsMonitor
,DominoIIOPMonitor
,GpMonitor
,IcmpMonitor
,ImapMonitor
,JMXMonitor
,JschSshMonitor
,LoopMonitor
,MailTransportMonitor
,MemcachedMonitor
,MinionHeartbeatMonitor
,MinionRpcMonitor
,MockMonitor
,NrpeMonitor
,NsclientMonitor
,NtpMonitor
,PageSequenceMonitor
,ParameterSubstitutingMonitor
,PassiveServiceMonitor
,Pop3Monitor
,SeleniumMonitor
,SmbMonitor
,SmtpMonitor
,SnmpMonitorStrategy
,SshMonitor
,StrafePingMonitor
,SystemExecuteMonitor
,TcpMonitor
,TrivialTimeMonitor
,WebMonitor
,WmiMonitor
,XmpMonitor
public abstract class AbstractServiceMonitor extends Object implements ServiceMonitor
This class provides a basic implementation for most of the interface methods of the
ServiceMonitor
class. Since most pollers do not do any special initialization, and only require that the interface is anInetAddress
object this class provides everything by thepoll
interface.
-
-
Constructor Summary
Constructors Constructor Description AbstractServiceMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEffectiveLocation(String location)
Allows the monitor to override the location at which it should be run.static Boolean
getKeyedBoolean(Map<String,Object> parameterMap, String key, Boolean defaultValue)
static <T> T
getKeyedInstance(Map<String,Object> parameterMap, String key, java.util.function.Supplier<T> defaultValue)
static Integer
getKeyedInteger(Map<String,Object> parameterMap, String key, Integer defaultValue)
static Long
getKeyedLong(Map<String,Object> parameterMap, String key, Long defaultValue)
static Object
getKeyedObject(Map<String,Object> parameterMap, String key, Object defaultValue)
static String
getKeyedString(Map<String,Object> parameterMap, String key, String defaultValue)
Map<String,Object>
getRuntimeAttributes(MonitoredService svc, Map<String,Object> parameters)
static Properties
getServiceProperties(MonitoredService svc)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.poller.ServiceMonitor
poll
-
-
-
-
Method Detail
-
getRuntimeAttributes
public Map<String,Object> getRuntimeAttributes(MonitoredService svc, Map<String,Object> parameters)
- Specified by:
getRuntimeAttributes
in interfaceServiceMonitor
- Parameters:
svc
- Includes details about to the service being monitored.parameters
- Includes the service parameters defined in poller-configuration.xml and those returned byServiceMonitor.getRuntimeAttributes(MonitoredService, Map)
.- Returns:
- Additional attributes, which should be added to the parameter map before calling
ServiceMonitor.poll(MonitoredService, Map)
.
-
getEffectiveLocation
public String getEffectiveLocation(String location)
Description copied from interface:ServiceMonitor
Allows the monitor to override the location at which it should be run.- Specified by:
getEffectiveLocation
in interfaceServiceMonitor
- Parameters:
location
- location associated with the service to be monitored- Returns:
- a possibly updated location
-
getKeyedObject
public static Object getKeyedObject(Map<String,Object> parameterMap, String key, Object defaultValue)
-
getKeyedInstance
public static <T> T getKeyedInstance(Map<String,Object> parameterMap, String key, java.util.function.Supplier<T> defaultValue)
-
getKeyedBoolean
public static Boolean getKeyedBoolean(Map<String,Object> parameterMap, String key, Boolean defaultValue)
-
getKeyedString
public static String getKeyedString(Map<String,Object> parameterMap, String key, String defaultValue)
-
getKeyedInteger
public static Integer getKeyedInteger(Map<String,Object> parameterMap, String key, Integer defaultValue)
-
getKeyedLong
public static Long getKeyedLong(Map<String,Object> parameterMap, String key, Long defaultValue)
-
getServiceProperties
public static Properties getServiceProperties(MonitoredService svc)
-
-