Class GenericServiceDetectorFactory<T extends ServiceDetector>
- java.lang.Object
-
- org.opennms.netmgt.provision.support.GenericServiceDetectorFactory<T>
-
- All Implemented Interfaces:
ServiceDetectorFactory<T>
- Direct Known Subclasses:
ActiveMQDetectorFactory
,BSFDetectorFactory
,CitrixDetectorFactory
,DhcpDetectorFactory
,DnsDetectorFactory
,DominoIIOPDetectorFactory
,FtpDetectorFactory
,GenericJMXDetectorFactory
,GenericSnmpDetectorFactory
,GpDetectorFactory
,HttpDetectorFactory
,HttpsDetectorFactory
,IcmpDetectorFactory
,ImapDetectorFactory
,ImapsDetectorFactory
,JdbcDetectorFactory
,JdbcQueryDetectorFactory
,JdbcStoredProcedureDetectorFactory
,LdapDetectorFactory
,LdapsDetectorFactory
,LoopDetectorFactory
,MemcachedDetectorFactory
,MSExchangeDetectorFactory
,NotesHttpDetectorFactory
,NrpeDetectorFactory
,NsclientDetectorFactory
,NtpDetectorFactory
,Pop3DetectorFactory
,RadiusAuthDetectorFactory
,RDNSLookupDetectorFactory
,SmbDetectorFactory
,SmtpDetectorFactory
,SshDetectorFactory
,TcpDetectorFactory
,TrivialTimeDetectorFactory
,WebDetectorFactory
,WmiDetectorFactory
,WsManDetectorFactory
,WsManWQLDetectorFactory
,XmpDetectorFactory
public class GenericServiceDetectorFactory<T extends ServiceDetector> extends java.lang.Object implements ServiceDetectorFactory<T>
-
-
Constructor Summary
Constructors Constructor Description GenericServiceDetectorFactory(java.lang.Class<T> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterDetect(DetectRequest request, DetectResults results, java.lang.Integer nodeId)
Optional implementation.DetectRequest
buildRequest(java.lang.String location, java.net.InetAddress address, java.lang.Integer port, java.util.Map<java.lang.String,java.lang.String> attributes)
Builds the request that will be used to invoke the detector.T
createDetector(java.util.Map<java.lang.String,java.lang.String> properties)
Instantiates a new detector and set bean properties.java.lang.Class<T>
getDetectorClass()
Used by the detector registry to track and index the detector types.void
setBeanProperties(ServiceDetector detector, java.util.Map<java.lang.String,java.lang.String> properties)
Set detector attributes as bean properties.
-
-
-
Constructor Detail
-
GenericServiceDetectorFactory
public GenericServiceDetectorFactory(java.lang.Class<T> clazz)
-
-
Method Detail
-
createDetector
public T createDetector(java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:ServiceDetectorFactory
Instantiates a new detector and set bean properties. One of the ways to set bean properties is using Spring @BeanWrapper
BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(serviceDetector); wrapper.setPropertyValues(properties);
- Specified by:
createDetector
in interfaceServiceDetectorFactory<T extends ServiceDetector>
- Parameters:
properties
- are used to set properties on detector bean.
-
getDetectorClass
public java.lang.Class<T> getDetectorClass()
Description copied from interface:ServiceDetectorFactory
Used by the detector registry to track and index the detector types.- Specified by:
getDetectorClass
in interfaceServiceDetectorFactory<T extends ServiceDetector>
-
buildRequest
public DetectRequest buildRequest(java.lang.String location, java.net.InetAddress address, java.lang.Integer port, java.util.Map<java.lang.String,java.lang.String> attributes)
Description copied from interface:ServiceDetectorFactory
Builds the request that will be used to invoke the detector.- Specified by:
buildRequest
in interfaceServiceDetectorFactory<T extends ServiceDetector>
- Parameters:
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 invoked- Returns:
- a new
DetectRequest
-
afterDetect
public void afterDetect(DetectRequest request, DetectResults results, java.lang.Integer nodeId)
Description copied from interface:ServiceDetectorFactory
Optional implementation.- Specified by:
afterDetect
in interfaceServiceDetectorFactory<T extends ServiceDetector>
- Parameters:
request
-DetectRequest
results
-DetectResults
nodeId
-OnmsNode.getNodeId()
-
setBeanProperties
public void setBeanProperties(ServiceDetector detector, java.util.Map<java.lang.String,java.lang.String> properties)
Set detector attributes as bean properties.- Parameters:
detector
-ServiceDetector
properties
- detector attributes from foreign source configuration
-
-