Class XmpDetector
- java.lang.Object
-
- org.opennms.netmgt.protocols.xmp.detector.XmpDetector
-
- All Implemented Interfaces:
ServiceDetector
,SyncServiceDetector
public class XmpDetector extends java.lang.Object implements SyncServiceDetector
OpenNMS XMP Detector allows for discovery of service/protocols via provisiond. Our detector is pretty simple right now. All it does is attempt to establish an XmpSession with a system and if it succeeds, it queries a few core MIB variables and returns success. Future enhancements could include more capability information like supported MIBs, modules/plugins, and various dependencies to determine if something is a server for some service (noted by an inbound dependency relationship).- Version:
- $Id: $
- Author:
- rdk
-
-
Constructor Summary
Constructors Constructor Description XmpDetector()
XmpDetector(java.lang.String serviceName, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DetectResults
detect(DetectRequest request)
detectvoid
dispose()
The detector should clean up after itself in this method if necessary.java.lang.String
getIpMatch()
Get the IPLIKE rule for detecting the service.int
getPort()
Get the port where this service will be detected.java.lang.String
getServiceName()
Requires that all implementations of this API return a service name.int
getTimeout()
Get the timeout for detecting the service.void
init()
Perform any necessary initialization after construction and before detecting.void
onInit()
void
setIpMatch(java.lang.String newIpMatch)
Set the IPLIKE rule for detecting the service.void
setPort(int newPort)
Set the port where the service will be detected.void
setServiceName(java.lang.String newServiceName)
Service name is mutable so that we can create new instances of each implementation and define a new service detector using the underlying protocol.void
setTimeout(int newTimeout)
Set the timeout for detecting the service.
-
-
-
Method Detail
-
getServiceName
public java.lang.String getServiceName()
Description copied from interface:ServiceDetector
Requires that all implementations of this API return a service name.- Specified by:
getServiceName
in interfaceServiceDetector
- Returns:
- a
String
object.
-
setServiceName
public void setServiceName(java.lang.String newServiceName)
Description copied from interface:ServiceDetector
Service name is mutable so that we can create new instances of each implementation and define a new service detector using the underlying protocol.- Specified by:
setServiceName
in interfaceServiceDetector
- Parameters:
newServiceName
- aString
object.
-
init
public void init()
Description copied from interface:ServiceDetector
Perform any necessary initialization after construction and before detecting.- Specified by:
init
in interfaceServiceDetector
-
onInit
public void onInit()
-
getPort
public int getPort()
Description copied from interface:ServiceDetector
Get the port where this service will be detected.- Specified by:
getPort
in interfaceServiceDetector
-
setPort
public void setPort(int newPort)
Description copied from interface:ServiceDetector
Set the port where the service will be detected.- Specified by:
setPort
in interfaceServiceDetector
-
setIpMatch
public void setIpMatch(java.lang.String newIpMatch)
Description copied from interface:ServiceDetector
Set the IPLIKE rule for detecting the service.- Specified by:
setIpMatch
in interfaceServiceDetector
-
getIpMatch
public java.lang.String getIpMatch()
Description copied from interface:ServiceDetector
Get the IPLIKE rule for detecting the service.- Specified by:
getIpMatch
in interfaceServiceDetector
-
getTimeout
public int getTimeout()
Description copied from interface:ServiceDetector
Get the timeout for detecting the service.- Specified by:
getTimeout
in interfaceServiceDetector
-
setTimeout
public void setTimeout(int newTimeout)
Description copied from interface:ServiceDetector
Set the timeout for detecting the service.- Specified by:
setTimeout
in interfaceServiceDetector
-
dispose
public void dispose()
Description copied from interface:ServiceDetector
The detector should clean up after itself in this method if necessary.- Specified by:
dispose
in interfaceServiceDetector
-
detect
public final DetectResults detect(DetectRequest request)
Description copied from interface:SyncServiceDetector
detect
- Specified by:
detect
in interfaceSyncServiceDetector
- Parameters:
request
- aDetectRequest
object.- Returns:
-
-