Fix Checkstyle violations related to exception handling in elanmanager.
[netvirt.git] / vpnservice / elanmanager / elanmanager-impl / src / main / java / org / opendaylight / netvirt / elan / internal / ElanNodeListener.java
index 59461da6b8c3ae613a745f79322dacf6f1725068..b3eae7588bb64f0b250fd75188e0ff6a2e280825 100644 (file)
@@ -53,28 +53,20 @@ public class ElanNodeListener extends AbstractDataChangeListener<Node> implement
     }
 
     private void registerListener(final DataBroker db) {
-        try {
-            listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                getWildCardPath(), ElanNodeListener.this, AsyncDataBroker.DataChangeScope.SUBTREE);
-        } catch (final Exception e) {
-            LOG.error("ElanNodeListener: DataChange listener registration fail!", e);
-            throw new IllegalStateException("ElanNodeListener: registration Listener failed.", e);
-        }
+        listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
+            getWildCardPath(), ElanNodeListener.this, AsyncDataBroker.DataChangeScope.SUBTREE);
     }
 
     private InstanceIdentifier<Node> getWildCardPath() {
         return InstanceIdentifier.create(Nodes.class).child(Node.class);
     }
 
-
     @Override
     protected void remove(InstanceIdentifier<Node> identifier, Node del) {
-
     }
 
     @Override
     protected void update(InstanceIdentifier<Node> identifier, Node original, Node update) {
-
     }
 
     @Override
@@ -102,9 +94,9 @@ public class ElanNodeListener extends AbstractDataChangeListener<Node> implement
         mkInstructions.add(new InstructionInfo(InstructionType.goto_table, new long[] { NwConstants.ELAN_DMAC_TABLE }));
 
         List<MatchInfo> mkMatches = new ArrayList<>();
-        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE, getTableMissFlowRef(NwConstants.ELAN_SMAC_TABLE),
-            0, "ELAN sMac Table Miss Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_SMAC,
-            mkMatches, mkInstructions);
+        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE,
+                getTableMissFlowRef(NwConstants.ELAN_SMAC_TABLE), 0, "ELAN sMac Table Miss Flow", 0, 0,
+                ElanConstants.COOKIE_ELAN_KNOWN_SMAC, mkMatches, mkInstructions);
         mdsalManager.installFlow(flowEntity);
     }
 
@@ -112,11 +104,12 @@ public class ElanNodeListener extends AbstractDataChangeListener<Node> implement
         List<MatchInfo> mkMatches = new ArrayList<>();
 
         List<InstructionInfo> mkInstructions = new ArrayList<>();
-        mkInstructions.add(new InstructionInfo(InstructionType.goto_table, new long[] { NwConstants.ELAN_UNKNOWN_DMAC_TABLE }));
+        mkInstructions.add(
+                new InstructionInfo(InstructionType.goto_table, new long[] { NwConstants.ELAN_UNKNOWN_DMAC_TABLE }));
 
-        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE, getTableMissFlowRef(NwConstants.ELAN_DMAC_TABLE),
-            0, "ELAN dMac Table Miss Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC,
-            mkMatches, mkInstructions);
+        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE,
+                getTableMissFlowRef(NwConstants.ELAN_DMAC_TABLE), 0, "ELAN dMac Table Miss Flow", 0, 0,
+                ElanConstants.COOKIE_ELAN_KNOWN_DMAC, mkMatches, mkInstructions);
         mdsalManager.installFlow(flowEntity);
     }
 
@@ -129,6 +122,5 @@ public class ElanNodeListener extends AbstractDataChangeListener<Node> implement
         if (listenerRegistration != null) {
             listenerRegistration.close();
         }
-
     }
 }