Class 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)
      detect
      void 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmpDetector

        public XmpDetector​(java.lang.String serviceName,
                           int port)
        Parameters:
        serviceName - a String object
        port - an int specifying tcp port number
      • XmpDetector

        public XmpDetector()
    • 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 interface ServiceDetector
        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 interface ServiceDetector
        Parameters:
        newServiceName - a String object.
      • init

        public void init()
        Description copied from interface: ServiceDetector
        Perform any necessary initialization after construction and before detecting.
        Specified by:
        init in interface ServiceDetector
      • 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 interface ServiceDetector
      • setPort

        public void setPort​(int newPort)
        Description copied from interface: ServiceDetector
        Set the port where the service will be detected.
        Specified by:
        setPort in interface ServiceDetector
      • 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 interface ServiceDetector
      • getIpMatch

        public java.lang.String getIpMatch()
        Description copied from interface: ServiceDetector
        Get the IPLIKE rule for detecting the service.
        Specified by:
        getIpMatch in interface ServiceDetector
      • setTimeout

        public void setTimeout​(int newTimeout)
        Description copied from interface: ServiceDetector
        Set the timeout for detecting the service.
        Specified by:
        setTimeout in interface ServiceDetector
      • 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 interface ServiceDetector