fix inventory SLF4J SpotBugs issues 05/91105/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 4 May 2020 09:30:14 +0000 (11:30 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 10 Jul 2020 12:42:59 +0000 (14:42 +0200)
JIRA: TRNSPRTPCE-207 TRNSPRTPCE-241 TRNSPRTPCE-265
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I4a2b4614f2f760cd83a1f5bd491c706f9dae8b44

inventory/src/main/java/org/opendaylight/transportpce/inventory/DeviceInventory.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/INode.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/INode121.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/INode221.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/listener/DeviceConfigListener.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/listener/DeviceListener.java

index 07ad030675e6acd9eb3614297d0d492bbb8f1ecc..2b6a2f9e99fd2c14135000d00023a3d5fb8225b4 100644 (file)
@@ -82,7 +82,7 @@ public class DeviceInventory {
             LOG.debug("Statment {}, returned {}", INSERT_ALARM_STRING, count);
             statement.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing Alarm into DB", e);
         }
         return count;
     }
index 4255263817b77074b9e954365b9fc0d9d75475e0..2d8bdd56cb7bee12de6d9876b28d6874b331c4f1 100644 (file)
@@ -46,7 +46,7 @@ public class INode {
         int nodeExists = 0;
         LOG.info("Checking if {} exists in DB", nodeId);
         try (Connection connection = dataSource.getConnection();
-             PreparedStatement preparedStmt = connection.prepareStatement(selectTableSQL)) {
+                PreparedStatement preparedStmt = connection.prepareStatement(selectTableSQL)) {
             preparedStmt.setString(1, nodeId);
             try (ResultSet rs = preparedStmt.executeQuery()) {
                 while (rs.next()) {
@@ -55,7 +55,7 @@ public class INode {
                 }
             }
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when fetching node in DB", e);
         }
         return nodeExists == 0 ? false : true;
     }
@@ -74,7 +74,7 @@ public class INode {
                 }
             }
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when fetching data in DB", e);
         }
         return dataExists == 0 ? false : true;
     }
index 32d25c4a2726089b3a421524d108af421f17f232..79255020ffb39de62aad22c66c586ff2bd139c58 100644 (file)
@@ -89,7 +89,7 @@ public class INode121 {
         String query = Queries.getQuery().deviceInfoInsert().get();
         LOG.info("Running {} query ", query);
         try (Connection connection = dataSource.getConnection();
-             PreparedStatement preparedStatement = connection.prepareStatement(query)) {
+                PreparedStatement preparedStatement = connection.prepareStatement(query)) {
             Object[] prepareParameters = prepareDeviceInfoParameters(deviceInfo);
             for (int i = 0; i < prepareParameters.length; i++) {
                 LOG.debug("Parameter {} has value {}", i + 1, prepareParameters[i]);
@@ -148,12 +148,8 @@ public class INode121 {
             persistDevConnectionMap(deviceId, connection);
             LOG.debug("iNode persist Connection Map call complete");
 
-        } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (InterruptedException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+        } catch (SQLException | InterruptedException | ExecutionException e) {
+            LOG.error("Something wrong when storing node into DB", e);
         }
         return sqlResult;
     }
@@ -172,7 +168,7 @@ public class INode121 {
                 }
             }
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when fetching node in DB", e);
         }
         return nodeExists == 0 ? false : true;
     }
@@ -200,7 +196,7 @@ public class INode121 {
                 persistShelves(nodeId, connection, shelve);
             }
         } catch (SQLException e1) {
-            LOG.error(e1.getMessage(), e1);
+            LOG.error("Something wrong when fetching ROADM shelves in DB", e1);
         }
     }
 
@@ -232,7 +228,7 @@ public class INode121 {
                 persistCircuitPacks(nodeId, connection, cp);
             }
         } catch (SQLException e1) {
-            LOG.error(e1.getMessage(), e1);
+            LOG.error("Something wrong when fetching Circuit Packs in DB", e1);
         }
     }
 
