- SwitchConfig cfg = new SwitchConfig(nodeId, nodeName, tier,
- operationMode);
- switchManager.updateSwitchConfig(cfg);
- resultBean.setStatus(true);
- resultBean.setMessage("Updated node information successfully");
+ Map<String, Property> nodeProperties = new HashMap<String, Property>();
+ Property desc = new Description(nodeName);
+ nodeProperties.put(desc.getName(), desc);
+ Property nodeTier = new Tier(Integer.parseInt(tier));
+ nodeProperties.put(nodeTier.getName(), nodeTier);
+ 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()) {
+ resultBean.setStatus(false);
+ resultBean.setMessage(result.getDescription());
+ } else {
+ resultBean.setStatus(true);
+ resultBean.setMessage("Updated node information successfully");
+ DaylightWebUtil.auditlog("Node", userName, "updated", nodeId + " to "+ nodeName, containerName);
+ }