|
|||||||||
| 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 java.lang.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 java.lang.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()
|
org.opennms.netmgt.config.CollectdConfigFactory |
getCollectdConfig()
|
int |
getInterfaceDbNodeId(java.sql.Connection dbConn,
java.net.InetAddress ifAddress,
int ifIndex)
|
java.lang.String |
getNextSvcIdSql()
|
org.opennms.netmgt.config.OpennmsServerConfigFactory |
getOpennmsServerConfig()
|
PollerConfig |
getPollerConfig()
|
java.lang.Integer |
getServiceId(java.lang.String name)
Returns the service ID from the service table that was loaded during class initialization for the specified name. |
java.lang.String |
getServiceName(java.lang.Integer id)
Returns the service name from the service table that was loaded during class initialization for the specified ID. |
void |
init()
|
boolean |
isInterfaceInDB(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
|
void |
setCapsdConfig(CapsdConfig capsdConfig)
|
void |
setCollectdConfig(org.opennms.netmgt.config.CollectdConfigFactory collectdConfigFactory)
|
void |
setNextSvcIdSql(java.lang.String nextSvcIdSql)
|
void |
setOpennmsServerConfig(org.opennms.netmgt.config.OpennmsServerConfigFactory serverConfigFactory)
|
void |
setPollerConfig(PollerConfig pollerConfig)
|
void |
syncManagementState(java.sql.Connection conn)
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 |
syncServices(java.sql.Connection conn)
This method is responsible for sync'ing the content of the 'service' table with the protocols listed in the caspd-configuration.xml file. |
java.util.List<java.lang.String> |
syncServicesTable(java.sql.Connection conn)
Synchronize configured services list with the database. |
void |
syncSnmpPrimaryState(java.sql.Connection conn)
Responsible for syncing up the 'isPrimarySnmp' field of the ipInterface table based on the capsd and collectd configurations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RETRIEVE_IPADDR_NODEID_SQL
public static final java.lang.String RETRIEVE_IPADDR_SQL
| Constructor Detail |
|---|
public JdbcCapsdDbSyncer()
| Method Detail |
|---|
public java.lang.Integer getServiceId(java.lang.String name)
getServiceId in interface CapsdDbSyncername - the name of the service to look up
public java.lang.String getServiceName(java.lang.Integer id)
getServiceName in interface CapsdDbSyncername - the ID of the service to look up
public void syncServices(java.sql.Connection conn)
throws java.sql.SQLException
CapsdDbSyncer
syncServices in interface CapsdDbSyncerjava.sql.SQLException
public java.util.List<java.lang.String> syncServicesTable(java.sql.Connection conn)
throws java.sql.SQLException
CapsdDbSyncer
syncServicesTable in interface CapsdDbSyncerjava.sql.SQLException
public void syncManagementState(java.sql.Connection conn)
throws java.sql.SQLException
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 CapsdDbSyncerconn - Connection to the database.
java.sql.SQLException - Thrown if an error occurs while syncing the database.
public void syncSnmpPrimaryState(java.sql.Connection conn)
throws java.sql.SQLException
CapsdDbSyncer
syncSnmpPrimaryState in interface CapsdDbSyncerconn - Connection to the database.
java.sql.SQLException - Thrown if an error occurs while syncing the database.public void init()
public CapsdConfig getCapsdConfig()
public void setCapsdConfig(CapsdConfig capsdConfig)
public org.opennms.netmgt.config.OpennmsServerConfigFactory getOpennmsServerConfig()
public void setOpennmsServerConfig(org.opennms.netmgt.config.OpennmsServerConfigFactory serverConfigFactory)
public PollerConfig getPollerConfig()
public void setPollerConfig(PollerConfig pollerConfig)
public org.opennms.netmgt.config.CollectdConfigFactory getCollectdConfig()
public void setCollectdConfig(org.opennms.netmgt.config.CollectdConfigFactory collectdConfigFactory)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
public int getInterfaceDbNodeId(java.sql.Connection dbConn,
java.net.InetAddress ifAddress,
int ifIndex)
throws java.sql.SQLException
java.sql.SQLException
public boolean isInterfaceInDB(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
throws java.sql.SQLException
isInterfaceInDB in interface CapsdDbSyncerjava.sql.SQLExceptionpublic void setNextSvcIdSql(java.lang.String nextSvcIdSql)
public java.lang.String getNextSvcIdSql()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||