Refactor: few renames in renderer 13/96913/8
authorGilles Thouenon <gilles.thouenon@orange.com>
Wed, 23 Jun 2021 08:16:47 +0000 (10:16 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 30 Jul 2021 16:01:53 +0000 (18:01 +0200)
Rename some methods links to transportpce yang models to be more
explicit.

JIRA: TRNSPRTPCE-490
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I7ddf7aebac80842473abf9051aa1a344e74a2073

renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/NodeLists.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/tasks/DeviceRenderingTask.java

index d4445c8845bbdc8a7c05bb2dbe088b8e504df55c..09c6f3391c79a8778f6a92ff94f5b94596f01a34 100644 (file)
@@ -120,7 +120,7 @@ public final class ModelMappingUtils {
         ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
             .setServiceName(serviceName)
             .setOperation(Action.Create)
-            .setNodes(nodeLists.getList())
+            .setNodes(nodeLists.getRendererNodeList())
             .setWidth(new FrequencyGHz(GridConstant.WIDTH_40));
         if (atoZDirection.getAToZWavelengthNumber() != null) {
             servicePathInputBuilder
@@ -172,7 +172,7 @@ public final class ModelMappingUtils {
         ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
             .setOperation(Action.Create)
             .setServiceName(serviceName)
-            .setNodes(nodeLists.getList())
+            .setNodes(nodeLists.getRendererNodeList())
             .setWidth(new FrequencyGHz(GridConstant.WIDTH_40));
         if (ztoADirection.getZToAWavelengthNumber() != null) {
             servicePathInputBuilder
@@ -224,8 +224,8 @@ public final class ModelMappingUtils {
         if (!asideToZside) {
             nodeLists = getNodesListZtoA(pathDescription.getZToADirection().nonnullZToA().values().iterator());
         }
-        LOG.info("These are node-lists {}, {}", nodeLists.getList(), nodeLists.getOlmList());
-        for (Nodes node: nodeLists.getList()) {
+        LOG.info("These are node-lists {}, {}", nodeLists.getRendererNodeList(), nodeLists.getOlmNodeList());
+        for (Nodes node: nodeLists.getRendererNodeList()) {
             nodes.add(new org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.otn.renderer.nodes
                 .NodesBuilder()
                             .setNodeId(node.getNodeId())
index a36924525434b6144e1c39cc9fc74458e098cc0d..e429daef48b4376ecbbfab4f8258075a44b7b3b8 100644 (file)
@@ -12,20 +12,20 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618
 
 public class NodeLists {
 
-    private List<Nodes> olmList;
-    private List<Nodes> list;
+    private List<Nodes> olmNodeList;
+    private List<Nodes> rendererNodelist;
 
     public NodeLists(List<Nodes> olmList, List<Nodes> list) {
-        this.olmList = olmList;
-        this.list = list;
+        this.olmNodeList = olmList;
+        this.rendererNodelist = list;
     }
 
-    public List<Nodes> getOlmList() {
-        return olmList;
+    public List<Nodes> getOlmNodeList() {
+        return olmNodeList;
     }
 
-    public List<Nodes> getList() {
-        return list;
+    public List<Nodes> getRendererNodeList() {
+        return rendererNodelist;
     }
 
 }
index 59cdd31b2a7c5e7b72938257c7760c9d99a96491..f7158ad6aa17202da715cda42ef39f00bc6f3d7e 100644 (file)
@@ -142,7 +142,7 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
                     case StringConstants.SERVICE_TYPE_400GE:
                     case StringConstants.SERVICE_TYPE_OTU4:
                     case StringConstants.SERVICE_TYPE_OTUC4:
-                        if (!createServicepathInput(input)) {
+                        if (!manageServicePathCreation(input)) {
                             return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
                                 OPERATION_FAILED);
                         }
@@ -536,7 +536,7 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
     @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
         value = "UPM_UNCALLED_PRIVATE_METHOD",
         justification = "call in call() method")
-    private boolean createServicepathInput(ServiceImplementationRequestInput input) {
+    private boolean manageServicePathCreation(ServiceImplementationRequestInput input) {
         ServicePathInputData servicePathInputDataAtoZ = ModelMappingUtils
             .rendererCreateServiceInputAToZ(input.getServiceName(), input.getPathDescription());
         ServicePathInputData servicePathInputDataZtoA = ModelMappingUtils
index 329ed2186fc924917212a858e8b5dbd2d89e3605..fe83c8a9b8be62a989609b365a2f0f2eac8190a3 100644 (file)
@@ -42,7 +42,7 @@ public class DeviceRenderingTask implements Callable<DeviceRenderingResult> {
             LOG.warn("Device rendering not successfully finished.");
             return DeviceRenderingResult.failed("Operation Failed");
         }
-        List<Nodes> olmList = this.servicePathInputData.getNodeLists().getOlmList();
+        List<Nodes> olmList = this.servicePathInputData.getNodeLists().getOlmNodeList();
         LOG.info("Device rendering finished successfully.");
         return DeviceRenderingResult.ok(olmList, new ArrayList<>(output.nonnullNodeInterface().values()));
     }