@@ -247,7 +243,7 @@ public class INode121 {
             stmt.execute();
             stmt.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing Circuit Packs in DB", e);
         }
     }
 
@@ -262,7 +258,7 @@ public class INode121 {
             preparedStmt.execute();
             preparedStmt.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing shelves in DB", e);
         }
     }
 
@@ -288,7 +284,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing shelves slots in DB", e);
             }
         }
     }
@@ -317,7 +313,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing Cirtcuits Packs slots in DB", e);
             }
         }
     }
@@ -616,7 +612,7 @@ public class INode121 {
                 preparedStmt.execute();
                 preparedStmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing Cirtcuits Packs Ports in DB", e);
             }
         }
     }
@@ -1037,7 +1033,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interfaces in DB", e);
             }
         }
     }
@@ -1080,7 +1076,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols in DB", e);
             }
         }
     }
@@ -1120,7 +1116,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP Port config in DB", e);
             }
 
         }
@@ -1181,7 +1177,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices protocols LLDP list number in DB", e);
                 }
 
             }
@@ -1268,7 +1264,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP", e);
             }
 
         }
@@ -1304,7 +1300,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP bridge port", e);
             }
 
         }
@@ -1351,7 +1347,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP bridge port attributes", e);
             }
 
         }
@@ -1402,7 +1398,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices internal links", e);
                 }
 
             }
@@ -1457,7 +1453,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices external links", e);
                 }
 
             }
@@ -1507,7 +1503,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices physical links", e);
                 }
 
             }
@@ -1570,7 +1566,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices degrees", e);
                 }
 
             }
@@ -1603,7 +1599,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices degrees circuit packs", e);
             }
 
         }
@@ -1637,7 +1633,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices degrees connection ports", e);
             }
 
         }
@@ -1696,7 +1692,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices SRG", e);
                 }
 
             }
@@ -1730,7 +1726,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices SRG circuit packs", e);
             }
 
         }
@@ -1785,7 +1781,7 @@ public class INode121 {
                     stmt.execute();
                     stmt.clearParameters();
                 } catch (SQLException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("Something wrong when storing devices ROADM connection ", e);
                 }
 
             }
@@ -1827,7 +1823,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices connection map", e);
             }
 
         }
@@ -1865,7 +1861,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices wavelength map", e);
             }
 
         }
@@ -1891,7 +1887,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface tcm", e);
             }
         }
     }
@@ -1915,7 +1911,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Tx MSI", e);
             }
         }
     }
@@ -1940,7 +1936,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Rx MSI", e);
             }
         }
     }
@@ -1965,7 +1961,7 @@ public class INode121 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Exp MSI", e);
             }
         }
     }
index b6d54b6d6465b632b0c4e4b9d9cfd445b730ab93..7e24aafd8225e8d5548417cba7c908a4152f92d7 100644 (file)
@@ -87,7 +87,7 @@ public class INode221 {
         String query = Queries.getQuery().deviceInfoInsert().get();
         LOG.info("Running {} query ", query);
         try (Connection connection = dataSource.getConnection();
-             PreparedStatement preparedStatement = connection.prepareStatement(query)) {
+                PreparedStatement preparedStatement = connection.prepareStatement(query)) {
             Object[] prepareParameters = prepareDeviceInfoParameters(deviceInfo);
             for (int i = 0; i < prepareParameters.length; i++) {
                 LOG.debug("Parameter {} has value {}", i + 1, prepareParameters[i]);
@@ -148,12 +148,8 @@ public class INode221 {
             persistDevConnectionMap(deviceId, connection);
             LOG.debug("iNode persist Connection Map call complete");
 
-        } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (InterruptedException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+        } catch (SQLException | InterruptedException | ExecutionException e) {
+            LOG.error("Something wrong when storing node into DB", e);
         }
         return sqlResult;
     }
@@ -172,7 +168,7 @@ public class INode221 {
                 }
             }
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when fetching node in DB", e);
         }
         return nodeExists == 0 ? false : true;
     }
