public class JdbcCapsdDbSyncer extends Object implements org.springframework.beans.factory.InitializingBean, CapsdDbSyncer
JdbcCapsdDbSyncer class.
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
JdbcCapsdDbSyncer()
Constructor for JdbcCapsdDbSyncer.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
afterPropertiesSet
|
InetAddress |
determinePrimarySnmpInterface(List<InetAddress> addressList,
boolean strict)
determinePrimarySnmpInterface
|
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
|
boolean |
isServiceCollectionEnabled(String addrString,
String string) |
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
|
public static final String RETRIEVE_IPADDR_NODEID_SQL
public static final String RETRIEVE_IPADDR_SQL
public Integer getServiceId(String name)
getServiceId
in interface CapsdDbSyncer
name
- the name of the service to look uppublic String getServiceName(Integer id)
getServiceName
in interface CapsdDbSyncer
id
- a Integer
object.public void syncServices()
syncServices
syncServices
in interface CapsdDbSyncer
public void syncServices(Connection conn) throws SQLException
syncServices
conn
- a Connection
object.SQLException
- if any.public List<String> syncServicesTable()
syncServicesTable
syncServicesTable
in interface CapsdDbSyncer
List
object.public List<String> syncServicesTable(Connection conn) throws SQLException
syncServicesTable
conn
- a Connection
object.List
object.SQLException
- if any.public void syncManagementState()
syncManagementState
syncManagementState
in interface CapsdDbSyncer
public void syncManagementState(Connection conn) throws SQLException
syncManagementState
conn
- a Connection
object.SQLException
- if any.public void syncSnmpPrimaryState()
syncSnmpPrimaryState
syncSnmpPrimaryState
in interface CapsdDbSyncer
public void syncSnmpPrimaryState(Connection conn) throws SQLException
syncSnmpPrimaryState
conn
- a Connection
object.SQLException
- if any.public CapsdConfig getCapsdConfig()
getCapsdConfig
CapsdConfig
object.public void setCapsdConfig(CapsdConfig capsdConfig)
setCapsdConfig
capsdConfig
- a CapsdConfig
object.public OpennmsServerConfigFactory getOpennmsServerConfig()
getOpennmsServerConfig
OpennmsServerConfigFactory
object.public void setOpennmsServerConfig(OpennmsServerConfigFactory serverConfigFactory)
setOpennmsServerConfig
serverConfigFactory
- a OpennmsServerConfigFactory
object.public PollerConfig getPollerConfig()
getPollerConfig
PollerConfig
object.public void setPollerConfig(PollerConfig pollerConfig)
setPollerConfig
pollerConfig
- a PollerConfig
object.public CollectdConfigFactory getCollectdConfig()
getCollectdConfig
CollectdConfigFactory
object.public void setCollectdConfig(CollectdConfigFactory collectdConfigFactory)
setCollectdConfig
collectdConfigFactory
- a CollectdConfigFactory
object.public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public int getInterfaceDbNodeId(Connection dbConn, InetAddress ifAddress, int ifIndex) throws SQLException
getInterfaceDbNodeId
dbConn
- a Connection
object.ifAddress
- a InetAddress
object.ifIndex
- a int.SQLException
- if any.public boolean isInterfaceInDB(InetAddress ifAddress)
isInterfaceInDB
isInterfaceInDB
in interface CapsdDbSyncer
ifAddress
- a InetAddress
object.public boolean isInterfaceInDB(Connection dbConn, InetAddress ifAddress) throws SQLException
isInterfaceInDB
isInterfaceInDB
in interface CapsdDbSyncer
dbConn
- a Connection
object.ifAddress
- a InetAddress
object.SQLException
- if any.public InetAddress determinePrimarySnmpInterface(List<InetAddress> addressList, boolean strict)
determinePrimarySnmpInterface
This method is responsbile for determining the node's primary SNMP interface from the specified list of InetAddress objects.determinePrimarySnmpInterface
in interface CapsdDbSyncer
addressList
- a List
object.strict
- a boolean.InetAddress
object.public void setNextSvcIdSql(String nextSvcIdSql)
setNextSvcIdSql
nextSvcIdSql
- a String
object.public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
setJdbcTemplate
jdbcTemplate
- a JdbcTemplate
object.public boolean isServiceCollectionEnabled(String addrString, String string)
isServiceCollectionEnabled
in interface CapsdDbSyncer
Copyright © 2015. All rights reserved.