/** * Retrieves a current record from the database based upon the key fields of * <em>nodeID</em> and <em>ipAddr</em>. If the record cannot be found * then a null reference is returnd. * * @param db * The databse connection used to load the entry. * @param nid * The node id key * @param addr * The internet address. * * @return The loaded entry or null if one could not be found. * */ public static DbIpInterfaceEntry get(Connection db, long nid, InetAddress addr) throws SQLException { DbIpInterfaceEntry entry = new DbIpInterfaceEntry(nid, addr, true); if (!entry.load(db)) { entry = null; } return entry; }
DbIpInterfaceEntry ipif = DbIpInterfaceEntry.get(dbConn, nodeId, InetAddressUtils.getInetAddress(ipaddr)); if (ipif != null) { DbSnmpInterfaceEntry snmpif = DbSnmpInterfaceEntry.get(dbConn, nodeId, ipif.getIfIndex()); if (snmpif != null) ifAlias = snmpif.getAlias();
/** * Retrieves a current record from the database based upon the key fields of * <em>nodeID</em> and <em>ipAddr</em>. If the record cannot be found * then a null reference is returned. * * @param db * The database connection used to load the entry. * @param nid * The node id key * @param addr * The IP address. * @param ifIndex * The interface index. * * @return The loaded entry or null if one could not be found. * */ public static DbIpInterfaceEntry get(Connection db, long nid, InetAddress addr, int ifIndex) throws SQLException { DbIpInterfaceEntry entry = new DbIpInterfaceEntry(nid, addr, ifIndex, true); if (!entry.load(db)) { entry = null; } return entry; }