|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.capsd.JdbcCapsdDbSyncer
public class JdbcCapsdDbSyncer
| 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()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
CapsdConfig |
getCapsdConfig()
|
CollectdConfigFactory |
getCollectdConfig()
|
int |
getInterfaceDbNodeId(Connection dbConn,
InetAddress ifAddress,
int ifIndex)
|
String |
getNextSvcIdSql()
|
OpennmsServerConfigFactory |
getOpennmsServerConfig()
|
PollerConfig |
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)
|
boolean |
isInterfaceInDB(InetAddress ifAddress)
|
void |
setCapsdConfig(CapsdConfig capsdConfig)
|
void |
setCollectdConfig(CollectdConfigFactory collectdConfigFactory)
|
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
|
void |
setNextSvcIdSql(String nextSvcIdSql)
|
void |
setOpennmsServerConfig(OpennmsServerConfigFactory serverConfigFactory)
|
void |
setPollerConfig(PollerConfig pollerConfig)
|
void |
syncManagementState()
Responsible for syncing up the 'isManaged' field of the ipInterface table and the 'status' field of the ifServices table based on the capsd and poller configurations. |
void |
syncManagementState(Connection conn)
|
void |
syncServices()
This method is responsible for sync'ing the content of the 'service' table with the protocols listed in the caspd-configuration.xml file. |
void |
syncServices(Connection conn)
|
List<String> |
syncServicesTable()
Synchronize configured services list with the database. |
List<String> |
syncServicesTable(Connection conn)
|
void |
syncSnmpPrimaryState()
Responsible for syncing up the 'isPrimarySnmp' field of the ipInterface table based on the capsd and collectd configurations. |
void |
syncSnmpPrimaryState(Connection conn)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String RETRIEVE_IPADDR_NODEID_SQL
public static final String RETRIEVE_IPADDR_SQL
| Constructor Detail |
|---|
public JdbcCapsdDbSyncer()
| Method Detail |
|---|
public Integer getServiceId(String name)
getServiceId in interface CapsdDbSyncername - the name of the service to look up
public String getServiceName(Integer id)
getServiceName in interface CapsdDbSyncername - the ID of the service to look up
public void syncServices()
CapsdDbSyncer
syncServices in interface CapsdDbSyncer
public void syncServices(Connection conn)
throws SQLException
SQLExceptionpublic List<String> syncServicesTable()
CapsdDbSyncer
syncServicesTable in interface CapsdDbSyncer
public List<String> syncServicesTable(Connection conn)
throws SQLException
SQLExceptionpublic void syncManagementState()
CapsdDbSyncer
Here is how the statuses are set:
If an interface is 'unmanaged' based on the capsd configuration,
ipManaged='U' and status='U'
If an interface is 'managed' based on the capsd configuration,
1. If the interface is not in any pacakge, ipManaged='N' and status ='N'
2. If the interface in atleast one package but the service is not polled by
by any of the packages, ipManaged='M' and status='N'
3. If the interface in atleast one package and the service is polled by a
package that this interface belongs to, ipManaged='M' and status'=A'
syncManagementState in interface CapsdDbSyncer
public void syncManagementState(Connection conn)
throws SQLException
SQLExceptionpublic void syncSnmpPrimaryState()
CapsdDbSyncer
syncSnmpPrimaryState in interface CapsdDbSyncer
public void syncSnmpPrimaryState(Connection conn)
throws SQLException
SQLExceptionpublic CapsdConfig getCapsdConfig()
public void setCapsdConfig(CapsdConfig capsdConfig)
public OpennmsServerConfigFactory getOpennmsServerConfig()
public void setOpennmsServerConfig(OpennmsServerConfigFactory serverConfigFactory)
public PollerConfig getPollerConfig()
public void setPollerConfig(PollerConfig pollerConfig)
public CollectdConfigFactory getCollectdConfig()
public void setCollectdConfig(CollectdConfigFactory collectdConfigFactory)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
public int getInterfaceDbNodeId(Connection dbConn,
InetAddress ifAddress,
int ifIndex)
throws SQLException
SQLExceptionpublic boolean isInterfaceInDB(InetAddress ifAddress)
isInterfaceInDB in interface CapsdDbSyncer
public boolean isInterfaceInDB(Connection dbConn,
InetAddress ifAddress)
throws SQLException
isInterfaceInDB in interface CapsdDbSyncerSQLExceptionpublic void setNextSvcIdSql(String nextSvcIdSql)
public String getNextSvcIdSql()
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||