org.opennms.netmgt.xmlrpcd
Class OpenNMSProvisioner

java.lang.Object
  extended by org.opennms.netmgt.xmlrpcd.OpenNMSProvisioner
All Implemented Interfaces:
Provisioner

public class OpenNMSProvisioner
extends Object
implements Provisioner

Author:
Mathew Brozowski, David Hustace, DJ Gregor, Mike Huot

Constructor Summary
OpenNMSProvisioner()
           
 
Method Summary
 boolean addServiceDatabase(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration, String user, String password, String driver, String url)
          This method defines a new package and Database(JDBC) service using the serviceId as the name of the polling package and service name within that package.
 boolean addServiceDNS(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration, int port, String lookup)
          This method defines a new package and DNS service using the serviceId as the name of the polling package and service name within that package.
 boolean addServiceHTTP(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration, String hostName, int port, String response, String responseText, String url, String user, String passwd, String agent)
          This method defines a new package and HTTP service using the serviceId as the name of the polling package and service name within that package.
 boolean addServiceHTTPS(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration, String hostName, int port, String response, String responseText, String url, String user, String passwd, String agent)
          This method defines a new package and HTTPS service using the serviceId as the name of the polling package and service name within that package.
 boolean addServiceICMP(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration)
          This method defines a new package and ICMP service using the serviceId as the name of the polling package and service name within that package.
 boolean addServiceTCP(String serviceId, int retry, int timeout, int interval, int downTimeInterval, int downTimeDuration, int port, String banner)
          This method defines a new package and TCP service using the serviceId as the name of the polling package and service name within that package.
 Parameter findParamterWithKey(Service svc, String key)
           
 Map<String,Object> getServiceConfiguration(String pkgName, String serviceId)
          Returns an XML-RPC compatible hash map representing the current configuration (see addService params) for the matching String serviceId When a service is defined using XML-RPC, the package name and the service name will be the same.
 void setCapsdConfig(CapsdConfig capsdConfig)
           
 void setCapsdDbSyncer(CapsdDbSyncer capsdDbSyncer)
           
 void setEventManager(EventIpcManager eventManager)
           
 void setPollerConfig(PollerConfig pollerConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenNMSProvisioner

public OpenNMSProvisioner()
Method Detail

addServiceICMP

public boolean addServiceICMP(String serviceId,
                              int retry,
                              int timeout,
                              int interval,
                              int downTimeInterval,
                              int downTimeDuration)
Description copied from interface: Provisioner
This method defines a new package and ICMP service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined ICMP service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceICMP in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
Returns:
Always returns true.

findParamterWithKey

public Parameter findParamterWithKey(Service svc,
                                     String key)

addServiceDNS

public boolean addServiceDNS(String serviceId,
                             int retry,
                             int timeout,
                             int interval,
                             int downTimeInterval,
                             int downTimeDuration,
                             int port,
                             String lookup)
Description copied from interface: Provisioner
This method defines a new package and DNS service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined DNS service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceDNS in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
port - int the port to poll for DNS service
lookup - String the hostname to resolve with the DNS service
Returns:
Always returns true.

addServiceTCP

public boolean addServiceTCP(String serviceId,
                             int retry,
                             int timeout,
                             int interval,
                             int downTimeInterval,
                             int downTimeDuration,
                             int port,
                             String banner)
Description copied from interface: Provisioner
This method defines a new package and TCP service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined TCP service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceTCP in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
port - int the port to attempt to connect to determine if the service is accepting connections
banner - String a string to check for in the returned banner of the TCP service or "" if no check is desired.
Returns:
Always returns true.

addServiceHTTP

public boolean addServiceHTTP(String serviceId,
                              int retry,
                              int timeout,
                              int interval,
                              int downTimeInterval,
                              int downTimeDuration,
                              String hostName,
                              int port,
                              String response,
                              String responseText,
                              String url,
                              String user,
                              String passwd,
                              String agent)
                       throws MalformedURLException
Description copied from interface: Provisioner
This method defines a new package and HTTP service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined HTTP service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceHTTP in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
hostName - String the virtual host (requires a url other than just "/")
port - int the port to attempt to connect to determine if the service is accepting connections
response - String a set of responseCodes that are considered valid. This string should consist of one or more ranges ( [range],[range],...) where a range is either a single number or a pair of number separated by a - ( 200,202-300 ). If the default range check is desire this can be "" The default range check is defined by the HttpMonitor plugin and is currently 100-499 for / or 100-399 for other URLs
responseText - String a string to check for in the returned web page. This string is either an exact string to search for in the page or a regular expression. To indicate a regular expression prefix the string with a '~' character
url - String the path portion of the URL to check on the server
user - String the user to use with basic authentication or "" if no authentication required
passwd - String the password to use with the user parameter with doing authentication
agent - String the String to use for the User agent field when communicating with the server
Returns:
Always returns true.
Throws:
MalformedURLException

addServiceHTTPS

public boolean addServiceHTTPS(String serviceId,
                               int retry,
                               int timeout,
                               int interval,
                               int downTimeInterval,
                               int downTimeDuration,
                               String hostName,
                               int port,
                               String response,
                               String responseText,
                               String url,
                               String user,
                               String passwd,
                               String agent)
                        throws MalformedURLException
Description copied from interface: Provisioner
This method defines a new package and HTTPS service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined HTTPS service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceHTTPS in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
hostName - String the virtual host (requires a url other than just "/")
port - int the port to attempt to connect to determine if the service is accepting connections
response - String a set of responseCodes that are considered valid. This string should consist of one or more ranges ( [range],[range],...) where a range is either a single number or a pair of number separated by a - ( 200,202-300 ). If the default range check is desire this can be "" The default range check is defined by the HttpMonitor plugin and is currently 100-499 for / or 100-399 for other URLs
responseText - String a string to check for in the returned web page. This string is either an exact string to search for in the page or a regular expression. To indicate a regular expression prefix the string with a '~' character
url - String the path portion of the URL to check on the server
user - String the user to use with basic authentication or "" if no authentication required
passwd - String the password to use with the user parameter with doing authentication
agent - String the String to use for the User agent field when communicating with the server
Returns:
Always returns true.
Throws:
MalformedURLException

addServiceDatabase

public boolean addServiceDatabase(String serviceId,
                                  int retry,
                                  int timeout,
                                  int interval,
                                  int downTimeInterval,
                                  int downTimeDuration,
                                  String user,
                                  String password,
                                  String driver,
                                  String url)
Description copied from interface: Provisioner
This method defines a new package and Database(JDBC) service using the serviceId as the name of the polling package and service name within that package. If the same serviceId is used again, it redefines the service. To add an interface to this newly defined Database(JDBC) service, send an EventConstants.UPDATE_SERVICE_EVENT_UEI Event.

Specified by:
addServiceDatabase in interface Provisioner
Parameters:
serviceId - String is used to define a polling package and a service name in that polling package.
retry - int number of retries for this service
timeout - int time in milliseconds to wait during each retries
interval - int the standard polling interval in milliseconds
downTimeInterval - int the downtime polling interval in milliseconds(downtime model)
downTimeDuration - int the amount of time in milliseconds the downtime polling interval is in effect
user - String the user to pass to the JDBC connection
password - String the password to pass to the JDBC connection
driver - String the fully qualified name of the JDBC Driver class
url - String the url used to make a JDBC connection to the database
Returns:
Always returns true.

getServiceConfiguration

public Map<String,Object> getServiceConfiguration(String pkgName,
                                                  String serviceId)
Description copied from interface: Provisioner
Returns an XML-RPC compatible hash map representing the current configuration (see addService params) for the matching String serviceId When a service is defined using XML-RPC, the package name and the service name will be the same.

Specified by:
getServiceConfiguration in interface Provisioner
Parameters:
pkgName - Name of the polling package i.e. "default" or custom package "FastHTTP"
serviceId - Name of the service, i.e. "ICMP" or a custom service "FastHTTP"
Returns:
Always returns true.

setCapsdConfig

public void setCapsdConfig(CapsdConfig capsdConfig)

setPollerConfig

public void setPollerConfig(PollerConfig pollerConfig)

setEventManager

public void setEventManager(EventIpcManager eventManager)

setCapsdDbSyncer

public void setCapsdDbSyncer(CapsdDbSyncer capsdDbSyncer)


Copyright © 2009. All Rights Reserved.