@@ -201,7 +197,7 @@ public class INode221 {
                 persistShelves(nodeId, connection, shelve);
             }
         } catch (SQLException e1) {
-            LOG.error(e1.getMessage(), e1);
+            LOG.error("Something wrong when fetching ROADM shelves in DB", e1);
         }
     }
 
@@ -231,7 +227,7 @@ public class INode221 {
                 persistCircuitPacks(nodeId, connection, cp);
             }
         } catch (SQLException e1) {
-            LOG.error(e1.getMessage(), e1);
+            LOG.error("Something wrong when fetching Circuit Packs in DB", e1);
         }
     }
 
@@ -246,7 +242,7 @@ public class INode221 {
             stmt.execute();
             stmt.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing Circuit Packs in DB", e);
         }
     }
 
@@ -261,7 +257,7 @@ public class INode221 {
             preparedStmt.execute();
             preparedStmt.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing shelves in DB", e);
         }
     }
 
@@ -287,7 +283,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing shelves slots in DB", e);
             }
         }
     }
@@ -315,7 +311,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing Cirtcuits Packs slots in DB", e);
             }
         }
     }
@@ -593,7 +589,7 @@ public class INode221 {
                 preparedStmt.execute();
                 preparedStmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing Cirtcuits Packs Ports in DB", e);
             }
         }
     }
@@ -1015,7 +1011,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interfaces in DB", e);
             }
         }
     }
@@ -1061,7 +1057,7 @@ public class INode221 {
             stmt.execute();
             stmt.clearParameters();
         } catch (SQLException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Something wrong when storing devices protocols in DB", e);
         }
 
     }
@@ -1102,7 +1098,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP Port config in DB", e);
             }
 
         }
@@ -1157,7 +1153,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP list number in DB", e);
             }
 
         }
@@ -1243,7 +1239,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP", e);
             }
 
         }
@@ -1279,7 +1275,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP bridge port", e);
             }
 
         }
@@ -1326,7 +1322,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices protocols LLDP RSTP bridge port attributes", e);
             }
 
         }
@@ -1368,7 +1364,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices internal links", e);
             }
 
         }
@@ -1414,7 +1410,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices external links", e);
             }
 
         }
@@ -1455,7 +1451,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices physical links", e);
             }
 
         }
@@ -1505,7 +1501,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices degrees", e);
             }
 
         }
@@ -1537,7 +1533,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices degrees circuit packs", e);
             }
 
         }
@@ -1571,7 +1567,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices degrees connection ports", e);
             }
 
         }
@@ -1621,7 +1617,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices SRG", e);
             }
 
         }
@@ -1653,7 +1649,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices SRG circuit packs", e);
             }
 
         }
@@ -1690,6 +1686,7 @@ public class INode221 {
                 startTimestamp
             };
 
+
             String query = Queries.getQuery().deviceRoadmConnectionsInsert().get();
             LOG.info("Running {} query ", query);
             try (PreparedStatement stmt = connection.prepareStatement(query)) {
@@ -1699,7 +1696,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices ROADM connection ", e);
             }
 
         }
@@ -1738,7 +1735,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices connection map", e);
             }
 
         }
@@ -1780,7 +1777,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices wavelength map", e);
             }
 
         }
@@ -1807,7 +1804,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface tcm", e);
             }
         }
     }
@@ -1831,7 +1828,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Tx MSI", e);
             }
         }
     }
@@ -1856,7 +1853,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Rx MSI", e);
             }
         }
     }
@@ -1881,7 +1878,7 @@ public class INode221 {
                 stmt.execute();
                 stmt.clearParameters();
             } catch (SQLException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Something wrong when storing devices interface OTN ODU Exp MSI", e);
             }
         }
     }
