org.opennms.netmgt.linkd
Class DbEventWriter

java.lang.Object
  extended by org.opennms.netmgt.linkd.DbEventWriter
All Implemented Interfaces:
QueryManager

public class DbEventWriter
extends Object
implements QueryManager

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

Version:
$Id: $
Author:
antonio

Field Summary
 
Fields inherited from interface org.opennms.netmgt.linkd.QueryManager
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 Summary
DbEventWriter()
          Constructor for DbEventWriter.
 
Method Summary
 Linkd getLinkd()
           
 LinkableNode getSnmpNode(int nodeid)
          getSnmpNode
 List<LinkableNode> getSnmpNodeList()
          getSnmpNodeList
 String getSnmpPrimaryIp(int nodeid)
          getSnmpPrimaryIp
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
          setJdbcTemplate
 void setLinkd(Linkd linkd)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbEventWriter

public DbEventWriter()

Constructor for DbEventWriter.

Method Detail

setLinkd

public void setLinkd(Linkd linkd)
Parameters:
linkd - the linkd to set

getLinkd

public Linkd getLinkd()

storeDiscoveryLink

public void storeDiscoveryLink(DiscoveryLink discovery)
                        throws SQLException

storeDiscoveryLink

Specified by:
storeDiscoveryLink in interface QueryManager
Parameters:
discovery - a DiscoveryLink object.
Throws:
SQLException - if any.

storeSnmpCollection

public LinkableNode storeSnmpCollection(LinkableNode node,
                                        SnmpCollection snmpcoll)
                                 throws SQLException

storeSnmpCollection

Specified by:
storeSnmpCollection in interface QueryManager
Parameters:
node - a LinkableNode object.
snmpcoll - a SnmpCollection object.
Returns:
a LinkableNode object.
Throws:
SQLException - if any.

update

public void update(int nodeid,
                   char status)
            throws SQLException

update

Specified by:
update in interface QueryManager
Parameters:
nodeid - a int.
status - a char.
Throws:
SQLException - if any.

getSnmpNode

public LinkableNode getSnmpNode(int nodeid)
                         throws SQLException

getSnmpNode

Specified by:
getSnmpNode in interface QueryManager
Parameters:
nodeid - a int.
Returns:
a LinkableNode object.
Throws:
SQLException - if any.

getSnmpNodeList

public List<LinkableNode> getSnmpNodeList()
                                   throws SQLException

getSnmpNodeList

Specified by:
getSnmpNodeList in interface QueryManager
Returns:
a List object.
Throws:
SQLException - if any.

updateDeletedNodes

public void updateDeletedNodes()
                        throws SQLException

updateDeletedNodes

Specified by:
updateDeletedNodes in interface QueryManager
Throws:
SQLException - if any.

updateForInterface

public void updateForInterface(int nodeId,
                               String ipAddr,
                               int ifIndex,
                               char status)
                        throws SQLException

updateForInterface

Specified by:
updateForInterface in interface QueryManager
Parameters:
nodeId - a int.
ipAddr - a String object.
ifIndex - a int.
status - a char.
Throws:
SQLException - if any.

getSnmpPrimaryIp

public String getSnmpPrimaryIp(int nodeid)
                        throws SQLException

getSnmpPrimaryIp

Specified by:
getSnmpPrimaryIp in interface QueryManager
Parameters:
nodeid - a int.
Returns:
a String object.
Throws:
SQLException - if any.

setJdbcTemplate

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

setJdbcTemplate

Specified by:
setJdbcTemplate in interface QueryManager
Parameters:
jdbcTemplate - a JdbcTemplate object.


Copyright © 2011. All Rights Reserved.