- if (protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList() == null) {
- LOG.error("LLDP nbrlist subtree is missing for {}", nodeId);
-
- } else {
- String startTimestamp = getCurrentTimestamp();
- Map<IfNameKey, IfName> ifNameMap =
- protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList().nonnullIfName();
- for (Map.Entry<IfNameKey, IfName> ifNameEntry : ifNameMap.entrySet()) {
-
- IfName ifNameObj = ifNameEntry.getValue();
- String ifName = ifNameObj.getIfName();
- String remotesysname = ifNameObj.getRemoteSysName();
- String remotemgmtaddresssubtype = ifNameObj.getRemoteMgmtAddressSubType().getName();
- String remotemgmtaddress = ifNameObj.getRemoteMgmtAddress().getIpv4Address().toString();
- String remoteportidsubtypeEnu = ifNameObj.getRemotePortIdSubType().getName();
- String remoteportid = ifNameObj.getRemotePortId();
- String remotechassisidsubtypeEnu = ifNameObj.getRemoteChassisIdSubType().getName();
- String remotechassisid = ifNameObj.getRemoteChassisId();
-
- Object[] parameters = {nodeId,
- ifName,
- remotesysname,
- remotemgmtaddresssubtype,
- remotemgmtaddress,
- remoteportidsubtypeEnu,
- remoteportid,
- remotechassisidsubtypeEnu,
- remotechassisid,
- startTimestamp,
- startTimestamp
- };
-
- String query = Queries.getQuery().deviceProtocolLldpNbrlistInsert().get();
- LOG.info("Running {} query ", query);
- try (PreparedStatement stmt = connection.prepareStatement(query)) {
- for (int j = 0; j < parameters.length; j++) {
- stmt.setObject(j + 1, parameters[j]);
- }
- stmt.execute();
- stmt.clearParameters();
- } catch (SQLException e) {
- LOG.error("Something wrong when storing devices protocols LLDP list number in DB", e);
- }
+ String startTimestamp = getCurrentTimestamp();
+ Map<IfNameKey, IfName> ifNameMap =
+ protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList().nonnullIfName();
+ for (Map.Entry<IfNameKey, IfName> ifNameEntry : ifNameMap.entrySet()) {
+
+ IfName ifNameObj = ifNameEntry.getValue();
+ String ifName = ifNameObj.getIfName();
+ String remotesysname = ifNameObj.getRemoteSysName();
+ String remotemgmtaddresssubtype = ifNameObj.getRemoteMgmtAddressSubType().getName();
+ String remotemgmtaddress = ifNameObj.getRemoteMgmtAddress().getIpv4Address().toString();
+ String remoteportidsubtypeEnu = ifNameObj.getRemotePortIdSubType().getName();
+ String remoteportid = ifNameObj.getRemotePortId();
+ String remotechassisidsubtypeEnu = ifNameObj.getRemoteChassisIdSubType().getName();
+ String remotechassisid = ifNameObj.getRemoteChassisId();
+
+ Object[] parameters = {nodeId,
+ ifName,
+ remotesysname,
+ remotemgmtaddresssubtype,
+ remotemgmtaddress,
+ remoteportidsubtypeEnu,
+ remoteportid,
+ remotechassisidsubtypeEnu,
+ remotechassisid,
+ startTimestamp,
+ startTimestamp
+ };