index 652d6ef53dc27fd306e3fb268521cac6f7e9cb96..ae2bd2447300afe51024c5204476cdae5f68fcae 100644 (file)
@@ -46,14 +46,14 @@ public class DeviceConfigListener implements DataTreeChangeListener<Node> {
     @Override
     public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
 
-        //LOG.info("################testing np1:"+changes.toString());
+        //LOG.debug("testing np1: {}", changes.toString());
         String openROADMversion = "";
         List<DataTreeModification<Node>> changesWithoutDefaultNetconfNode = getRealDevicesOnly(changes);
         for (DataTreeModification<Node> device : changesWithoutDefaultNetconfNode) {
             DataObjectModification<Node> rootNode = device.getRootNode();
             String nodeId = rootNode.getDataAfter().key().getNodeId().getValue();
 
-            LOG.info("################nodeId {}", nodeId);
+            LOG.debug("nodeId {}", nodeId);
 
             NetconfNode netconfNode = rootNode.getDataAfter().augmentation(NetconfNode.class);
             NetconfNodeConnectionStatus.ConnectionStatus connectionStatus =
@@ -61,18 +61,16 @@ public class DeviceConfigListener implements DataTreeChangeListener<Node> {
             long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                     .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
                     .count();
-            LOG.info("################## DCL Modification Type {}",
-                device.getRootNode().getModificationType().toString());
-            LOG.info("################## DCL Capability Count {}", count);
-            LOG.info("################## DCL Connection Status {}", connectionStatus);
+            LOG.debug("DCL Modification Type {}", device.getRootNode().getModificationType().toString());
+            LOG.debug("DCL Capability Count {}", count);
+            LOG.debug("DCL Connection Status {}", connectionStatus);
             if (isCreate(device) || isUpdate(device)) {
                 LOG.info("Node {} was modified", nodeId);
                 try {
                     processModifiedSubtree(nodeId, netconfNode, openROADMversion);
                 } catch (InterruptedException | ExecutionException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("something wrong when modifying node {}", nodeId, e);
                 }
-
             } else if (isDelete(device)) {
                 LOG.info("Node {} was deleted", nodeId);
             }
index d5ba4047ee45547f7c3765c57152ca9d0d1635b5..8ff97747e54a343d4bcd18f09707de68a891349a 100644 (file)
@@ -44,7 +44,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
 
     @Override
     public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
-        //LOG.debug("testing np1:"+changes.toString());
+        //LOG.debug("testing np1: {}", changes.toString());
         String openROADMversion = "";
         List<DataTreeModification<Node>> changesWithoutDefaultNetconfNode = getRealDevicesOnly(changes);
         for (DataTreeModification<Node> device : changesWithoutDefaultNetconfNode) {
@@ -55,22 +55,18 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
             long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                     .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
                     .count();
-            LOG.info("DL ################## Modification Type {}",
-                device.getRootNode().getModificationType().toString());
-            LOG.info("DL ################## Capability Count {}", count);
-            LOG.info("DL ################## Connection Status {}", connectionStatus);
-            LOG.info("DL ################## device.getRootNode().getDataBefore() {}",
-                device.getRootNode().getDataBefore());
-            LOG.info("DL ################## device.getRootNode().getDataAfter() {}",
-                device.getRootNode().getDataAfter());
-
+            LOG.debug("DL Modification Type {}", device.getRootNode().getModificationType().toString());
+            LOG.debug("DL Capability Count {}", count);
+            LOG.debug("DL Connection Status {}", connectionStatus);
+            LOG.debug("DL device.getRootNode().getDataBefore() {}", device.getRootNode().getDataBefore());
+            LOG.debug("DL device.getRootNode().getDataAfter() {}", device.getRootNode().getDataAfter());
 
             if (isCreate(device)) {
                 LOG.info("Node {} was created", nodeId);
                 try {
                     processModifiedSubtree(nodeId, netconfNode, openROADMversion);
                 } catch (InterruptedException | ExecutionException e) {
-                    LOG.error(e.getMessage(), e);
+                    LOG.error("something wrong when creating node {}", nodeId, e);
                 }
             } else if (isDelete(device)) {
                 LOG.info("Node {} was deleted", nodeId);