Merge "Updated OLM module to support 7.1 devices"
[transportpce.git] / olm / src / main / java / org / opendaylight / transportpce / olm / util / OlmUtils.java
index 47598be64ba7cb53b0e7d3316cbf649ff44e81ab..ff1d08e8ced19d6d94f8fdd96d5679492223e802 100644 (file)
@@ -76,10 +76,19 @@ public final class OlmUtils {
         LOG.info("Getting PM Data for NodeId: {} ResourceType: {} ResourceName: {}", input.getNodeId(),
             input.getResourceType(), input.getResourceIdentifier());
         GetPmOutputBuilder pmOutputBuilder;
-        if (openRoadmVersion.getIntValue() == 1) {
-            pmOutputBuilder = OlmUtils121.pmFetch(input, deviceTransactionManager);
-        } else {
-            pmOutputBuilder = OlmUtils22.pmFetch(input, deviceTransactionManager);
+        switch (openRoadmVersion.getIntValue()) {
+            case 1:
+                pmOutputBuilder = OlmUtils121.pmFetch(input, deviceTransactionManager);
+                break;
+            case 2:
+                pmOutputBuilder = OlmUtils221.pmFetch(input, deviceTransactionManager);
+                break;
+            case 3:
+                pmOutputBuilder = OlmUtils710.pmFetch(input, deviceTransactionManager);
+                break;
+            default:
+                LOG.error("Unrecognized OpenRoadm version");
+                pmOutputBuilder = new GetPmOutputBuilder();
         }
         return pmOutputBuilder;
     }