Refactoring Code to remove NRM

Renaming Classes, API's, variabled and removing NRM word from codebase

Issue-ID: CCSDK-3741
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I8150eec7e8fb0bc1d33e80991215e745e9aa79d0
(cherry picked from commit cc2dbf6d08840ba0e105e44022568d9afd130273)
diff --git a/ms/blueprintsprocessor/functions/restful-executor/pom.xml b/ms/blueprintsprocessor/functions/restful-executor/pom.xml
index ed0fdc9..9c154f1 100644
--- a/ms/blueprintsprocessor/functions/restful-executor/pom.xml
+++ b/ms/blueprintsprocessor/functions/restful-executor/pom.xml
@@ -26,8 +26,8 @@
     <groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
     <artifactId>restful-executor</artifactId>
 
-    <name>MS Blueprints Processor Functions - NRM Restful executor</name>
-    <description>Blueprints Processor Function - NRM Restful executor</description>
+    <name>MS Blueprints Processor Functions - Restful executor</name>
+    <description>Blueprints Processor Function - Restful executor</description>
 
     <dependencies>
         <dependency>
diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt
index 9cd6f57..6b5af80 100644
--- a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt
+++ b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt
@@ -20,7 +20,7 @@
 import com.fasterxml.jackson.databind.node.ArrayNode
 import com.fasterxml.jackson.databind.node.ObjectNode
 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction.RestfulNRMServiceClient
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.function.RestfulServiceClient
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
@@ -49,7 +49,7 @@
 
     fun processNRM(executionRequest: ExecutionServiceInput, input_params: ArrayNode): String {
         // process the managed object instances
-        log.info("Processing NRM Object")
+        log.info("Processing Object")
         operationInputs = executionServiceInput.stepData!!.properties
         val dynamic_properties = operationInputs.get("dynamic-properties")
         // instantiate one restClientService instance
@@ -75,9 +75,9 @@
                 for (managed_object_instance in managed_object_instances) {
                     // invoke createMOI for each managed-object-instance
                     log.info("invoke createMOI for each managed-object-instance")
-                    var NRM_Restful_client = RestfulNRMServiceClient()
-                    val MOI_id = NRM_Restful_client.generateMOIid()
-                    var httpresponse = NRM_Restful_client.createMOI(web_client_service, MOI_id, managed_object_instance)
+                    var Restful_client = RestfulServiceClient()
+                    val MOI_id = Restful_client.generateMOIid()
+                    var httpresponse = Restful_client.createMOI(web_client_service, MOI_id, managed_object_instance)
                     var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
                     response.put("/$MOIname/$MOI_id", httpresponse)
                 }
@@ -86,9 +86,9 @@
                 for (managed_object_instance in managed_object_instances) {
                     // invoke getMOIAttributes for each managed-object-instance
                     log.info("invoke getMOIAttributes for each managed-object-instance")
-                    var NRM_Restful_client = RestfulNRMServiceClient()
+                    var Restful_client = RestfulServiceClient()
                     val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
-                    var httpresponse = NRM_Restful_client.getMOIAttributes(web_client_service, MOI_id, managed_object_instance)
+                    var httpresponse = Restful_client.getMOIAttributes(web_client_service, MOI_id, managed_object_instance)
                     var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
                     response.put("/$MOIname/$MOI_id", httpresponse)
                 }
@@ -97,9 +97,9 @@
                 for (managed_object_instance in managed_object_instances) {
                     // invoke modifyMOIAttributes for each managed-object-instance
                     log.info("invoke modifyMOIAttributes for each managed-object-instance")
-                    var NRM_Restful_client = RestfulNRMServiceClient()
+                    var Restful_client = RestfulServiceClient()
                     val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
-                    var httpresponse = NRM_Restful_client.modifyMOIAttributes(web_client_service, MOI_id, managed_object_instance)
+                    var httpresponse = Restful_client.modifyMOIAttributes(web_client_service, MOI_id, managed_object_instance)
                     var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
                     response.put("/$MOIname/$MOI_id", httpresponse)
                 }
@@ -108,9 +108,9 @@
                 for (managed_object_instance in managed_object_instances) {
                     // invoke deleteMOI for each managed-object-instance
                     log.info("invoke deleteMOI for each managed-object-instance")
-                    var NRM_Restful_client = RestfulNRMServiceClient()
+                    var Restful_client = RestfulServiceClient()
                     val MOI_id = managed_object_instance.get("id").toString().replace("\"", "")
-                    var httpresponse = NRM_Restful_client.deleteMOI(web_client_service, MOI_id, managed_object_instance)
+                    var httpresponse = Restful_client.deleteMOI(web_client_service, MOI_id, managed_object_instance)
                     var MOIname = managed_object_instance.get("className").toString().replace("\"", "")
                     response.put("/$MOIname/$MOI_id", httpresponse)
                 }
@@ -120,7 +120,6 @@
                 response.put(this.workflowName, "Not Implemented")
             }
         }
-        val strresponse = "$response"
-        return strresponse
+        return "$response"
     }
 }
diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/nrmfunction/RestfulNRMServiceClient.kt b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/function/RestfulServiceClient.kt
similarity index 97%
rename from ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/nrmfunction/RestfulNRMServiceClient.kt
rename to ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/function/RestfulServiceClient.kt
index 259670d..8b3fd2a 100644
--- a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/nrmfunction/RestfulNRMServiceClient.kt
+++ b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/function/RestfulServiceClient.kt
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.function
 
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.ObjectMapper
@@ -26,9 +26,9 @@
 import org.springframework.web.util.UriComponentsBuilder
 import java.util.UUID
 
-class RestfulNRMServiceClient() {
+class RestfulServiceClient() {
 
-    private val log = logger(RestfulNRMServiceClient::class.java)
+    private val log = logger(RestfulServiceClient::class.java)
 
     fun createMOI(web_client_service: BlueprintWebClientService, idStr: String, managed_object_instance: JsonNode): ObjectNode {
         val classNameStr = managed_object_instance.get("className").toString().replace("\"", "")
diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/function/RestfulServiceClientTest.kt
similarity index 89%
rename from ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt
rename to ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/function/RestfulServiceClientTest.kt
index 6f76c9b..e450d11 100644
--- a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt
+++ b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/function/RestfulServiceClientTest.kt
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.function
 
 import com.fasterxml.jackson.databind.node.ObjectNode
 import org.junit.Ignore
@@ -55,22 +55,22 @@
 )
 
 @Ignore
-class RestfulNRMServiceClientTest {
+class RestfulServiceClientTest {
 
     @Autowired
-    lateinit var restfulNRMServiceClient: RestfulNRMServiceClient
+    lateinit var restfulServiceClient: RestfulServiceClient
     lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService
 
     @Test
     fun testCreateMOI() {
         val restClientService = bluePrintRestLibPropertyService.blueprintWebClientService("nrm")
-        val idStr = restfulNRMServiceClient.generateMOIid()
+        val idStr = restfulServiceClient.generateMOIid()
         var test_moi_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_moi_data.put("className", "TestMangedObjectInstance")
         var test_attributes_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_attributes_data.put("test_attribute_key", "test_attribute_value")
         test_moi_data.put("data", test_attributes_data)
-        val response = restfulNRMServiceClient.createMOI(restClientService, idStr, test_moi_data)
+        val response = restfulServiceClient.createMOI(restClientService, idStr, test_moi_data)
         assertNotNull(response, "failed to get createMOI response")
         assertEquals("Create MOI object successfully", response.get("body").get("data").toString(), "failed to get createMOI response")
     }
@@ -78,13 +78,13 @@
     @Test
     fun testGetMOIAttributes() {
         val restClientService = bluePrintRestLibPropertyService.blueprintWebClientService("nrm")
-        val idStr = restfulNRMServiceClient.generateMOIid()
+        val idStr = restfulServiceClient.generateMOIid()
         var test_moi_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_moi_data.put("className", "TestMangedObjectInstance")
         test_moi_data.put("scope", "BASE_ONLY")
         test_moi_data.put("filter", "TestMangedObjectInstance")
         test_moi_data.put("fields", "test_attribute_key")
-        val response = restfulNRMServiceClient.getMOIAttributes(restClientService, idStr, test_moi_data)
+        val response = restfulServiceClient.getMOIAttributes(restClientService, idStr, test_moi_data)
         assertNotNull(response, "failed to get getMOIAttributes response")
         assertEquals("Get MOI object attributes successfully", response.get("body").get("data").toString(), "failed to get getMOIAttributes response")
     }
@@ -92,7 +92,7 @@
     @Test
     fun testModifyMOIAttributes() {
         val restClientService = bluePrintRestLibPropertyService.blueprintWebClientService("nrm")
-        val idStr = restfulNRMServiceClient.generateMOIid()
+        val idStr = restfulServiceClient.generateMOIid()
         var test_moi_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_moi_data.put("className", "TestMangedObjectInstance")
         test_moi_data.put("scope", "BASE_ONLY")
@@ -100,7 +100,7 @@
         var test_attributes_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_attributes_data.put("test_attribute_key", "modified_attribute_value")
         test_moi_data.put("data", test_attributes_data)
-        val response = restfulNRMServiceClient.modifyMOIAttributes(restClientService, idStr, test_moi_data)
+        val response = restfulServiceClient.modifyMOIAttributes(restClientService, idStr, test_moi_data)
         assertNotNull(response, "failed to get modifyMOIAttributes response")
         assertEquals(
             "Modify MOI object attributes successfully",
@@ -112,12 +112,12 @@
     @Test
     fun testDeleteMOI() {
         val restClientService = bluePrintRestLibPropertyService.blueprintWebClientService("nrm")
-        val idStr = restfulNRMServiceClient.generateMOIid()
+        val idStr = restfulServiceClient.generateMOIid()
         var test_moi_data = JacksonUtils.jsonNode("{}") as ObjectNode
         test_moi_data.put("className", "TestMangedObjectInstance")
         test_moi_data.put("scope", "BASE_ONLY")
         test_moi_data.put("filter", "TestMangedObjectInstance")
-        val response = restfulNRMServiceClient.deleteMOI(restClientService, idStr, test_moi_data)
+        val response = restfulServiceClient.deleteMOI(restClientService, idStr, test_moi_data)
         assertNotNull(response, "failed to get delete response")
         assertEquals("Delete MOI object attributes successfully", response.get("body").get("data").toString(), "failed to get delete response")
     }