org.opennms.netmgt.capsd.plugins
Class JDBCPlugin

java.lang.Object
  extended by org.opennms.netmgt.capsd.AbstractPlugin
      extended by org.opennms.netmgt.capsd.plugins.JDBCPlugin
All Implemented Interfaces:
Plugin
Direct Known Subclasses:
JDBCQueryPlugin, JDBCStoredProcedurePlugin

public class JDBCPlugin
extends AbstractPlugin

This OpenNMS capsd plugin checks if a given server is running a server that can talk JDBC on a given interface. If true then the interface is "saved" for future service state checking. This plugin is slow; Stablishing a connection between the client and the server is an slow operation. A connection pool doesn't make any sense when discovering a database, Also opening and closing a connection every time helps to discover problems like a RDBMS running out of connections.

More plugin information available at: OpenNMS developer site

Since:
0.1
Version:
0.1 - 07/22/2002
Author:
Jose Vicente Nunez Zuleta (josevnz@users.sourceforge.net) - RHCE, SJCD, SJCP

Constructor Summary
JDBCPlugin()
          Class constructor.
 
Method Summary
 boolean checkStatus(Connection con, Map<String,Object> qualifiers)
          checkStatus
protected  void closeStmt(Statement statement)
          closeStmt
 String getProtocolName()
          Returns the default protocol name
 boolean isProtocolSupported(InetAddress address)
          Returns true if the protocol defined by this plugin is supported.
 boolean isProtocolSupported(InetAddress address, Map<String,Object> qualifiers)
          Returns true if the protocol defined by this plugin is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCPlugin

public JDBCPlugin()
Class constructor. Load the JDBC drivers.

Method Detail

checkStatus

public boolean checkStatus(Connection con,
                           Map<String,Object> qualifiers)

checkStatus

Parameters:
con - a Connection object.
qualifiers - a Map object.
Returns:
a boolean.

closeStmt

protected void closeStmt(Statement statement)

closeStmt

Parameters:
statement - a Statement object.

getProtocolName

public String getProtocolName()
Returns the default protocol name

Specified by:
getProtocolName in interface Plugin
Specified by:
getProtocolName in class AbstractPlugin
Returns:
String Protocol Name

isProtocolSupported

public boolean isProtocolSupported(InetAddress address)
Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. Default checking method, asuming all the parameters by default. This method is likely to skip some machines because the default password is empty. is recomended to use the parametric method instead (unless your DBA is dummy enugh to leave a JDBC server with no password!!!).

Specified by:
isProtocolSupported in interface Plugin
Specified by:
isProtocolSupported in class AbstractPlugin
Parameters:
address - The address to check for support.
Returns:
True if the protocol is supported by the address.

isProtocolSupported

public boolean isProtocolSupported(InetAddress address,
                                   Map<String,Object> qualifiers)
Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. The qualifier map passed to the method is used by the plugin to return additional information by key-name. These key-value pairs can be added to service events if needed. Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. The qualifier map passed to the method is used by the plugin to return additional information by key-name. These key-value pairs can be added to service events if needed. Checking method, receives all the parameters as a Map. Currently supported:

Specified by:
isProtocolSupported in interface Plugin
Specified by:
isProtocolSupported in class AbstractPlugin
Parameters:
address - The address to check for support.
qualifiers - The map where qualification are set by the plugin.
Returns:
True if the protocol is supported by the address.


Copyright © 2011. All Rights Reserved.