summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/execution-service
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service')
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt34
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractScriptComponentFunction.kt26
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractServiceFunction.kt4
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt24
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt14
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorDSL.kt34
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt2
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt38
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt8
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionService.kt22
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonService.kt10
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt24
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt (renamed from ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt)8
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt8
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt30
15 files changed, 143 insertions, 143 deletions
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
index 94920235b..c1a898582 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
@@ -24,11 +24,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutp
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.Status
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
import org.onap.ccsdk.cds.blueprintsprocessor.core.cluster.executeWithLock
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.CDS_LOCK_GROUP
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
-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.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotBlank
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
@@ -38,8 +38,8 @@ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunction
import org.onap.ccsdk.cds.controllerblueprints.core.jsonPathParse
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
import org.onap.ccsdk.cds.controllerblueprints.core.readNBLines
-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.slf4j.LoggerFactory
/**
@@ -53,8 +53,8 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
lateinit var executionServiceInput: ExecutionServiceInput
var executionServiceOutput = ExecutionServiceOutput()
- lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
- lateinit var bluePrintClusterService: BluePrintClusterService
+ lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*>
+ lateinit var bluePrintClusterService: BlueprintClusterService
lateinit var implementation: Implementation
lateinit var processId: String
lateinit var workflowName: String
@@ -88,13 +88,13 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
log.info("preparing request id($processId) for workflow($workflowName) step($stepName)")
- nodeTemplateName = this.operationInputs.getAsString(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE)
+ nodeTemplateName = this.operationInputs.getAsString(BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE)
check(nodeTemplateName.isNotEmpty()) { "couldn't get NodeTemplate name for step($stepName)" }
- interfaceName = this.operationInputs.getAsString(BluePrintConstants.PROPERTY_CURRENT_INTERFACE)
+ interfaceName = this.operationInputs.getAsString(BlueprintConstants.PROPERTY_CURRENT_INTERFACE)
check(interfaceName.isNotEmpty()) { "couldn't get Interface name for step($stepName)" }
- operationName = this.operationInputs.getAsString(BluePrintConstants.PROPERTY_CURRENT_OPERATION)
+ operationName = this.operationInputs.getAsString(BlueprintConstants.PROPERTY_CURRENT_OPERATION)
check(operationName.isNotEmpty()) { "couldn't get Operation name for step($stepName)" }
/** Get the Implementation Details */
@@ -105,7 +105,7 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
/** Resolve and validate lock properties */
implementation.lock?.apply {
val resolvedValues = bluePrintRuntimeService.resolvePropertyAssignments(
- BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
+ BlueprintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE,
interfaceName,
mutableMapOf("key" to this.key, "acquireTimeout" to this.acquireTimeout)
)
@@ -146,7 +146,7 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
// Set the Default Step Status
status.eventType = EventType.EVENT_COMPONENT_EXECUTED.name
} catch (e: Exception) {
- status.message = BluePrintConstants.STATUS_FAILURE
+ status.message = BlueprintConstants.STATUS_FAILURE
status.eventType = EventType.EVENT_COMPONENT_FAILURE.name
}
executionServiceOutput.status = status
@@ -180,7 +180,7 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
fun getOperationInput(key: String): JsonNode {
return operationInputs[key]
- ?: throw BluePrintProcessorException("couldn't get the operation input($key) value.")
+ ?: throw BlueprintProcessorException("couldn't get the operation input($key) value.")
}
fun getOptionalOperationInput(key: String): JsonNode? {
@@ -192,11 +192,11 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
}
fun addError(type: String, name: String, error: String) {
- bluePrintRuntimeService.getBluePrintError().addError(type, name, error)
+ bluePrintRuntimeService.getBlueprintError().addError(type, name, error)
}
fun addError(error: String) {
- bluePrintRuntimeService.getBluePrintError().addError(error)
+ bluePrintRuntimeService.getBlueprintError().addError(error)
}
/**
@@ -225,12 +225,12 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
suspend fun relationshipProperty(relationshipName: String, propertyName: String): JsonNode {
return bluePrintRuntimeService.resolveRelationshipTemplateProperties(relationshipName).get(propertyName)
- ?: throw BluePrintProcessorException("failed to get relationship($relationshipName) property($propertyName)")
+ ?: throw BlueprintProcessorException("failed to get relationship($relationshipName) property($propertyName)")
}
suspend fun mashTemplateNData(artifactName: String, json: String): String {
val content = artifactContent(artifactName)
- return BluePrintVelocityTemplateService.generateContent(content, json)
+ return BlueprintVelocityTemplateService.generateContent(content, json)
}
suspend fun readLinesFromArtifact(artifactName: String): List<String> {
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractScriptComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractScriptComponentFunction.kt
index 8b46ae693..3cb46ed44 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractScriptComponentFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractScriptComponentFunction.kt
@@ -19,9 +19,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.execution
import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
-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.slf4j.LoggerFactory
abstract class AbstractScriptComponentFunction : AbstractComponentFunction() {
@@ -47,7 +47,7 @@ abstract class AbstractScriptComponentFunction : AbstractComponentFunction() {
@Deprecated("Dependencies will be resolved dynamically")
open fun <T> functionDependencyInstanceAsType(name: String): T {
return functionDependencyInstances[name] as? T
- ?: throw BluePrintProcessorException("couldn't get script property instance ($name)")
+ ?: throw BlueprintProcessorException("couldn't get script property instance ($name)")
}
fun checkDynamicProperties(key: String): Boolean {
@@ -60,7 +60,7 @@ abstract class AbstractScriptComponentFunction : AbstractComponentFunction() {
suspend fun executeScript(executionServiceInput: ExecutionServiceInput) {
return when (scriptType) {
- BluePrintConstants.SCRIPT_JYTHON -> {
+ BlueprintConstants.SCRIPT_JYTHON -> {
executeScriptBlocking(executionServiceInput)
}
else -> {
@@ -97,34 +97,34 @@ abstract class AbstractScriptComponentFunction : AbstractComponentFunction() {
*/
final override fun apply(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput {
- throw BluePrintException("Not Implemented, use applyNB method")
+ throw BlueprintException("Not Implemented, use applyNB method")
}
final override fun prepareRequest(executionRequest: ExecutionServiceInput): ExecutionServiceInput {
- throw BluePrintException("Not Implemented required")
+ throw BlueprintException("Not Implemented required")
}
final override fun prepareResponse(): ExecutionServiceOutput {
- throw BluePrintException("Not Implemented required")
+ throw BlueprintException("Not Implemented required")
}
final override suspend fun applyNB(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput {
- throw BluePrintException("Not Implemented required")
+ throw BlueprintException("Not Implemented required")
}
final override suspend fun prepareRequestNB(executionRequest: ExecutionServiceInput): ExecutionServiceInput {
- throw BluePrintException("Not Implemented required")
+ throw BlueprintException("Not Implemented required")
}
final override suspend fun prepareResponseNB(): ExecutionServiceOutput {
- throw BluePrintException("Not Implemented required")
+ throw BlueprintException("Not Implemented required")
}
override fun process(executionRequest: ExecutionServiceInput) {
- throw BluePrintException("Not Implemented, child class will implement this")
+ throw BlueprintException("Not Implemented, child class will implement this")
}
override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
- throw BluePrintException("Not Implemented, child class will implement this")
+ throw BlueprintException("Not Implemented, child class will implement this")
}
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractServiceFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractServiceFunction.kt
index 33f5d749f..41e26e4ab 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractServiceFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractServiceFunction.kt
@@ -21,7 +21,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.Status
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode
import org.onap.ccsdk.cds.controllerblueprints.core.jsonPathParse
import org.onap.ccsdk.cds.controllerblueprints.core.logger
@@ -79,7 +79,7 @@ abstract class AbstractServiceFunction : BlueprintFunctionNode<ExecutionServiceI
// Set the Default Step Status
status.eventType = EventType.EVENT_COMPONENT_EXECUTED.name
} catch (e: Exception) {
- status.message = BluePrintConstants.STATUS_FAILURE
+ status.message = BlueprintConstants.STATUS_FAILURE
status.eventType = EventType.EVENT_COMPONENT_FAILURE.name
}
executionServiceOutput.status = status
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt
index 3483ce1d7..b798f0083 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt
@@ -17,12 +17,12 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.execution
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.BlueprintJythonService
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintScriptsService
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintScriptsService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode
-import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintScriptsServiceImpl
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintScriptsServiceImpl
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
import org.slf4j.LoggerFactory
import org.springframework.context.ApplicationContext
import org.springframework.stereotype.Service
@@ -74,29 +74,29 @@ class ComponentFunctionScriptingService(
}
suspend fun <T : BlueprintFunctionNode<*, *>> scriptInstance(
- bluePrintContext: BluePrintContext,
+ bluePrintContext: BlueprintContext,
scriptType: String,
scriptClassReference: String
): T {
var scriptComponent: T? = null
when (scriptType) {
- BluePrintConstants.SCRIPT_INTERNAL -> {
- val bluePrintScriptsService: BluePrintScriptsService = BluePrintScriptsServiceImpl()
+ BlueprintConstants.SCRIPT_INTERNAL -> {
+ val bluePrintScriptsService: BlueprintScriptsService = BlueprintScriptsServiceImpl()
scriptComponent = bluePrintScriptsService.scriptInstance<T>(scriptClassReference)
}
- BluePrintConstants.SCRIPT_KOTLIN -> {
- val bluePrintScriptsService: BluePrintScriptsService = BluePrintScriptsServiceImpl()
+ BlueprintConstants.SCRIPT_KOTLIN -> {
+ val bluePrintScriptsService: BlueprintScriptsService = BlueprintScriptsServiceImpl()
scriptComponent = bluePrintScriptsService.scriptInstance<T>(
bluePrintContext.rootPath,
bluePrintContext.name(), bluePrintContext.version(), scriptClassReference, false
)
}
- BluePrintConstants.SCRIPT_JYTHON -> {
+ BlueprintConstants.SCRIPT_JYTHON -> {
scriptComponent = blueprintJythonService.jythonComponentInstance(bluePrintContext, scriptClassReference) as T
}
else -> {
- throw BluePrintProcessorException("script type($scriptType) is not supported")
+ throw BlueprintProcessorException("script type($scriptType) is not supported")
}
}
return scriptComponent
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt
index 43ad183c0..815b190dd 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt
@@ -22,8 +22,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createActionIdentifiersProto
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createCommonHeaderProto
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createExecutionServiceInputProto
-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.asJsonPrimitive
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.annotation.Scope
@@ -70,7 +70,7 @@ open class ComponentRemoteScriptExecutor(
val txId = UUID.randomUUID().toString()
val commonHeader = createCommonHeaderProto(
executionRequest.commonHeader.subRequestId,
- txId, BluePrintConstants.APP_NAME
+ txId, BlueprintConstants.APP_NAME
)
val actionIdentifier = createActionIdentifiersProto(blueprintName, blueprintVersion, blueprintAction)
@@ -92,16 +92,16 @@ open class ComponentRemoteScriptExecutor(
/** set node template attribute */
val statusMessage = executionServiceOutputProto.status.message
- if (statusMessage == BluePrintConstants.STATUS_SUCCESS) {
- setAttribute(ATTRIBUTE_STATUS, BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive())
+ if (statusMessage == BlueprintConstants.STATUS_SUCCESS) {
+ setAttribute(ATTRIBUTE_STATUS, BlueprintConstants.STATUS_SUCCESS.asJsonPrimitive())
} else {
val errorMessage = executionServiceOutputProto.status.errorMessage ?: "failed in remote execution"
- throw BluePrintProcessorException(errorMessage)
+ throw BlueprintProcessorException(errorMessage)
}
}
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
- bluePrintRuntimeService.getBluePrintError()
+ bluePrintRuntimeService.getBlueprintError()
.addError("Failed in ComponentRemoteScriptExecutor : ${runtimeException.message}")
}
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorDSL.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorDSL.kt
index 7bb071501..4263768b9 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorDSL.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorDSL.kt
@@ -17,8 +17,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.execution
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.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate
@@ -31,24 +31,24 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeType
/** Component Extensions **/
fun ServiceTemplateBuilder.nodeTypeComponentRemoteScriptExecutor() {
- val nodeType = BluePrintTypes.nodeTypeComponentRemoteScriptExecutor()
+ val nodeType = BlueprintTypes.nodeTypeComponentRemoteScriptExecutor()
if (this.nodeTypes == null) this.nodeTypes = hashMapOf()
this.nodeTypes!![nodeType.id!!] = nodeType
}
-fun BluePrintTypes.nodeTypeComponentRemoteScriptExecutor(): NodeType {
+fun BlueprintTypes.nodeTypeComponentRemoteScriptExecutor(): NodeType {
return nodeType(
- id = "component-remote-script-executor", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_COMPONENT,
+ id = "component-remote-script-executor", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_COMPONENT,
description = "Generic Remote Script Component Executor"
) {
/** Attribute definitions */
attribute(
- ComponentRemoteScriptExecutor.ATTRIBUTE_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON, false,
+ ComponentRemoteScriptExecutor.ATTRIBUTE_RESPONSE_DATA, BlueprintConstants.DATA_TYPE_JSON, false,
"Remote executed response data."
)
attribute(
- ComponentRemoteScriptExecutor.ATTRIBUTE_STATUS, BluePrintConstants.DATA_TYPE_STRING, true,
+ ComponentRemoteScriptExecutor.ATTRIBUTE_STATUS, BlueprintConstants.DATA_TYPE_STRING, true,
"Remote execution status."
)
@@ -56,35 +56,35 @@ fun BluePrintTypes.nodeTypeComponentRemoteScriptExecutor(): NodeType {
operation("ComponentRemoteScriptExecutor", "ComponentRemoteScriptExecutor Operation") {
inputs {
property(
- ComponentRemoteScriptExecutor.INPUT_SELECTOR, BluePrintConstants.DATA_TYPE_JSON,
+ ComponentRemoteScriptExecutor.INPUT_SELECTOR, BlueprintConstants.DATA_TYPE_JSON,
true, "Remote GRPC selector or DSL reference or GRPC Json config."
)
property(
- ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_NAME, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_NAME, BlueprintConstants.DATA_TYPE_STRING,
true, "Blueprint name."
)
property(
- ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_VERSION, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_VERSION, BlueprintConstants.DATA_TYPE_STRING,
true, "Blueprint version."
)
property(
- ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_ACTION, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_ACTION, BlueprintConstants.DATA_TYPE_STRING,
true, "Blueprint action name."
)
property(
- ComponentRemoteScriptExecutor.INPUT_TIMEOUT, BluePrintConstants.DATA_TYPE_INTEGER,
+ ComponentRemoteScriptExecutor.INPUT_TIMEOUT, BlueprintConstants.DATA_TYPE_INTEGER,
true, "Remote execution timeout in sec."
) {
defaultValue(180)
}
property(
- ComponentRemoteScriptExecutor.INPUT_REQUEST_DATA, BluePrintConstants.DATA_TYPE_JSON,
+ ComponentRemoteScriptExecutor.INPUT_REQUEST_DATA, BlueprintConstants.DATA_TYPE_JSON,
false, "Dynamic Json Content or DSL Json reference."
)
}
outputs {
property(
- ComponentRemoteScriptExecutor.OUTPUT_STATUS, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentRemoteScriptExecutor.OUTPUT_STATUS, BlueprintConstants.DATA_TYPE_STRING,
true, "Status of the Component Execution ( success or failure )"
)
}
@@ -98,7 +98,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentRemoteScriptExecutor(
description: String,
block: ComponentRemoteScriptExecutorNodeTemplateBuilder.() -> Unit
) {
- val nodeTemplate = BluePrintTypes.nodeTemplateComponentRemoteScriptExecutor(
+ val nodeTemplate = BlueprintTypes.nodeTemplateComponentRemoteScriptExecutor(
id, description,
block
)
@@ -106,7 +106,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentRemoteScriptExecutor(
nodeTemplates!![nodeTemplate.id!!] = nodeTemplate
}
-fun BluePrintTypes.nodeTemplateComponentRemoteScriptExecutor(
+fun BlueprintTypes.nodeTemplateComponentRemoteScriptExecutor(
id: String,
description: String,
block: ComponentRemoteScriptExecutorNodeTemplateBuilder.() -> Unit
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt
index a7ef0a8a0..597426a5f 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt
@@ -64,7 +64,7 @@ open class ComponentScriptExecutor(private var componentFunctionScriptingService
}
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
- bluePrintRuntimeService.getBluePrintError()
+ bluePrintRuntimeService.getBlueprintError()
.addError("Failed in ComponentScriptExecutor : ${runtimeException.message}")
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt
index 8592ce62b..08a964b55 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt
@@ -17,8 +17,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.execution
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.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate
@@ -32,53 +32,53 @@ import kotlin.reflect.KClass
/** Component Extensions **/
fun ServiceTemplateBuilder.nodeTypeComponentScriptExecutor() {
- val nodeType = BluePrintTypes.nodeTypeComponentScriptExecutor()
+ val nodeType = BlueprintTypes.nodeTypeComponentScriptExecutor()
if (this.nodeTypes == null) this.nodeTypes = hashMapOf()
this.nodeTypes!![nodeType.id!!] = nodeType
}
-fun BluePrintTypes.nodeTypeComponentScriptExecutor(): NodeType {
+fun BlueprintTypes.nodeTypeComponentScriptExecutor(): NodeType {
return nodeType(
- id = "component-script-executor", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_COMPONENT,
+ id = "component-script-executor", version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_COMPONENT,
description = "Generic Script Component Executor"
) {
- attribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON, false)
- attribute(ComponentScriptExecutor.ATTRIBUTE_STATUS, BluePrintConstants.DATA_TYPE_STRING, true)
+ attribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, BlueprintConstants.DATA_TYPE_JSON, false)
+ attribute(ComponentScriptExecutor.ATTRIBUTE_STATUS, BlueprintConstants.DATA_TYPE_STRING, true)
operation("ComponentScriptExecutor", "ComponentScriptExecutor Operation") {
inputs {
property(
- ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BlueprintConstants.DATA_TYPE_STRING,
true, "Script Type"
) {
- defaultValue(BluePrintConstants.SCRIPT_INTERNAL)
+ defaultValue(BlueprintConstants.SCRIPT_INTERNAL)
constrain {
validValues(
listOf(
- BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive(),
- BluePrintConstants.SCRIPT_JYTHON.asJsonPrimitive(),
- BluePrintConstants.SCRIPT_KOTLIN.asJsonPrimitive()
+ BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive(),
+ BlueprintConstants.SCRIPT_JYTHON.asJsonPrimitive(),
+ BlueprintConstants.SCRIPT_KOTLIN.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(
- ComponentScriptExecutor.INPUT_DYNAMIC_PROPERTIES, BluePrintConstants.DATA_TYPE_JSON,
+ ComponentScriptExecutor.INPUT_DYNAMIC_PROPERTIES, BlueprintConstants.DATA_TYPE_JSON,
false, "Dynamic Json Content or DSL Json reference."
)
}
outputs {
property(
- ComponentScriptExecutor.OUTPUT_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON,
+ ComponentScriptExecutor.OUTPUT_RESPONSE_DATA, BlueprintConstants.DATA_TYPE_JSON,
false, "Output Response"
)
property(
- ComponentScriptExecutor.OUTPUT_STATUS, BluePrintConstants.DATA_TYPE_STRING,
+ ComponentScriptExecutor.OUTPUT_STATUS, BlueprintConstants.DATA_TYPE_STRING,
true, "Status of the Component Execution ( success or failure )"
)
}
@@ -92,7 +92,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentScriptExecutor(
description: String,
block: ComponentScriptExecutorNodeTemplateBuilder.() -> Unit
) {
- val nodeTemplate = BluePrintTypes.nodeTemplateComponentScriptExecutor(
+ val nodeTemplate = BlueprintTypes.nodeTemplateComponentScriptExecutor(
id, description,
block
)
@@ -100,7 +100,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentScriptExecutor(
nodeTemplates!![nodeTemplate.id!!] = nodeTemplate
}
-fun BluePrintTypes.nodeTemplateComponentScriptExecutor(
+fun BlueprintTypes.nodeTemplateComponentScriptExecutor(
id: String,
description: String,
block: ComponentScriptExecutorNodeTemplateBuilder.() -> Unit
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt
index a0cd7fce6..4f3f60110 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt
@@ -27,8 +27,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteIdentifier
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionOutput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StatusType
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcClientService
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcClientService
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcLibPropertyService
import org.onap.ccsdk.cds.controllerblueprints.command.api.CommandExecutorServiceGrpc
import org.onap.ccsdk.cds.controllerblueprints.command.api.ExecutionInput
import org.onap.ccsdk.cds.controllerblueprints.command.api.ExecutionOutput
@@ -58,7 +58,7 @@ interface RemoteScriptExecutionService {
havingValue = "true", matchIfMissing = false
)
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-class GrpcRemoteScriptExecutionService(private val bluePrintGrpcLibPropertyService: BluePrintGrpcLibPropertyService) :
+class GrpcRemoteScriptExecutionService(private val bluePrintGrpcLibPropertyService: BlueprintGrpcLibPropertyService) :
RemoteScriptExecutionService {
private val log = LoggerFactory.getLogger(GrpcRemoteScriptExecutionService::class.java)!!
@@ -68,7 +68,7 @@ class GrpcRemoteScriptExecutionService(private val bluePrintGrpcLibPropertyServi
override suspend fun init(selector: Any) {
// Get the GRPC Client Service based on selector
- val grpcClientService: BluePrintGrpcClientService = if (selector is JsonNode) {
+ val grpcClientService: BlueprintGrpcClientService = if (selector is JsonNode) {
bluePrintGrpcLibPropertyService.blueprintGrpcClientService(selector)
} else {
bluePrintGrpcLibPropertyService.blueprintGrpcClientService(selector.toString())
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionService.kt
index fc37b488f..dadf72e04 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionService.kt
@@ -29,12 +29,12 @@ import kotlinx.coroutines.flow.consumeAsFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withTimeout
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.GrpcClientProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcClientService
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcClientService
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcLibPropertyService
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
@@ -58,7 +58,7 @@ interface StreamingRemoteExecutionService<ReqT, ResT> {
prefix = "blueprintsprocessor.streamingRemoteExecution", name = ["enabled"],
havingValue = "true", matchIfMissing = false
)
-class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertyService: BluePrintGrpcLibPropertyService) :
+class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertyService: BlueprintGrpcLibPropertyService) :
StreamingRemoteExecutionService<ExecutionServiceInput, ExecutionServiceOutput> {
private val log = logger(StreamingRemoteExecutionServiceImpl::class)
@@ -84,12 +84,12 @@ class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertySe
val grpcChannel = grpcChannel(selector)
/** Get Send and Receive Channel for bidirectional process method*/
- val channels = clientCallBidiStreaming(BluePrintProcessingServiceGrpc.getProcessMethod(), grpcChannel)
+ val channels = clientCallBidiStreaming(BlueprintProcessingServiceGrpc.getProcessMethod(), grpcChannel)
commChannels[txId] = channels
}
val commChannel = commChannels[txId]
- ?: throw BluePrintException("failed to create response subscription for transactionId($txId) channel")
+ ?: throw BlueprintException("failed to create response subscription for transactionId($txId) channel")
log.info("created subscription for transactionId($txId)")
@@ -102,7 +102,7 @@ class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertySe
*/
override suspend fun send(txId: String, input: ExecutionServiceInput) {
val sendChannel = commChannels[txId]?.requestChannel
- ?: throw BluePrintException("failed to get transactionId($txId) send channel")
+ ?: throw BlueprintException("failed to get transactionId($txId) send channel")
coroutineScope {
launch {
sendChannel.send(input)
@@ -127,7 +127,7 @@ class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertySe
/** Send the request */
val sendChannel = commChannels[txId]?.requestChannel
- ?: throw BluePrintException("failed to get transactionId($txId) send channel")
+ ?: throw BlueprintException("failed to get transactionId($txId) send channel")
sendChannel.send(input)
/** Receive the response with timeout */
@@ -186,7 +186,7 @@ class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertySe
}
suspend fun createGrpcChannel(grpcProperties: GrpcClientProperties): ManagedChannel {
- val grpcClientService: BluePrintGrpcClientService = bluePrintGrpcLibPropertyService
+ val grpcClientService: BlueprintGrpcClientService = bluePrintGrpcLibPropertyService
.blueprintGrpcClientService(grpcProperties)
return grpcClientService.channel()
}
@@ -203,7 +203,7 @@ class StreamingRemoteExecutionServiceImpl(private val bluePrintGrpcLibPropertySe
selector
}
else -> {
- throw BluePrintException("couldn't process selector($selector)")
+ throw BlueprintException("couldn't process selector($selector)")
}
}
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonService.kt
index 2f1ae2fc5..69cb0b6eb 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonService.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonService.kt
@@ -16,9 +16,9 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
import org.springframework.stereotype.Service
// TODO("After Jython depreciation, this interface will be removed")
@@ -26,15 +26,15 @@ import org.springframework.stereotype.Service
@Deprecated("CDS won's support Jython services")
interface BlueprintJythonService {
- fun jythonComponentInstance(bluePrintContext: BluePrintContext, scriptClassReference: String):
+ fun jythonComponentInstance(bluePrintContext: BlueprintContext, scriptClassReference: String):
BlueprintFunctionNode<*, *>
}
@Service
open class DeprecatedBlueprintJythonService : BlueprintJythonService {
- override fun jythonComponentInstance(bluePrintContext: BluePrintContext, scriptClassReference: String):
+ override fun jythonComponentInstance(bluePrintContext: BlueprintContext, scriptClassReference: String):
BlueprintFunctionNode<*, *> {
- throw BluePrintProcessorException("Include python-executor module for Jython support")
+ throw BlueprintProcessorException("Include python-executor module for Jython support")
}
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
index b3a0a5892..5ef62d0bc 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
@@ -32,15 +32,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createExecutionServiceOutputProto
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createStatus
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.toProto
-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.data.Implementation
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-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.service.BlueprintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput
import kotlin.test.assertNotNull
@@ -48,7 +48,7 @@ class ComponentRemoteScriptExecutorTest {
@Test
fun testNodeComponentRemoteScriptExecutorType() {
- val nodeType = BluePrintTypes.nodeTypeComponentRemoteScriptExecutor()
+ val nodeType = BlueprintTypes.nodeTypeComponentRemoteScriptExecutor()
assertNotNull(nodeType, "failed to generate nodeType Component Remote Script Executor")
}
@@ -96,7 +96,7 @@ class ComponentRemoteScriptExecutorTest {
fun testComponentRemoteScriptExecutor() {
runBlocking {
/** Mock blueprint context */
- val blueprintContext = mockk<BluePrintContext>()
+ val blueprintContext = mockk<BlueprintContext>()
every { blueprintContext.rootPath } returns normalizedPathName("target")
every {
blueprintContext.nodeTemplateOperationImplementation(
@@ -104,7 +104,7 @@ class ComponentRemoteScriptExecutorTest {
)
} returns Implementation()
- val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234")
+ val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234")
every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
val mockExecutionServiceInput = mockExecutionServiceInput(bluePrintRuntime)
@@ -130,7 +130,7 @@ class ComponentRemoteScriptExecutorTest {
}
}
- private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBluePrintRuntimeService): ExecutionServiceInput {
+ private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBlueprintRuntimeService): ExecutionServiceInput {
val mapper = ObjectMapper()
val requestNode = mapper.createObjectNode()
@@ -138,10 +138,10 @@ class ComponentRemoteScriptExecutorTest {
requestNode.put("type", "grpc")
val operationInputs = hashMapOf<String, JsonNode>()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "remote-execute".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "remote-execute".asJsonPrimitive()
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] =
"ComponentRemoteScriptExecutor".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "process".asJsonPrimitive()
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = "process".asJsonPrimitive()
operationInputs[ComponentRemoteScriptExecutor.INPUT_SELECTOR] = "remote-script-executor".asJsonPrimitive()
operationInputs[ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_NAME] = "sample-blueprint".asJsonPrimitive()
@@ -205,7 +205,7 @@ class ComponentRemoteScriptExecutorTest {
return createExecutionServiceOutputProto(
executionServiceInput.commonHeader.toProto(),
executionServiceInput.actionIdentifiers.toProto(),
- createStatus(BluePrintConstants.STATUS_SUCCESS, 200),
+ createStatus(BlueprintConstants.STATUS_SUCCESS, 200),
responsePayload
)
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt
index 8edea46f6..7ac6134d9 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt
@@ -25,13 +25,13 @@ import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status
import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput
-private val log = logger(MockBluePrintProcessingServer::class)
+private val log = logger(MockBlueprintProcessingServer::class)
-class MockBluePrintProcessingServer : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() {
+class MockBlueprintProcessingServer : BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase() {
override fun process(responseObserver: StreamObserver<ExecutionServiceOutput>): StreamObserver<ExecutionServiceInput> {
@@ -96,7 +96,7 @@ fun main() {
val server = ServerBuilder
.forPort(50052)
.intercept(GrpcServerLoggingInterceptor())
- .addService(MockBluePrintProcessingServer())
+ .addService(MockBlueprintProcessingServer())
.build()
server.start()
log.info("GRPC Serve started(${server.isShutdown}) on port(${server.port})...")
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
index 28e2b11b2..0d3e42a5e 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
@@ -35,8 +35,8 @@ import org.junit.Test
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ACTION_MODE_SYNC
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.GRPCLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcLibPropertyService
-import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.MockBluePrintProcessingServer
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.MockBlueprintProcessingServer
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
@@ -67,11 +67,11 @@ class StreamingRemoteExecutionServiceTest {
@ExperimentalCoroutinesApi
@FlowPreview
fun testStreamingChannel() {
- grpcCleanup.register(serverBuilder.addService(MockBluePrintProcessingServer()).build().start())
+ grpcCleanup.register(serverBuilder.addService(MockBlueprintProcessingServer()).build().start())
val channel = grpcCleanup.register(channelBuilder.maxInboundMessageSize(1024).build())
runBlocking {
- val bluePrintGrpcLibPropertyService = BluePrintGrpcLibPropertyService(mockk())
+ val bluePrintGrpcLibPropertyService = BlueprintGrpcLibPropertyService(mockk())
val streamingRemoteExecutionService = StreamingRemoteExecutionServiceImpl(bluePrintGrpcLibPropertyService)
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
index 377b95010..8440e5faa 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
@@ -34,22 +34,22 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.CDS_LOCK_GROUP
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeComponentScriptExecutor
-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.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation
import org.onap.ccsdk.cds.controllerblueprints.core.data.LockAssignment
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintScriptsServiceImpl
-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.scripts.BlueprintScriptsServiceImpl
+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.utils.JacksonUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
@@ -65,14 +65,14 @@ import kotlin.test.assertNotNull
@ContextConfiguration(
classes = [
ComponentFunctionScriptingService::class,
- BluePrintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class
+ BlueprintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class
]
)
class AbstractComponentFunctionTest {
- lateinit var bluePrintRuntimeService: DefaultBluePrintRuntimeService
- lateinit var blueprintContext: BluePrintContext
- lateinit var blueprintClusterService: BluePrintClusterService
+ lateinit var bluePrintRuntimeService: DefaultBlueprintRuntimeService
+ lateinit var blueprintContext: BlueprintContext
+ lateinit var blueprintClusterService: BlueprintClusterService
@Autowired
lateinit var compSvc: ComponentFunctionScriptingService
@@ -149,7 +149,7 @@ class AbstractComponentFunctionTest {
@Test
fun testComponentScriptExecutorNodeType() {
- val componentScriptExecutor = BluePrintTypes.nodeTypeComponentScriptExecutor()
+ val componentScriptExecutor = BlueprintTypes.nodeTypeComponentScriptExecutor()
assertNotNull(componentScriptExecutor.interfaces, "failed to get interface operations")
}
@@ -274,7 +274,7 @@ class AbstractComponentFunctionTest {
/**
* Mocked input for abstract function test.
*/
- private fun getMockedInput(bluePrintRuntime: DefaultBluePrintRuntimeService):
+ private fun getMockedInput(bluePrintRuntime: DefaultBlueprintRuntimeService):
ExecutionServiceInput {
val mapper = ObjectMapper()
@@ -283,11 +283,11 @@ class AbstractComponentFunctionTest {
rootNode.put("type", "rest")
val operationInputs = hashMapOf<String, JsonNode>()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
"activate-restconf".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] =
"interfaceName".asJsonPrimitive()
- operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] =
+ operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] =
"operationName".asJsonPrimitive()
operationInputs["dynamic-properties"] = rootNode