public class DbEventWriter extends AbstractQueryManager
This class is used to store informations owned by SnmpCollection and DiscoveryLink Classes in DB. When saving SNMP Collection it populate Bean LinkableNode with information for DiscoveryLink. It performs data test for DiscoveryLink. Also take correct action on DB tables in case node is deleted service SNMP is discovered, service SNMP is Lost and Regained Also this class holds
m_linkd
ACTION_DELETE, ACTION_UPTODATE, CDP_ADDRESS_TYPE_IP_ADDRESS, SNMP_DOT1D_FDB_STATUS_INVALID, SNMP_DOT1D_FDB_STATUS_LEARNED, SNMP_DOT1D_FDB_STATUS_MGMT, SNMP_DOT1D_FDB_STATUS_OTHER, SNMP_DOT1D_FDB_STATUS_SELF
Constructor and Description |
---|
DbEventWriter()
Constructor for DbEventWriter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
deleteOlderData(Connection dbConn,
Timestamp now,
int nodeid) |
AtInterfaceDao |
getAtInterfaceDao() |
protected Integer |
getFromSysnameIpAddress(String lldpRemSysname,
InetAddress lldpRemPortid) |
protected int |
getIfIndexByName(Connection dbConn,
int nodeid,
String ifName) |
IpInterfaceDao |
getIpInterfaceDao() |
NodeDao |
getNodeDao() |
protected RouterInterface |
getNodeFromIp(Connection dbConn,
InetAddress ipaddr) |
protected List<Integer> |
getNodeidFromIp(Connection dbConn,
InetAddress ipaddr) |
protected RouterInterface |
getNodeidMaskFromIp(Connection dbConn,
InetAddress ipaddr) |
protected List<String> |
getPhysAddrs(int nodeId,
DBUtils d,
Connection dbConn) |
protected int |
getSnmpIfType(Connection dbConn,
int nodeid,
Integer ifindex) |
SnmpInterfaceDao |
getSnmpInterfaceDao() |
LinkableNode |
getSnmpNode(int nodeid)
getSnmpNode
|
List<LinkableNode> |
getSnmpNodeList()
getSnmpNodeList
|
protected void |
markOldDataInactive(Connection dbConn,
Timestamp now,
int nodeid) |
protected void |
saveIpRouteInterface(Connection dbConn,
OnmsIpRouteInterface ipRouteInterface) |
protected void |
saveStpInterface(Connection dbConn,
OnmsStpInterface stpInterface) |
protected void |
saveStpNode(Connection dbConn,
OnmsStpNode stpNode) |
protected void |
saveVlan(Connection dbConn,
OnmsVlan vlan) |
void |
setAtInterfaceDao(AtInterfaceDao dao) |
void |
setIpInterfaceDao(IpInterfaceDao dao) |
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) |
void |
setNodeDao(NodeDao nodeDao) |
void |
setSnmpInterfaceDao(SnmpInterfaceDao snmpInterfaceDao) |
void |
storeDiscoveryLink(DiscoveryLink discovery)
storeDiscoveryLink
|
LinkableNode |
storeSnmpCollection(LinkableNode node,
SnmpCollection snmpcoll)
storeSnmpCollection
|
void |
update(int nodeid,
char status)
update
|
void |
updateDeletedNodes()
updateDeletedNodes
|
void |
updateForInterface(int nodeId,
String ipAddr,
int ifIndex,
char status)
updateForInterface
|
getFromSysnameAgentCircuitId, getFromSysnameIfAlias, getFromSysnameIfName, getFromSysnameMacAddress, getFromSysnamePortComponent, getIfIndex, getLinkd, getNode, processCdpCacheTable, processDot1DBase, processDot1DBasePortTable, processDot1DTpFdbTable, processDot1StpPortTable, processIpNetToMediaTable, processLldp, processOspf, processQBridgeDot1dTpFdbTable, processRouteTable, processStpInterfaces, processStpNode, processVlanTable, sendNewSuspectEvent, setLinkd
public void storeDiscoveryLink(DiscoveryLink discovery) throws SQLException
storeDiscoveryLink
discovery
- a DiscoveryLink
object.SQLException
- if any.public LinkableNode storeSnmpCollection(LinkableNode node, SnmpCollection snmpcoll) throws SQLException
storeSnmpCollection
node
- a LinkableNode
object.snmpcoll
- a SnmpCollection
object.LinkableNode
object.SQLException
- if any.protected void markOldDataInactive(Connection dbConn, Timestamp now, int nodeid) throws SQLException
markOldDataInactive
in class AbstractQueryManager
SQLException
protected void deleteOlderData(Connection dbConn, Timestamp now, int nodeid) throws SQLException
deleteOlderData
in class AbstractQueryManager
SQLException
public void update(int nodeid, char status) throws SQLException
update
nodeid
- a int.status
- a char.SQLException
- if any.protected List<Integer> getNodeidFromIp(Connection dbConn, InetAddress ipaddr) throws SQLException
getNodeidFromIp
in class AbstractQueryManager
SQLException
protected RouterInterface getNodeidMaskFromIp(Connection dbConn, InetAddress ipaddr) throws SQLException
getNodeidMaskFromIp
in class AbstractQueryManager
SQLException
protected RouterInterface getNodeFromIp(Connection dbConn, InetAddress ipaddr) throws SQLException
getNodeFromIp
in class AbstractQueryManager
SQLException
protected int getSnmpIfType(Connection dbConn, int nodeid, Integer ifindex) throws SQLException
getSnmpIfType
in class AbstractQueryManager
SQLException
protected int getIfIndexByName(Connection dbConn, int nodeid, String ifName) throws SQLException
getIfIndexByName
in class AbstractQueryManager
SQLException
public LinkableNode getSnmpNode(int nodeid) throws SQLException
getSnmpNode
nodeid
- a int.LinkableNode
object.SQLException
- if any.public List<LinkableNode> getSnmpNodeList() throws SQLException
getSnmpNodeList
List
object.SQLException
- if any.public void updateDeletedNodes() throws SQLException
updateDeletedNodes
SQLException
- if any.public void updateForInterface(int nodeId, String ipAddr, int ifIndex, char status) throws SQLException
updateForInterface
nodeId
- a int.ipAddr
- a String
object.ifIndex
- a int.status
- a char.SQLException
- if any.public NodeDao getNodeDao()
getNodeDao
in class AbstractQueryManager
public void setNodeDao(NodeDao nodeDao)
public IpInterfaceDao getIpInterfaceDao()
getIpInterfaceDao
in class AbstractQueryManager
public void setIpInterfaceDao(IpInterfaceDao dao)
public SnmpInterfaceDao getSnmpInterfaceDao()
getSnmpInterfaceDao
in class AbstractQueryManager
public void setSnmpInterfaceDao(SnmpInterfaceDao snmpInterfaceDao)
public AtInterfaceDao getAtInterfaceDao()
getAtInterfaceDao
in class AbstractQueryManager
public void setAtInterfaceDao(AtInterfaceDao dao)
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
protected void saveIpRouteInterface(Connection dbConn, OnmsIpRouteInterface ipRouteInterface) throws SQLException
saveIpRouteInterface
in class AbstractQueryManager
SQLException
protected void saveVlan(Connection dbConn, OnmsVlan vlan) throws SQLException
saveVlan
in class AbstractQueryManager
SQLException
protected void saveStpNode(Connection dbConn, OnmsStpNode stpNode) throws SQLException
saveStpNode
in class AbstractQueryManager
SQLException
protected void saveStpInterface(Connection dbConn, OnmsStpInterface stpInterface) throws SQLException
saveStpInterface
in class AbstractQueryManager
SQLException
protected List<String> getPhysAddrs(int nodeId, DBUtils d, Connection dbConn) throws SQLException
getPhysAddrs
in class AbstractQueryManager
SQLException
protected Integer getFromSysnameIpAddress(String lldpRemSysname, InetAddress lldpRemPortid)
getFromSysnameIpAddress
in class AbstractQueryManager
Copyright © 2015. All Rights Reserved.