Class AbstractServiceMonitor
- java.lang.Object
-
- org.opennms.netmgt.poller.support.AbstractServiceMonitor
-
- All Implemented Interfaces:
ServiceMonitor
- Direct Known Subclasses:
AbstractVmwareMonitor,ActiveMQMonitor,AsteriskSIPPeerMonitor,AvailabilityMonitor,BSFMonitor,CitrixMonitor,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
ServiceMonitorclass. Since most pollers do not do any special initialization, and only require that the interface is anInetAddressobject this class provides everything by thepollinterface.
-
-
Constructor Summary
Constructors Constructor Description AbstractServiceMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEffectiveLocation(String location)Allows the monitor to override the location at which it should be run.static BooleangetKeyedBoolean(Map<String,Object> parameterMap, String key, Boolean defaultValue)static <T> TgetKeyedInstance(Map<String,Object> parameterMap, String key, java.util.function.Supplier<T> defaultValue)static IntegergetKeyedInteger(Map<String,Object> parameterMap, String key, Integer defaultValue)static LonggetKeyedLong(Map<String,Object> parameterMap, String key, Long defaultValue)static ObjectgetKeyedObject(Map<String,Object> parameterMap, String key, Object defaultValue)static StringgetKeyedString(Map<String,Object> parameterMap, String key, String defaultValue)Map<String,Object>getRuntimeAttributes(MonitoredService svc, Map<String,Object> parameters)static PropertiesgetServiceProperties(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:
getRuntimeAttributesin 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:ServiceMonitorAllows the monitor to override the location at which it should be run.- Specified by:
getEffectiveLocationin 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)
-
-