org.opennms.netmgt.capsd
Class JdbcCapsdDbSyncer

java.lang.Object
  extended by org.opennms.netmgt.capsd.JdbcCapsdDbSyncer
All Implemented Interfaces:
CapsdDbSyncer, org.springframework.beans.factory.InitializingBean

public class JdbcCapsdDbSyncer
extends Object
implements org.springframework.beans.factory.InitializingBean, CapsdDbSyncer

JdbcCapsdDbSyncer class.

Version:
$Id: $
Author:
ranger

Nested Class Summary
protected static class JdbcCapsdDbSyncer.LightWeightIfEntry
           LightWeightIfEntry is designed to hold specific information about an IP interface in the database such as its IP address, its parent node id, and its managed status and represents a lighter weight version of the DbIpInterfaceEntry class.
 
Field Summary
static String RETRIEVE_IPADDR_NODEID_SQL
          The SQL statement used to determine if an IP address is already in the ipInterface table and if so what its parent nodeid is.
static String RETRIEVE_IPADDR_SQL
          The SQL statement used to determine if an IP address is already in the ipInterface table and there is known.
 
Constructor Summary
JdbcCapsdDbSyncer()
          Constructor for JdbcCapsdDbSyncer.
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
 CapsdConfig getCapsdConfig()
          getCapsdConfig
 CollectdConfigFactory getCollectdConfig()
          getCollectdConfig
 int getInterfaceDbNodeId(Connection dbConn, InetAddress ifAddress, int ifIndex)
          getInterfaceDbNodeId
 String getNextSvcIdSql()
          getNextSvcIdSql
 OpennmsServerConfigFactory getOpennmsServerConfig()
          getOpennmsServerConfig
 PollerConfig getPollerConfig()
          getPollerConfig
 Integer getServiceId(String name)
          Returns the service ID from the service table that was loaded during class initialization for the specified name.
 String getServiceName(Integer id)
          Returns the service name from the service table that was loaded during class initialization for the specified ID.
 boolean isInterfaceInDB(Connection dbConn, InetAddress ifAddress)
          isInterfaceInDB
 boolean isInterfaceInDB(InetAddress ifAddress)
          isInterfaceInDB
 void setCapsdConfig(CapsdConfig capsdConfig)
          setCapsdConfig
 void setCollectdConfig(CollectdConfigFactory collectdConfigFactory)
          setCollectdConfig
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
          setJdbcTemplate
 void setNextSvcIdSql(String nextSvcIdSql)
          setNextSvcIdSql
 void setOpennmsServerConfig(OpennmsServerConfigFactory serverConfigFactory)
          setOpennmsServerConfig
 void setPollerConfig(PollerConfig pollerConfig)
          setPollerConfig
 void syncManagementState()
          syncManagementState
 void syncManagementState(Connection conn)
          syncManagementState
 void syncServices()
          syncServices
 void syncServices(Connection conn)
          syncServices
 List<String> syncServicesTable()
          syncServicesTable
 List<String> syncServicesTable(Connection conn)
          syncServicesTable
 void syncSnmpPrimaryState()
          syncSnmpPrimaryState
 void syncSnmpPrimaryState(Connection conn)
          syncSnmpPrimaryState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRIEVE_IPADDR_NODEID_SQL

public static final String RETRIEVE_IPADDR_NODEID_SQL
The SQL statement used to determine if an IP address is already in the ipInterface table and if so what its parent nodeid is.

See Also:
Constant Field Values

RETRIEVE_IPADDR_SQL

public static final String RETRIEVE_IPADDR_SQL
The SQL statement used to determine if an IP address is already in the ipInterface table and there is known.

See Also:
Constant Field Values
Constructor Detail

JdbcCapsdDbSyncer

public JdbcCapsdDbSyncer()

Constructor for JdbcCapsdDbSyncer.

Method Detail

getServiceId

public Integer getServiceId(String name)
Returns the service ID from the service table that was loaded during class initialization for the specified name. Returns the service ID from the service table that was loaded during class initialization for the specified name.

Specified by:
getServiceId in interface CapsdDbSyncer
Parameters:
name - the name of the service to look up
Returns:
The result of the lookup, or null if a matching service name wasn't found

getServiceName

public String getServiceName(Integer id)
Returns the service name from the service table that was loaded during class initialization for the specified ID. Returns the service name from the service table that was loaded during class initialization for the specified ID.

