aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt14
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt10
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt8
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt48
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt12
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt54
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt104
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt12
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt12
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt30
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt20
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt4
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt20
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt10
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt36
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt22
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt72
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt6
19 files changed, 250 insertions, 250 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt
index 69db6cf8e..8087f7e3f 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt
@@ -1,12 +1,12 @@
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
-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()
@@ -29,7 +29,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 +62,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 {
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
index 66077c4ed..c755e89bf 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
@@ -16,7 +16,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertyDefinitionBuilder
@@ -24,12 +24,12 @@ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition
/** Resource Definition DSL **/
-fun BlueprintTypes.resourceDefinitions(block: ResourceDefinitionsBuilder.() -> Unit):
+fun BluePrintTypes.resourceDefinitions(block: ResourceDefinitionsBuilder.() -> Unit):
MutableMap<String, ResourceDefinition> {
return ResourceDefinitionsBuilder().apply(block).build()
}
-fun BlueprintTypes.resourceDefinition(
+fun BluePrintTypes.resourceDefinition(
name: String,
description: String,
block: ResourceDefinitionBuilder.() -> Unit
@@ -38,12 +38,12 @@ fun BlueprintTypes.resourceDefinition(
}
/** Resource Mapping DSL **/
-fun BlueprintTypes.resourceAssignments(block: ResourceAssignmentsBuilder.() -> Unit):
+fun BluePrintTypes.resourceAssignments(block: ResourceAssignmentsBuilder.() -> Unit):
MutableMap<String, ResourceAssignment> {
return ResourceAssignmentsBuilder().apply(block).build()
}
-fun BlueprintTypes.resourceAssignment(
+fun BluePrintTypes.resourceAssignment(
name: String,
dictionaryName: String,
dictionarySource: String,
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
index ada1a720e..0435d1d2c 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory
import com.fasterxml.jackson.databind.node.ObjectNode
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.asObjectNode
import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing
@@ -94,11 +94,11 @@ open class ResourceResolutionComponent(private val resourceResolutionService: Re
// validate inputs if we need to store the resource and template resolution.
if (storeResult) {
if (resolutionKey.isNotEmpty() && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) {
- throw BlueprintProcessorException("Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.")
+ throw BluePrintProcessorException("Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.")
} else if ((resourceType.isNotEmpty() && resourceId.isEmpty()) || (resourceType.isEmpty() && resourceId.isNotEmpty())) {
- throw BlueprintProcessorException("Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.")
+ throw BluePrintProcessorException("Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.")
} else if (resourceType.isEmpty() && resourceId.isEmpty() && resolutionKey.isEmpty()) {
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"Can't proceed with the resolution: can't persist resolution without a correlation key. " +
"Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false."
)
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt
index c8b9e2c87..774873a43 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt
@@ -17,8 +17,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
@@ -33,94 +33,94 @@ import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType
/** Component Extensions **/
fun ServiceTemplateBuilder.nodeTypeComponentResourceResolution() {
- val nodeType = BlueprintTypes.nodeTypeComponentResourceResolution()
+ val nodeType = BluePrintTypes.nodeTypeComponentResourceResolution()
if (this.nodeTypes == null) this.nodeTypes = hashMapOf()
this.nodeTypes!![nodeType.id!!] = nodeType
}
-fun BlueprintTypes.nodeTypeComponentResourceResolution(): NodeType {
+fun BluePrintTypes.nodeTypeComponentResourceResolution(): NodeType {
return nodeType(
- id = "component-resource-resolution", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_COMPONENT,
+ id = "component-resource-resolution", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_COMPONENT,
description = "Resource Assignment Component"
) {
attribute(
- ResourceResolutionComponent.ATTRIBUTE_ASSIGNMENT_PARAM, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.ATTRIBUTE_ASSIGNMENT_PARAM, BluePrintConstants.DATA_TYPE_STRING,
true
)
attribute(
- ResourceResolutionComponent.ATTRIBUTE_STATUS, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.ATTRIBUTE_STATUS, BluePrintConstants.DATA_TYPE_STRING,
true
)
operation("ResourceResolutionComponent", "ResourceResolutionComponent Operation") {
inputs {
property(
- ResourceResolutionComponent.INPUT_REQUEST_ID, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.INPUT_REQUEST_ID, BluePrintConstants.DATA_TYPE_STRING,
true, "Request Id, Unique Id for the request."
)
property(
- ResourceResolutionComponent.INPUT_RESOURCE_ID, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.INPUT_RESOURCE_ID, BluePrintConstants.DATA_TYPE_STRING,
false, "Resource Id."
)
property(
- ResourceResolutionComponent.INPUT_ACTION_NAME, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.INPUT_ACTION_NAME, BluePrintConstants.DATA_TYPE_STRING,
false, "Action Name of the process"
)
property(
- ResourceResolutionComponent.INPUT_DYNAMIC_PROPERTIES, BlueprintConstants.DATA_TYPE_JSON,
+ ResourceResolutionComponent.INPUT_DYNAMIC_PROPERTIES, BluePrintConstants.DATA_TYPE_JSON,
false, "Dynamic Json Content or DSL Json reference."
)
property(
- ResourceResolutionComponent.INPUT_RESOLUTION_KEY, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.INPUT_RESOLUTION_KEY, BluePrintConstants.DATA_TYPE_STRING,
false, "Key for service instance related correlation."
)
property(
- ResourceResolutionComponent.INPUT_RESOLUTION_SUMMARY, BlueprintConstants.DATA_TYPE_BOOLEAN,
+ ResourceResolutionComponent.INPUT_RESOLUTION_SUMMARY, BluePrintConstants.DATA_TYPE_BOOLEAN,
false, "Enables ResolutionSummary output"
)
property(
- ResourceResolutionComponent.INPUT_OCCURRENCE, BlueprintConstants.DATA_TYPE_INTEGER,
+ ResourceResolutionComponent.INPUT_OCCURRENCE, BluePrintConstants.DATA_TYPE_INTEGER,
false, "Number of time to perform the resolution."
) {
defaultValue(1)
}
property(
- ResourceResolutionComponent.INPUT_STORE_RESULT, BlueprintConstants.DATA_TYPE_BOOLEAN,
+ ResourceResolutionComponent.INPUT_STORE_RESULT, BluePrintConstants.DATA_TYPE_BOOLEAN,
false, "Whether or not to store the output."
)
property(
- ResourceResolutionComponent.INPUT_RESOURCE_TYPE, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.INPUT_RESOURCE_TYPE, BluePrintConstants.DATA_TYPE_STRING,
false, "Request type."
)
property(
- ResourceResolutionComponent.INPUT_ARTIFACT_PREFIX_NAMES, BlueprintConstants.DATA_TYPE_LIST,
+ ResourceResolutionComponent.INPUT_ARTIFACT_PREFIX_NAMES, BluePrintConstants.DATA_TYPE_LIST,
true, "Template , Resource Assignment Artifact Prefix names"
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
}
outputs {
property(
- ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_PARAMS, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_PARAMS, BluePrintConstants.DATA_TYPE_STRING,
true, "Output Response"
)
property(
- ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_MAP, BlueprintConstants.DATA_TYPE_MAP,
+ ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_MAP, BluePrintConstants.DATA_TYPE_MAP,
true, "Output Resolved Values"
)
property(
- ResourceResolutionComponent.OUTPUT_STATUS, BlueprintConstants.DATA_TYPE_STRING,
+ ResourceResolutionComponent.OUTPUT_STATUS, BluePrintConstants.DATA_TYPE_STRING,
true, "Status of the Component Execution ( success or failure )"
)
}
@@ -134,7 +134,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentResourceResolution(
description: String,
block: ComponentResourceResolutionNodeTemplateBuilder.() -> Unit
) {
- val nodeTemplate = BlueprintTypes.nodeTemplateComponentResourceResolution(
+ val nodeTemplate = BluePrintTypes.nodeTemplateComponentResourceResolution(
id, description,
block
)
@@ -142,7 +142,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentResourceResolution(
nodeTemplates!![nodeTemplate.id!!] = nodeTemplate
}
-fun BlueprintTypes.nodeTemplateComponentResourceResolution(
+fun BluePrintTypes.nodeTemplateComponentResourceResolution(
id: String,
description: String,
block: ComponentResourceResolutionNodeTemplateBuilder.() -> Unit
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt
index a3cc1ef18..4774ad57a 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt
@@ -20,22 +20,22 @@ import kotlinx.coroutines.runBlocking
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolution
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolutionDBService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
/**
* Register the Resolution module exposed dependency
*/
-fun BlueprintDependencyService.resourceResolutionService(): ResourceResolutionService =
+fun BluePrintDependencyService.resourceResolutionService(): ResourceResolutionService =
instance(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
-fun BlueprintDependencyService.resourceResolutionDBService(): ResourceResolutionDBService =
+fun BluePrintDependencyService.resourceResolutionDBService(): ResourceResolutionDBService =
instance(ResourceResolutionDBService::class.java)
suspend fun AbstractComponentFunction.storedContentFromResolvedArtifactNB(
resolutionKey: String,
artifactName: String
): String {
- return BlueprintDependencyService.resourceResolutionService()
+ return BluePrintDependencyService.resourceResolutionService()
.resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey)
}
@@ -44,7 +44,7 @@ suspend fun AbstractComponentFunction.storedResourceResolutionsNB(
artifactName: String,
occurrence: Int = 1
): List<ResourceResolution> {
- return BlueprintDependencyService.resourceResolutionDBService()
+ return BluePrintDependencyService.resourceResolutionDBService()
.findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence(
bluePrintRuntimeService,
resolutionKey,
@@ -57,7 +57,7 @@ suspend fun AbstractComponentFunction.storedResourceResolutionsNB(
* Return resolved and mashed artifact content for artifact prefix [artifactPrefix]
*/
suspend fun AbstractComponentFunction.contentFromResolvedArtifactNB(artifactPrefix: String): String {
- return BlueprintDependencyService.resourceResolutionService()
+ return BluePrintDependencyService.resourceResolutionService()
.resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactPrefix, mapOf())
.first
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
index ea420dca4..6b4260ad0 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
@@ -27,15 +27,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.T
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceDefinitionUtils.createResourceAssignments
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.common.ApplicationConstants.LOG_REDACTED
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
@@ -56,13 +56,13 @@ interface ResourceResolutionService {
fun registeredResourceSources(): List<String>
suspend fun resolveFromDatabase(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
artifactTemplate: String,
resolutionKey: String
): String
suspend fun resolveResources(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
nodeTemplateName: String,
artifactNames: List<String>,
properties: Map<String, Any>,
@@ -70,7 +70,7 @@ interface ResourceResolutionService {
): ResourceResolutionResult
suspend fun resolveResources(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
nodeTemplateName: String,
artifactPrefix: String,
properties: Map<String, Any>
@@ -80,7 +80,7 @@ interface ResourceResolutionService {
* with other [resourceDefinitions] dependencies for the sources [sources]
* Used to get the same resource values from multiple sources. **/
suspend fun resolveResourceDefinition(
- blueprintRuntimeService: BlueprintRuntimeService<*>,
+ blueprintRuntimeService: BluePrintRuntimeService<*>,
resourceDefinitions: MutableMap<String, ResourceDefinition>,
resolveDefinition: String,
sources: List<String>
@@ -88,7 +88,7 @@ interface ResourceResolutionService {
MutableMap<String, JsonNode>
suspend fun resolveResourceAssignments(
- blueprintRuntimeService: BlueprintRuntimeService<*>,
+ blueprintRuntimeService: BluePrintRuntimeService<*>,
resourceDefinitions: MutableMap<String, ResourceDefinition>,
resourceAssignments: MutableList<ResourceAssignment>,
artifactPrefix: String,
@@ -100,7 +100,7 @@ interface ResourceResolutionService {
open class ResourceResolutionServiceImpl(
private var applicationContext: ApplicationContext,
private var templateResolutionDBService: TemplateResolutionService,
- private var blueprintTemplateService: BlueprintTemplateService,
+ private var blueprintTemplateService: BluePrintTemplateService,
private var resourceResolutionDBService: ResourceResolutionDBService
) :
ResourceResolutionService {
@@ -114,7 +114,7 @@ open class ResourceResolutionServiceImpl(
}
override suspend fun resolveFromDatabase(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
artifactTemplate: String,
resolutionKey: String
): String {
@@ -126,7 +126,7 @@ open class ResourceResolutionServiceImpl(
}
override suspend fun resolveResources(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
nodeTemplateName: String,
artifactNames: List<String>,
properties: Map<String, Any>,
@@ -153,16 +153,16 @@ open class ResourceResolutionServiceImpl(
val failedResolution = resourceAssignmentList.filter { it.status != "success" && it.property?.required == true }.map { it.name }
if (failedResolution.isNotEmpty()) {
val errorMessages = mutableListOf("Failed to resolve required values: $failedResolution").apply {
- this.addAll(resourceAssignmentRuntimeService.getBlueprintError().allErrors())
+ this.addAll(resourceAssignmentRuntimeService.getBluePrintError().allErrors())
}
- bluePrintRuntimeService.getBlueprintError().addErrors(stepName, errorMessages)
+ bluePrintRuntimeService.getBluePrintError().addErrors(stepName, errorMessages)
}
}
return ResourceResolutionResult(templateMap, assignmentMap)
}
override suspend fun resolveResources(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
nodeTemplateName: String,
artifactPrefix: String,
properties: Map<String, Any>
@@ -181,7 +181,7 @@ open class ResourceResolutionServiceImpl(
val resourceAssignments: MutableList<ResourceAssignment> =
JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment::class.java)
as? MutableList<ResourceAssignment>
- ?: throw BlueprintProcessorException("couldn't get Dictionary Definitions")
+ ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions")
if (isToStore(properties)) {
val existingResourceResolution = isNewResolution(bluePrintRuntimeService, properties, artifactPrefix)
@@ -245,7 +245,7 @@ open class ResourceResolutionServiceImpl(
}
override suspend fun resolveResourceDefinition(
- blueprintRuntimeService: BlueprintRuntimeService<*>,
+ blueprintRuntimeService: BluePrintRuntimeService<*>,
resourceDefinitions: MutableMap<String, ResourceDefinition>,
resolveDefinition: String,
sources: List<String>
@@ -269,7 +269,7 @@ open class ResourceResolutionServiceImpl(
* request.
*/
override suspend fun resolveResourceAssignments(
- blueprintRuntimeService: BlueprintRuntimeService<*>,
+ blueprintRuntimeService: BluePrintRuntimeService<*>,
resourceDefinitions: MutableMap<String, ResourceDefinition>,
resourceAssignments: MutableList<ResourceAssignment>,
artifactPrefix: String,
@@ -292,7 +292,7 @@ open class ResourceResolutionServiceImpl(
// Execute Non Dependent Assignments in parallel ( ie asynchronously )
val deferred = batchResourceAssignments
.filter { it.name != "*" && it.name != "start" }
- .filter { it.status != BlueprintConstants.STATUS_SUCCESS }
+ .filter { it.status != BluePrintConstants.STATUS_SUCCESS }
.map { resourceAssignment ->
async {
val dictionaryName = resourceAssignment.dictionaryName
@@ -302,12 +302,12 @@ open class ResourceResolutionServiceImpl(
val resourceAssignmentProcessor =
applicationContext.getBean(processorName) as? ResourceAssignmentProcessor
- ?: throw BlueprintProcessorException(
+ ?: throw BluePrintProcessorException(
"failed to get resource processor ($processorName) " +
"for resource assignment(${resourceAssignment.name})"
)
try {
- // Set Blueprint Runtime Service
+ // Set BluePrint Runtime Service
resourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService
// Set Resource Dictionaries
resourceAssignmentProcessor.resourceDictionaries = resourceDefinitions
@@ -328,10 +328,10 @@ open class ResourceResolutionServiceImpl(
}
// Set errors from RA
- blueprintRuntimeService.setBlueprintError(resourceAssignmentRuntimeService.getBlueprintError())
+ blueprintRuntimeService.setBluePrintError(resourceAssignmentRuntimeService.getBluePrintError())
} catch (e: RuntimeException) {
log.error("Fail in processing ${resourceAssignment.name}", e)
- throw BlueprintProcessorException(e)
+ throw BluePrintProcessorException(e)
}
}
}
@@ -359,10 +359,10 @@ open class ResourceResolutionServiceImpl(
}
else -> {
val resourceDefinition = resourceDefinitions[dictionaryName]
- ?: throw BlueprintProcessorException("couldn't get resource dictionary definition for $dictionaryName")
+ ?: throw BluePrintProcessorException("couldn't get resource dictionary definition for $dictionaryName")
val resourceSource = resourceDefinition.sources[dictionarySource]
- ?: throw BlueprintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)")
ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR.plus(resourceSource.type)
}
@@ -382,7 +382,7 @@ open class ResourceResolutionServiceImpl(
// Check whether resolution already exist in the database for the specified resolution-key or resourceId/resourceType
private suspend fun isNewResolution(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
properties: Map<String, Any>,
artifactPrefix: String
): List<ResourceResolution> {
@@ -434,7 +434,7 @@ open class ResourceResolutionServiceImpl(
resourceAssignmentList: MutableList<ResourceAssignment>
) {
resourceResolutionList.forEach { resourceResolution ->
- if (resourceResolution.status == BlueprintConstants.STATUS_SUCCESS) {
+ if (resourceResolution.status == BluePrintConstants.STATUS_SUCCESS) {
resourceAssignmentList.forEach {
if (compareOne(resourceResolution, it)) {
log.info(
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
index a681b4f68..62ec2bdf4 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
@@ -18,8 +18,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
@@ -30,30 +30,30 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuil
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeType
import kotlin.reflect.KClass
-fun BlueprintTypes.nodeTypeSourceInput(): NodeType {
+fun BluePrintTypes.nodeTypeSourceInput(): NodeType {
return nodeType(
- id = "source-input", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
+ id = "source-input", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
description = "This is Input Resource Source Node Type"
) {}
}
-fun BlueprintTypes.nodeTypeSourceDefault(): NodeType {
+fun BluePrintTypes.nodeTypeSourceDefault(): NodeType {
return nodeType(
- id = "source-default", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
+ id = "source-default", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
description = "This is Default Resource Source Node Type"
) {}
}
-fun BlueprintTypes.nodeTypeSourceDb(): NodeType {
+fun BluePrintTypes.nodeTypeSourceDb(): NodeType {
return nodeType(
- id = "source-db", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
+ id = "source-db", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
description = "This is Database Resource Source Node Type"
) {
property(
- "type", BlueprintConstants.DATA_TYPE_STRING,
+ "type", BluePrintConstants.DATA_TYPE_STRING,
true, ""
) {
defaultValue("SQL".asJsonPrimitive())
@@ -62,42 +62,42 @@ fun BlueprintTypes.nodeTypeSourceDb(): NodeType {
}
}
property(
- "endpoint-selector", BlueprintConstants.DATA_TYPE_STRING,
+ "endpoint-selector", BluePrintConstants.DATA_TYPE_STRING,
false, ""
)
property(
- "query", BlueprintConstants.DATA_TYPE_STRING,
+ "query", BluePrintConstants.DATA_TYPE_STRING,
true, ""
)
property(
- "input-key-mapping", BlueprintConstants.DATA_TYPE_MAP,
+ "input-key-mapping", BluePrintConstants.DATA_TYPE_MAP,
true, ""
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
property(
- "output-key-mapping", BlueprintConstants.DATA_TYPE_MAP,
+ "output-key-mapping", BluePrintConstants.DATA_TYPE_MAP,
false, ""
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
property(
- "key-dependencies", BlueprintConstants.DATA_TYPE_LIST,
+ "key-dependencies", BluePrintConstants.DATA_TYPE_LIST,
true, "Resource Resolution dependency dictionary names."
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
}
}
-fun BlueprintTypes.nodeTypeSourceRest(): NodeType {
+fun BluePrintTypes.nodeTypeSourceRest(): NodeType {
return nodeType(
- id = "source-rest", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
+ id = "source-rest", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
description = "This is Rest Resource Source Node Type"
) {
property(
- "type", BlueprintConstants.DATA_TYPE_STRING,
+ "type", BluePrintConstants.DATA_TYPE_STRING,
true, ""
) {
defaultValue("JSON".asJsonPrimitive())
@@ -106,7 +106,7 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType {
}
}
property(
- "verb", BlueprintConstants.DATA_TYPE_STRING,
+ "verb", BluePrintConstants.DATA_TYPE_STRING,
true, ""
) {
defaultValue("GET".asJsonPrimitive())
@@ -120,25 +120,25 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType {
}
}
property(
- "payload", BlueprintConstants.DATA_TYPE_STRING,
+ "payload", BluePrintConstants.DATA_TYPE_STRING,
false, ""
) {
defaultValue("".asJsonPrimitive())
}
property(
- "endpoint-selector", BlueprintConstants.DATA_TYPE_STRING,
+ "endpoint-selector", BluePrintConstants.DATA_TYPE_STRING,
false, ""
)
property(
- "url-path", BlueprintConstants.DATA_TYPE_STRING,
+ "url-path", BluePrintConstants.DATA_TYPE_STRING,
true, ""
)
property(
- "path", BlueprintConstants.DATA_TYPE_STRING,
+ "path", BluePrintConstants.DATA_TYPE_STRING,
true, ""
)
property(
- "expression-type", BlueprintConstants.DATA_TYPE_STRING,
+ "expression-type", BluePrintConstants.DATA_TYPE_STRING,
false, ""
) {
defaultValue("JSON_PATH".asJsonPrimitive())
@@ -147,62 +147,62 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType {
}
}
property(
- "input-key-mapping", BlueprintConstants.DATA_TYPE_MAP,
+ "input-key-mapping", BluePrintConstants.DATA_TYPE_MAP,
true, ""
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
property(
- "output-key-mapping", BlueprintConstants.DATA_TYPE_MAP,
+ "output-key-mapping", BluePrintConstants.DATA_TYPE_MAP,
false, ""
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
property(
- "key-dependencies", BlueprintConstants.DATA_TYPE_LIST,
+ "key-dependencies", BluePrintConstants.DATA_TYPE_LIST,
true, "Resource Resolution dependency dictionary names."
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
}
}
-fun BlueprintTypes.nodeTypeSourceCapability(): NodeType {
+fun BluePrintTypes.nodeTypeSourceCapability(): NodeType {
return nodeType(
- id = "source-capability", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
+ id = "source-capability", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
description = "This is Component Resource Source Node Type"
) {
property(
- ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BlueprintConstants.DATA_TYPE_STRING,
+ ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BluePrintConstants.DATA_TYPE_STRING,
true, "Request Id, Unique Id for the request."
) {
- defaultValue(BlueprintConstants.SCRIPT_KOTLIN)
+ defaultValue(BluePrintConstants.SCRIPT_KOTLIN)
constrain {
validValues(
arrayListOf(
- BlueprintConstants.SCRIPT_KOTLIN.asJsonPrimitive(),
- BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive(),
- BlueprintConstants.SCRIPT_JYTHON.asJsonPrimitive()
+ BluePrintConstants.SCRIPT_KOTLIN.asJsonPrimitive(),
+ BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive(),
+ BluePrintConstants.SCRIPT_JYTHON.asJsonPrimitive()
)
)
}
}
property(
- ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, BlueprintConstants.DATA_TYPE_STRING,
+ ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, BluePrintConstants.DATA_TYPE_STRING,
true, "Kotlin Script class name or jython script name."
)
property(
- "key-dependencies", BlueprintConstants.DATA_TYPE_LIST,
+ "key-dependencies", BluePrintConstants.DATA_TYPE_LIST,
true, "Resource Resolution dependency dictionary names."
) {
- entrySchema(BlueprintConstants.DATA_TYPE_STRING)
+ entrySchema(BluePrintConstants.DATA_TYPE_STRING)
}
}
}
/** Node Template Source Input **/
-fun BlueprintTypes.nodeTemplateSourceInput(
+fun BluePrintTypes.nodeTemplateSourceInput(
id: String,
description: String,
block: SourceInputNodeTemplateBuilder.() -> Unit
@@ -217,7 +217,7 @@ class SourceInputNodeTemplateBuilder(id: String, description: String) :
)
/** Node Template Source Default **/
-fun BlueprintTypes.nodeTemplateSourceDefault(
+fun BluePrintTypes.nodeTemplateSourceDefault(
id: String,
description: String,
block: SourceDefaultNodeTemplateBuilder.() -> Unit
@@ -232,7 +232,7 @@ class SourceDefaultNodeTemplateBuilder(id: String, description: String) :
)
/** Node Template Source DB **/
-fun BlueprintTypes.nodeTemplateSourceDb(
+fun BluePrintTypes.nodeTemplateSourceDb(
id: String,
description: String,
block: SourceDbNodeTemplateBuilder.() -> Unit
@@ -299,7 +299,7 @@ class KeyMappingBuilder() {
}
/** Node Template Source Rest **/
-fun BlueprintTypes.nodeTemplateSourceRest(
+fun BluePrintTypes.nodeTemplateSourceRest(
id: String,
description: String,
block: SourceRestNodeTemplateBuilder.() -> Unit
@@ -378,7 +378,7 @@ class SourceRestNodeTemplateBuilder(id: String, description: String) :
}
/** Node Template Source Rest **/
-fun BlueprintTypes.nodeTemplateSourceCapability(
+fun BluePrintTypes.nodeTemplateSourceCapability(
id: String,
description: String,
block: SourceCapabilityNodeTemplateBuilder.() -> Unit
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt
index a1f3249ab..71cf6ceea 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt
@@ -20,10 +20,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.rest.restClientService
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
@@ -51,7 +51,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() {
/** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProperties =
checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " }
@@ -81,7 +81,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() {
resourceSourceProperties["resolved-payload"] = JacksonUtils.jsonNode(generatedPayload)
// Get the Rest Client service, selector will be included in application.properties
- val restClientService = BlueprintDependencyService.restClientService(
+ val restClientService = BluePrintDependencyService.restClientService(
"ipassign-ms"
)
@@ -100,7 +100,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() {
"Failed to dictionary name ($dName), dictionary source($($dName) " +
"response_code: ($responseStatusCode)"
log.warn(errMsg)
- throw BlueprintProcessorException(errMsg)
+ throw BluePrintProcessorException(errMsg)
}
// Parse the error Body and assign the property value
}
@@ -108,7 +108,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() {
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"Failed in template key ($resourceAssignment) assignments with: ${e.message}",
e
)
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt
index 4f656a8f0..139d8232f 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt
@@ -20,10 +20,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.rest.restClientService
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
@@ -51,7 +51,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() {
/** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProperties =
checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " }
@@ -82,7 +82,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() {
resourceSourceProperties["resolved-payload"] = JacksonUtils.jsonNode(generatedPayload)
// Get the Rest Client service, selector will be included in application.properties
- val restClientService = BlueprintDependencyService.restClientService(
+ val restClientService = BluePrintDependencyService.restClientService(
"naming-ms"
)
@@ -102,7 +102,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() {
"Failed to dictionary name ($dName), dictionary source($($dName) " +
"response_code: ($responseStatusCode)"
log.warn(errMsg)
- throw BlueprintProcessorException(errMsg)
+ throw BluePrintProcessorException(errMsg)
}
// Parse the error Body and assign the property value
}
@@ -110,7 +110,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() {
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"Failed in template key ($resourceAssignment) assignments with: ${e.message}",
e
)
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt
index 592408b67..5958c7899 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt
@@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -34,7 +34,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
private val log = LoggerFactory.getLogger(ResourceResolutionDBService::class.toString())
suspend fun findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
key: String,
occurrence: Int,
artifactPrefix: String
@@ -42,8 +42,8 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
return try {
val metadata = bluePrintRuntimeService.bluePrintContext().metadata!!
- val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!!
- val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!!
+ val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!!
+ val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!!
resourceResolutionRepository.findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence(
blueprintName,
@@ -58,7 +58,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
}
suspend fun findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResourceIdAndResourceTypeAndOccurrence(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
resourceId: String,
resourceType: String,
occurrence: Int,
@@ -68,8 +68,8 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
val metadata = bluePrintRuntimeService.bluePrintContext().metadata!!
- val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!!
- val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!!
+ val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!!
+ val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!!
resourceResolutionRepository.findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResourceIdAndResourceTypeAndOccurrence(
blueprintName,
@@ -134,15 +134,15 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
suspend fun write(
properties: Map<String, Any>,
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
artifactPrefix: String,
resourceAssignment: ResourceAssignment
): ResourceResolution = withContext(Dispatchers.IO) {
val metadata = bluePrintRuntimeService.bluePrintContext().metadata!!
- val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!!
- val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!!
+ val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!!
+ val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!!
val resolutionKey = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] as String
val resourceId = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] as String
@@ -182,7 +182,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
resourceResolution.resourceType = resourceType
resourceResolution.resourceId = resourceId
resourceResolution.value = resourceAssignment.property?.value?.let {
- if (BlueprintConstants.STATUS_SUCCESS == resourceAssignment.status)
+ if (BluePrintConstants.STATUS_SUCCESS == resourceAssignment.status)
JacksonUtils.getValue(it).toString()
else ""
} ?: ""
@@ -190,12 +190,12 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso
resourceResolution.dictionaryName = resourceAssignment.dictionaryName
resourceResolution.dictionaryVersion = resourceAssignment.version
resourceResolution.dictionarySource = resourceAssignment.dictionarySource
- resourceResolution.status = resourceAssignment.status ?: BlueprintConstants.STATUS_FAILURE
+ resourceResolution.status = resourceAssignment.status ?: BluePrintConstants.STATUS_FAILURE
try {
resourceResolutionRepository.saveAndFlush(resourceResolution)
} catch (ex: Exception) {
- throw BlueprintException("Failed to store resource resolution result.", ex)
+ throw BluePrintException("Failed to store resource resolution result.", ex)
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt
index cbd8b8310..4bdd5d985 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt
@@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.slf4j.LoggerFactory
import org.springframework.dao.DataIntegrityViolationException
import org.springframework.dao.EmptyResultDataAccessException
@@ -33,7 +33,7 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa
private val log = LoggerFactory.getLogger(TemplateResolutionService::class.toString())
suspend fun findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
artifactPrefix: String,
resolutionKey: String
): String =
@@ -41,8 +41,8 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa
val metadata = bluePrintRuntimeService.bluePrintContext().metadata!!
- val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!!
- val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!!
+ val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!!
+ val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!!
findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName(
blueprintName,
@@ -93,14 +93,14 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa
suspend fun write(
properties: Map<String, Any>,
result: String,
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
artifactPrefix: String
): TemplateResolution = withContext(Dispatchers.IO) {
val metadata = bluePrintRuntimeService.bluePrintContext().metadata!!
- val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!!
- val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!!
+ val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!!
+ val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!!
val resolutionKey = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] as String
val resourceId = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] as String
val resourceType = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_TYPE] as String
@@ -187,7 +187,7 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa
" (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence error: {}",
ex.message
)
- throw BlueprintException("Failed to store resource api result.", ex)
+ throw BluePrintException("Failed to store resource api result.", ex)
}
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
index 5e834d73d..9f318a314 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt
@@ -22,7 +22,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Capa
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -53,7 +53,7 @@ open class CapabilityResourceResolutionProcessor(private var componentFunctionSc
/** Check Resource Assignment has the source definitions, If not get from Resource Definition **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProps =
checkNotNull(resourceSource.properties) { "failed to get $resourceSource properties" }
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
index db5307f17..c8bef5200 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
@@ -17,14 +17,14 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor
-import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService
+import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService
import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BlueprintDBLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
@@ -47,7 +47,7 @@ import java.util.HashMap
@Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-db")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
open class DatabaseResourceAssignmentProcessor(
- private val bluePrintDBLibPropertyService: BlueprintDBLibPropertyService,
+ private val bluePrintDBLibPropertyService: BluePrintDBLibPropertyService,
private val primaryDBLibGenericService: PrimaryDBLibGenericService
) : ResourceAssignmentProcessor() {
@@ -66,7 +66,7 @@ open class DatabaseResourceAssignmentProcessor(
}
// Check the value has populated for mandatory case
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process Database resource resolution in template key ($resourceAssignment) assignments."
throw e.updateErrorMessage(
ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
@@ -74,7 +74,7 @@ open class DatabaseResourceAssignmentProcessor(
)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
+ throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
}
}
@@ -86,7 +86,7 @@ open class DatabaseResourceAssignmentProcessor(
/** Check Resource Assignment has the source definitions, If not get from Resource Definition **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProperties = checkNotNull(resourceSource.properties) {
"failed to get source properties for $dName "
}
@@ -119,7 +119,7 @@ open class DatabaseResourceAssignmentProcessor(
}
}
- private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BlueprintDBLibGenericService {
+ private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BluePrintDBLibGenericService {
return if (isNotEmpty(sourceProperties.endpointSelector)) {
val dbPropertiesJson = raRuntimeService.resolveDSLExpression(sourceProperties.endpointSelector!!)
bluePrintDBLibPropertyService.JdbcTemplate(dbPropertiesJson)
@@ -128,7 +128,7 @@ open class DatabaseResourceAssignmentProcessor(
}
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun validate(resourceAssignment: ResourceAssignment) {
checkNotEmpty(resourceAssignment.name) { "resource assignment template key is not defined" }
checkNotEmpty(resourceAssignment.dictionaryName) {
@@ -156,7 +156,7 @@ open class DatabaseResourceAssignmentProcessor(
return namedParameters
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun populateResource(
resourceAssignment: ResourceAssignment,
sourceProperties: DatabaseResourceSource,
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt
index e904ebcb4..9e5bd08cd 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt
@@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -51,7 +51,7 @@ open class DefaultResourceResolutionProcessor : ResourceAssignmentProcessor() {
}
// Check the value has populated for mandatory case
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process default resource resolution in template key ($resourceAssignment) assignments."
throw e.updateErrorMessage(
ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
@@ -59,7 +59,7 @@ open class DefaultResourceResolutionProcessor : ResourceAssignmentProcessor() {
)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
+ throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt
index c3add86fd..caf6b6acb 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt
@@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
@@ -52,13 +52,13 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() {
}
// Check the value has populated for mandatory case
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process input resource resolution in template key ($resourceAssignment) assignments."
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
logger.error(errorMsg)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with : (${e.message})", e)
+ throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with : (${e.message})", e)
}
}
@@ -71,7 +71,7 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() {
/** Check Resource Assignment has the source definitions, If not get from Resource Definition **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
try {
val resourceSourceProperties = checkNotNull(resourceSource.properties) {
@@ -86,7 +86,7 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() {
// keyDependency = service-instance.service-instance-id
setFromInputKeyDependencies(keyDependency, resourceAssignment); // New API which picks attribute from Input
} catch (e: IllegalStateException) {
- throw BlueprintProcessorException(e)
+ throw BluePrintProcessorException(e)
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
index ce00ac17b..c075e1b4d 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt
@@ -22,13 +22,13 @@ import com.fasterxml.jackson.databind.JsonNode
import org.apache.commons.collections.MapUtils
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode
import org.onap.ccsdk.cds.controllerblueprints.core.isNullOrMissing
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition
import org.slf4j.LoggerFactory
@@ -50,7 +50,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
*/
open fun <T> scriptPropertyInstanceType(name: String): T {
return scriptPropertyInstances as? T
- ?: throw BlueprintProcessorException("couldn't get script property instance ($name)")
+ ?: throw BluePrintProcessorException("couldn't get script property instance ($name)")
}
open fun setFromInput(resourceAssignment: ResourceAssignment): Boolean {
@@ -64,7 +64,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, value)
return true
}
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
// NoOp - couldn't find value from input
}
return false
@@ -83,7 +83,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
return true
}
}
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
// NoOp - couldn't find value from input
}
return false
@@ -110,7 +110,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
return valueToResolve
}
// TODO("Optimize to JSON Node directly without velocity").asJsonNode().toString()
- return BlueprintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString())
+ return BluePrintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString())
}
final override suspend fun applyNB(resourceAssignment: ResourceAssignment): Boolean {
@@ -126,7 +126,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
suspend fun executeScript(resourceAssignment: ResourceAssignment) {
return when (scriptType) {
- BlueprintConstants.SCRIPT_JYTHON -> {
+ BluePrintConstants.SCRIPT_JYTHON -> {
executeScriptBlocking(resourceAssignment)
}
else -> {
@@ -163,39 +163,39 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig
*/
final override fun apply(resourceAssignment: ResourceAssignment): Boolean {
- throw BlueprintException("Not Implemented, use applyNB method")
+ throw BluePrintException("Not Implemented, use applyNB method")
}
final override fun prepareRequest(resourceAssignment: ResourceAssignment): ResourceAssignment {
- throw BlueprintException("Not Implemented required")
+ throw BluePrintException("Not Implemented required")
}
final override fun prepareResponse(): Boolean {
- throw BlueprintException("Not Implemented required")
+ throw BluePrintException("Not Implemented required")
}
final override suspend fun prepareRequestNB(resourceAssignment: ResourceAssignment): ResourceAssignment {
- throw BlueprintException("Not Implemented required")
+ throw BluePrintException("Not Implemented required")
}
final override suspend fun prepareResponseNB(): Boolean {
- throw BlueprintException("Not Implemented required")
+ throw BluePrintException("Not Implemented required")
}
override fun process(resourceAssignment: ResourceAssignment) {
- throw BlueprintException("Not Implemented, child class will implement this")
+ throw BluePrintException("Not Implemented, child class will implement this")
}
override fun recover(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) {
- throw BlueprintException("Not Implemented, child class will implement this")
+ throw BluePrintException("Not Implemented, child class will implement this")
}
fun addError(type: String, name: String, error: String) {
- raRuntimeService.getBlueprintError().addError(type, name, error, getName())
+ raRuntimeService.getBluePrintError().addError(type, name, error, getName())
}
fun addError(error: String) {
- raRuntimeService.getBlueprintError().addError(error, getName())
+ raRuntimeService.getBluePrintError().addError(error, getName())
}
fun isTemplateKeyValueNull(resourceAssignment: ResourceAssignment): Boolean {
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
index c17e14000..b81455c83 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
@@ -20,11 +20,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
@@ -44,7 +44,7 @@ import org.springframework.stereotype.Service
*/
@Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-rest")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyService: BlueprintRestLibPropertyService) :
+open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyService: BluePrintRestLibPropertyService) :
ResourceAssignmentProcessor() {
private val logger = LoggerFactory.getLogger(RestResourceResolutionProcessor::class.java)
@@ -66,7 +66,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
/** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProperties =
checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " }
@@ -104,7 +104,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
val responseBody = response.body
val outputKeyMapping = sourceProperties.outputKeyMapping
if (responseStatusCode in 200..299 && outputKeyMapping.isNullOrEmpty()) {
- resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS
+ resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS
logger.info("AS>> outputKeyMapping==null, will not populateResource")
} else if (responseStatusCode in 200..299 && !responseBody.isBlank()) {
populateResource(resourceAssignment, sourceProperties, responseBody, path)
@@ -112,12 +112,12 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
val errMsg =
"Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath) response_code: ($responseStatusCode)"
logger.warn(errMsg)
- throw BlueprintProcessorException(errMsg)
+ throw BluePrintProcessorException(errMsg)
}
}
// Check the value has populated for mandatory case
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process REST resource resolution in template key ($resourceAssignment) assignments."
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, errorMsg)
throw e.updateErrorMessage(
@@ -126,7 +126,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
+ throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
}
}
@@ -142,7 +142,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
}
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun populateResource(
resourceAssignment: ResourceAssignment,
sourceProperties: RestResourceSource,
@@ -175,7 +175,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, parsedResponseNode)
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun validate(resourceAssignment: ResourceAssignment) {
checkNotEmpty(resourceAssignment.name) { "resource assignment template key is not defined" }
checkNotEmpty(resourceAssignment.dictionaryName) {
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
index 5a03450ed..7ab3126bb 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt
@@ -26,9 +26,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.databind.node.TextNode
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.checkFileExists
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
@@ -39,8 +39,8 @@ import org.onap.ccsdk.cds.controllerblueprints.core.isNullOrMissing
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.rootFieldsToMap
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect
@@ -59,14 +59,14 @@ class ResourceAssignmentUtils {
suspend fun resourceDefinitions(blueprintBasePath: String): MutableMap<String, ResourceDefinition> {
val dictionaryFile = normalizedFile(
- blueprintBasePath, BlueprintConstants.TOSCA_DEFINITIONS_DIR,
+ blueprintBasePath, BluePrintConstants.TOSCA_DEFINITIONS_DIR,
ResourceResolutionConstants.FILE_NAME_RESOURCE_DEFINITION_TYPES
)
checkFileExists(dictionaryFile) { "resource definition file(${dictionaryFile.absolutePath}) is missing" }
return JacksonReactorUtils.getMapFromFile(dictionaryFile, ResourceDefinition::class.java)
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun setResourceDataValue(
resourceAssignment: ResourceAssignment,
raRuntimeService: ResourceAssignmentRuntimeService,
@@ -76,7 +76,7 @@ class ResourceAssignmentUtils {
return setResourceDataValue(resourceAssignment, raRuntimeService, value.asJsonType())
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun setResourceDataValue(
resourceAssignment: ResourceAssignment,
raRuntimeService: ResourceAssignmentRuntimeService,
@@ -108,11 +108,11 @@ class ResourceAssignmentUtils {
)
setResourceValue(resourceAssignment, raRuntimeService, value)
resourceAssignment.updatedDate = Date()
- resourceAssignment.updatedBy = BlueprintConstants.USER_SYSTEM
- resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS
+ resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM
+ resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS
}
} catch (e: Exception) {
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"Failed in setting value for template key " +
"(${resourceAssignment.name}) and dictionary key (${resourceAssignment.dictionaryName}) of " +
"type (${resourceProp.type}) with error message (${e.message})",
@@ -139,7 +139,7 @@ class ResourceAssignmentUtils {
.mapValues { e -> e.value.asText() } as MutableMap<String, Any>
val newValue: JsonNode
try {
- newValue = BlueprintVelocityTemplateService
+ newValue = BluePrintVelocityTemplateService
.generateContent(template, null, true, resolutionStore)
.also {
if (hasLogProtect(metadata))
@@ -149,7 +149,7 @@ class ResourceAssignmentUtils {
}
.let { v -> v.asJsonType() }
} catch (e: Exception) {
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"transform-template failed: $template", e
)
}
@@ -164,24 +164,24 @@ class ResourceAssignmentUtils {
fun setFailedResourceDataValue(resourceAssignment: ResourceAssignment, message: String?) {
if (isNotEmpty(resourceAssignment.name)) {
resourceAssignment.updatedDate = Date()
- resourceAssignment.updatedBy = BlueprintConstants.USER_SYSTEM
- resourceAssignment.status = BlueprintConstants.STATUS_FAILURE
+ resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM
+ resourceAssignment.status = BluePrintConstants.STATUS_FAILURE
resourceAssignment.message = message
}
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun assertTemplateKeyValueNotNull(resourceAssignment: ResourceAssignment) {
val resourceProp = checkNotNull(resourceAssignment.property) {
"Failed to populate mandatory resource resource mapping $resourceAssignment"
}
if (resourceProp.required != null && resourceProp.required!! && resourceProp.value.isNullOrMissing()) {
logger.error("failed to populate mandatory resource mapping ($resourceAssignment)")
- throw BlueprintProcessorException("failed to populate mandatory resource mapping ($resourceAssignment)")
+ throw BluePrintProcessorException("failed to populate mandatory resource mapping ($resourceAssignment)")
}
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun generateResourceDataForAssignments(assignments: List<ResourceAssignment>): String {
val result: String
try {
@@ -209,13 +209,13 @@ class ResourceAssignmentUtils {
logger.info("Generated Resource Param Data ($result)")
}
} catch (e: Exception) {
- throw BlueprintProcessorException("Resource Assignment is failed with $e.message", e)
+ throw BluePrintProcessorException("Resource Assignment is failed with $e.message", e)
}
return result
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun generateResourceForAssignments(assignments: List<ResourceAssignment>): MutableMap<String, JsonNode> {
val data: MutableMap<String, JsonNode> = hashMapOf()
assignments.forEach {
@@ -291,7 +291,7 @@ class ResourceAssignmentUtils {
}
fun transformToRARuntimeService(
- blueprintRuntimeService: BlueprintRuntimeService<*>,
+ blueprintRuntimeService: BluePrintRuntimeService<*>,
templateArtifactName: String
): ResourceAssignmentRuntimeService {
@@ -305,7 +305,7 @@ class ResourceAssignmentUtils {
return resourceAssignmentRuntimeService
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun getPropertyType(
raRuntimeService: ResourceAssignmentRuntimeService,
dataTypeName: String,
@@ -321,12 +321,12 @@ class ResourceAssignmentUtils {
logger.trace("Data type({})'s property ({}) is ({})", dataTypeName, propertyName, type)
} catch (e: Exception) {
logger.error("couldn't get data type($dataTypeName)'s property ($propertyName), error message $e")
- throw BlueprintProcessorException("${e.message}", e)
+ throw BluePrintProcessorException("${e.message}", e)
}
return type
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
fun parseResponseNode(
responseNode: JsonNode,
resourceAssignment: ResourceAssignment,
@@ -336,18 +336,18 @@ class ResourceAssignmentUtils {
val metadata = resourceAssignment.property!!.metadata
try {
if ((resourceAssignment.property?.type).isNullOrEmpty()) {
- throw BlueprintProcessorException("Couldn't get data dictionary type for dictionary name (${resourceAssignment.name})")
+ throw BluePrintProcessorException("Couldn't get data dictionary type for dictionary name (${resourceAssignment.name})")
}
val type = resourceAssignment.property!!.type
val valueToPrint = getValueToLog(metadata, responseNode)
logger.info("For template key (${resourceAssignment.name}) trying to get value from responseNode ($valueToPrint)")
return when (type) {
- in BlueprintTypes.validPrimitiveTypes() -> {
+ in BluePrintTypes.validPrimitiveTypes() -> {
// Primitive Types
parseResponseNodeForPrimitiveTypes(responseNode, resourceAssignment, outputKeyMapping)
}
- in BlueprintTypes.validCollectionTypes() -> {
+ in BluePrintTypes.validCollectionTypes() -> {
// Array Types
parseResponseNodeForCollection(responseNode, resourceAssignment, raRuntimeService, outputKeyMapping)
}
@@ -358,7 +358,7 @@ class ResourceAssignmentUtils {
}
} catch (e: Exception) {
logger.error("Fail to parse response data, error message $e")
- throw BlueprintProcessorException("${e.message}", e)
+ throw BluePrintProcessorException("${e.message}", e)
}
}
@@ -387,7 +387,7 @@ class ResourceAssignmentUtils {
}
if (returnNode.isNullOrMissing() || returnNode!!.isComplexType() && !returnNode.has(outputKeyMapping[outputKey])) {
- throw BlueprintProcessorException("Fail to find output key mapping ($outputKey) in the responseNode.")
+ throw BluePrintProcessorException("Fail to find output key mapping ($outputKey) in the responseNode.")
}
val returnValue = if (returnNode.isComplexType()) {
@@ -411,7 +411,7 @@ class ResourceAssignmentUtils {
val metadata = resourceAssignment.property!!.metadata
var resultNode: JsonNode
if ((resourceAssignment.property?.entrySchema?.type).isNullOrEmpty()) {
- throw BlueprintProcessorException(
+ throw BluePrintProcessorException(
"Couldn't get data type for dictionary type " +
"(${resourceAssignment.property!!.type}) and dictionary name ($dName)"
)
@@ -441,7 +441,7 @@ class ResourceAssignmentUtils {
)
}
else -> {
- throw BlueprintProcessorException("Key-value response expected to match the responseNode.")
+ throw BluePrintProcessorException("Key-value response expected to match the responseNode.")
}
}
} else {
@@ -486,7 +486,7 @@ class ResourceAssignmentUtils {
): ObjectNode {
val outputKeyMappingHasOnlyOneElement = checkIfOutputKeyMappingProvideOneElement(outputKeyMapping)
when (entrySchemaType) {
- in BlueprintTypes.validPrimitiveTypes() -> {
+ in BluePrintTypes.validPrimitiveTypes() -> {
if (outputKeyMappingHasOnlyOneElement) {
val outputKeyMap = outputKeyMapping.entries.first()
if (resourceAssignment.keyIdentifiers.none { it.name == outputKeyMap.key }) {
@@ -503,7 +503,7 @@ class ResourceAssignmentUtils {
metadata
)
} else {
- throw BlueprintProcessorException("Expect one entry in output-key-mapping")
+ throw BluePrintProcessorException("Expect one entry in output-key-mapping")
}
}
else -> {
@@ -533,7 +533,7 @@ class ResourceAssignmentUtils {
)
}
else -> {
- throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
+ throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
}
}
}
@@ -557,7 +557,7 @@ class ResourceAssignmentUtils {
resourceAssignment.keyIdentifiers.add(KeyIdentifier(outputKeyMap.key, returnValue))
return returnValue
} else {
- throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
+ throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
}
}
@@ -669,7 +669,7 @@ class ResourceAssignmentUtils {
)
}
else -> {
- throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
+ throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType")
}
}
} else {
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt
index 4b4e04e16..1bf854cbd 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt
@@ -16,7 +16,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString
import org.onap.ccsdk.cds.controllerblueprints.core.asListOfString
import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
@@ -48,7 +48,7 @@ object ResourceDefinitionUtils {
MutableList<ResourceAssignment> {
/** Check if resolve definition is defined in the resource definition Map */
val resourceDefinition = resourceDefinitions[resolveDefinition]
- ?: throw BlueprintProcessorException("failed to get resolve definition($resolveDefinition)")
+ ?: throw BluePrintProcessorException("failed to get resolve definition($resolveDefinition)")
val resourceAssignments: MutableList<ResourceAssignment> = arrayListOf()
@@ -56,7 +56,7 @@ object ResourceDefinitionUtils {
val definitionDependencies = definitionDependencies(resourceDefinition, sources)
definitionDependencies.forEach { definitionDependencyName ->
val definitionDependency = resourceDefinitions[definitionDependencyName]
- ?: throw BlueprintProcessorException("failed to get dependency definition($definitionDependencyName)")
+ ?: throw BluePrintProcessorException("failed to get dependency definition($definitionDependencyName)")
val resourceAssignment = ResourceAssignment().apply {
name = definitionDependency.name