Use Set for Subnet's NodeConnectors
[controller.git] / opendaylight / web / devices / src / main / java / org / opendaylight / controller / devices / web / Devices.java
index e6a785f5868044bb4c82831225dd509e04abb92b..37798ac137f36a7a4014dc84c45f523fe2b8d860 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.devices.web;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -236,8 +237,10 @@ public class Devices implements IDaylightWeb {
             nodeProperties.put(desc.getName(), desc);
             Property nodeTier = new Tier(Integer.parseInt(tier));
             nodeProperties.put(nodeTier.getName(), nodeTier);
-            Property mode = new ForwardingMode(Integer.parseInt(operationMode));
-            nodeProperties.put(mode.getName(), mode);
+            if (containerName.equals(GlobalConstants.DEFAULT.toString())) {
+                Property mode = new ForwardingMode(Integer.parseInt(operationMode));
+                nodeProperties.put(mode.getName(), mode);
+            }
             SwitchConfig cfg = new SwitchConfig(nodeId, nodeProperties);
             Status result = switchManager.updateNodeConfig(cfg);
             if (!result.isSuccess()) {
@@ -436,7 +439,7 @@ public class Devices implements IDaylightWeb {
             ISwitchManager switchManager = (ISwitchManager) ServiceHelper
                     .getInstance(ISwitchManager.class, containerName, this);
             SubnetConfig cfgObject = new SubnetConfig(gatewayName,
-                    gatewayIPAddress, new ArrayList<String>());
+                    gatewayIPAddress, new HashSet<String>());
             Status result = switchManager.addSubnet(cfgObject);
             if (result.isSuccess()) {
                 resultBean.setStatus(true);