Specified by:
getServiceName in interface CapsdDbSyncer
Parameters:
id - a Integer object.
Returns:
The result of the lookup, or null if a matching service ID wasn't found

syncServices

public void syncServices()

syncServices

Specified by:
syncServices in interface CapsdDbSyncer

syncServices

public void syncServices(Connection conn)
                  throws SQLException

syncServices

Parameters:
conn - a Connection object.
Throws:
SQLException - if any.

syncServicesTable

public List<String> syncServicesTable()

syncServicesTable

Specified by:
syncServicesTable in interface CapsdDbSyncer
Returns:
a List object.

syncServicesTable

public List<String> syncServicesTable(Connection conn)
                               throws SQLException

syncServicesTable

Parameters:
conn - a Connection object.
Returns:
a List object.
Throws:
SQLException - if any.

syncManagementState

public void syncManagementState()

syncManagementState

Specified by:
syncManagementState in interface CapsdDbSyncer

syncManagementState

public void syncManagementState(Connection conn)
                         throws SQLException

syncManagementState

Parameters:
conn - a Connection object.
Throws:
SQLException - if any.

syncSnmpPrimaryState

public void syncSnmpPrimaryState()

syncSnmpPrimaryState

Specified by:
syncSnmpPrimaryState in interface CapsdDbSyncer

syncSnmpPrimaryState

public void syncSnmpPrimaryState(Connection conn)
                          throws SQLException

syncSnmpPrimaryState

Parameters:
conn - a Connection object.
Throws:
SQLException - if any.

getCapsdConfig

public CapsdConfig getCapsdConfig()

getCapsdConfig

Returns:
a CapsdConfig object.

setCapsdConfig

public void setCapsdConfig(CapsdConfig capsdConfig)

setCapsdConfig

Parameters:
capsdConfig - a CapsdConfig object.

getOpennmsServerConfig

public OpennmsServerConfigFactory getOpennmsServerConfig()

getOpennmsServerConfig

Returns:
a OpennmsServerConfigFactory object.

setOpennmsServerConfig

public void setOpennmsServerConfig(OpennmsServerConfigFactory serverConfigFactory)

setOpennmsServerConfig

Parameters:
serverConfigFactory - a OpennmsServerConfigFactory object.

getPollerConfig

public PollerConfig getPollerConfig()

getPollerConfig

Returns:
a PollerConfig object.

setPollerConfig

public void setPollerConfig(PollerConfig pollerConfig)

setPollerConfig

Parameters:
pollerConfig - a PollerConfig object.

getCollectdConfig

public CollectdConfigFactory getCollectdConfig()

getCollectdConfig

Returns:
a CollectdConfigFactory object.

setCollectdConfig

public void setCollectdConfig(CollectdConfigFactory collectdConfigFactory)

setCollectdConfig

Parameters:
collectdConfigFactory - a CollectdConfigFactory object.

afterPropertiesSet

public void afterPropertiesSet()

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

getInterfaceDbNodeId

public int getInterfaceDbNodeId(Connection dbConn,
                                InetAddress ifAddress,
                                int ifIndex)
                         throws SQLException

getInterfaceDbNodeId

Parameters:
dbConn - a Connection object.
ifAddress - a InetAddress object.
ifIndex - a int.
Returns:
a int.
Throws:
SQLException - if any.

isInterfaceInDB

public boolean isInterfaceInDB(InetAddress ifAddress)

isInterfaceInDB

Specified by:
isInterfaceInDB in interface CapsdDbSyncer
Parameters:
ifAddress - a InetAddress object.
Returns:
a boolean.

isInterfaceInDB

public boolean isInterfaceInDB(Connection dbConn,
                               InetAddress ifAddress)
                        throws SQLException

isInterfaceInDB

Specified by:
isInterfaceInDB in interface CapsdDbSyncer
Parameters:
dbConn - a Connection object.
ifAddress - a InetAddress object.
Returns:
a boolean.
Throws:
SQLException - if any.

setNextSvcIdSql

public void setNextSvcIdSql(String nextSvcIdSql)

setNextSvcIdSql

Parameters:
nextSvcIdSql - a String object.

getNextSvcIdSql

public String getNextSvcIdSql()

getNextSvcIdSql

Returns:
a String object.

setJdbcTemplate

public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)

setJdbcTemplate

Parameters:
jdbcTemplate - a JdbcTemplate object.


Copyright © 2011. All Rights Reserved.