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 an
InetAddress
object this class provides everything by the
poll
interface.
Constructor and Description |
---|
AbstractServiceMonitor() |
Modifier and Type | Method and 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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
poll
public Map<String,Object> getRuntimeAttributes(MonitoredService svc, Map<String,Object> parameters)
getRuntimeAttributes
in interface ServiceMonitor
svc
- Includes details about to the service being monitored.parameters
- Includes the service parameters defined in poller-configuration.xml and those
returned by ServiceMonitor.getRuntimeAttributes(MonitoredService, Map)
.ServiceMonitor.poll(MonitoredService, Map)
.public String getEffectiveLocation(String location)
ServiceMonitor
getEffectiveLocation
in interface ServiceMonitor
location
- location associated with the service to be monitoredpublic static Object getKeyedObject(Map<String,Object> parameterMap, String key, Object defaultValue)
public static <T> T getKeyedInstance(Map<String,Object> parameterMap, String key, java.util.function.Supplier<T> defaultValue)
public static Boolean getKeyedBoolean(Map<String,Object> parameterMap, String key, Boolean defaultValue)
public static String getKeyedString(Map<String,Object> parameterMap, String key, String defaultValue)
public static Integer getKeyedInteger(Map<String,Object> parameterMap, String key, Integer defaultValue)
public static Long getKeyedLong(Map<String,Object> parameterMap, String key, Long defaultValue)
public static Properties getServiceProperties(MonitoredService svc)
Copyright © 2021. All rights reserved.