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) {
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"
resourceStore[key] = value
}
+ fun getResolutionStore(): MutableMap<String, JsonNode> {
+ return resourceStore.mapValues { e -> e.value.deepCopy() as JsonNode }.toMutableMap()
+ }
+
fun getResolutionStore(key: String): JsonNode {
return resourceStore[key]
?: throw BluePrintProcessorException("failed to get execution property ($key)")