Fix: Run both sonar and clm scans in parallel
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / resource-resolution / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / functions / resource / resolution / ResourceAssignmentRuntimeService.kt
index 69db6cf..1710c48 100644 (file)
@@ -1,15 +1,16 @@
 package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
 
 import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
+import java.util.concurrent.ConcurrentHashMap
 
-class ResourceAssignmentRuntimeService(private var id: String, private var bluePrintContext: BlueprintContext) :
-    DefaultBlueprintRuntimeService(id, bluePrintContext) {
+class ResourceAssignmentRuntimeService(private var id: String, private var bluePrintContext: BluePrintContext) :
+    DefaultBluePrintRuntimeService(id, bluePrintContext) {
 
     private lateinit var resolutionId: String
-    private var resourceStore: MutableMap<String, JsonNode> = hashMapOf()
+    private var resourceStore: MutableMap<String, JsonNode> = ConcurrentHashMap()
 
     fun createUniqueId(key: String) {
         resolutionId = "$id-$key"
@@ -29,7 +30,7 @@ class ResourceAssignmentRuntimeService(private var id: String, private var blueP
 
     fun getResolutionStore(key: String): JsonNode {
         return resourceStore[key]
-            ?: throw BlueprintProcessorException("failed to get execution property ($key)")
+            ?: throw BluePrintProcessorException("failed to get execution property ($key)")
     }
 
     fun checkResolutionStore(key: String): Boolean {
@@ -62,7 +63,7 @@ class ResourceAssignmentRuntimeService(private var id: String, private var blueP
 
     fun getDictionaryStore(key: String): JsonNode {
         return resourceStore["dictionary-$key"]
-            ?: throw BlueprintProcessorException("failed to get execution property (dictionary-$key)")
+            ?: throw BluePrintProcessorException("failed to get execution property (dictionary-$key)")
     }
 
     fun checkDictionaryStore(key: String): Boolean {