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 Summary
Constructors
Constructor and Description
AbstractServiceMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
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)
-
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 interface ServiceMonitor
- Parameters:
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)
.
- 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 interface ServiceMonitor
- 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)
Copyright © 2019. All rights reserved.