public class ServiceDetectorFactoryImpl<T extends ServiceDetector> extends Object implements ServiceDetectorFactory<T>
ServiceDetectorFactory
implementations to ServiceDetectorFactory
Constructor and Description |
---|
ServiceDetectorFactoryImpl(org.opennms.integration.api.v1.detectors.ServiceDetectorFactory serviceDetectorFactory) |
Modifier and Type | Method and Description |
---|---|
void |
afterDetect(DetectRequest request,
DetectResults results,
Integer nodeId)
Optional implementation.
|
DetectRequest |
buildRequest(String location,
InetAddress address,
Integer port,
Map attributes)
Builds the request that will be used to invoke the detector.
|
T |
createDetector(Map<String,String> properties)
Instantiates a new detector and set bean properties.
|
Class |
getDetectorClass()
Used by the detector registry to track and index the detector types.
|
public ServiceDetectorFactoryImpl(org.opennms.integration.api.v1.detectors.ServiceDetectorFactory serviceDetectorFactory)
public Class getDetectorClass()
ServiceDetectorFactory
getDetectorClass
in interface ServiceDetectorFactory<T extends ServiceDetector>
public T createDetector(Map<String,String> properties)
ServiceDetectorFactory
BeanWrapper
BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(serviceDetector);
wrapper.setPropertyValues(properties);
Detectors are treated as protoypes and should only be used for a
single call to "isServiceDetected".createDetector
in interface ServiceDetectorFactory<T extends ServiceDetector>
properties
- are used to set properties on detector bean.public void afterDetect(DetectRequest request, DetectResults results, Integer nodeId)
ServiceDetectorFactory
afterDetect
in interface ServiceDetectorFactory<T extends ServiceDetector>
request
- DetectRequest
results
- DetectResults
nodeId
- OnmsNode.getNodeId()
public DetectRequest buildRequest(String location, InetAddress address, Integer port, Map attributes)
ServiceDetectorFactory
buildRequest
in interface ServiceDetectorFactory<T extends ServiceDetector>
location
- name of the location in which the detector will be invokedaddress
- address of the agent against which the detector will be invokedport
- port of the agent against which the detector will be invokedDetectRequest
Copyright © 2020. All rights reserved.