diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-26 12:00:59 -0400 |
---|---|---|
committer | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-28 15:44:01 -0400 |
commit | daab14bd058de198c80b71d63e108fd788b7f5ee (patch) | |
tree | 252cfdef5b2e1500e5bd152f3f5c52602b6b0deb /ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin | |
parent | 82e396d6917519468376d177dd6a2710e84fa23a (diff) |
Revert "Renaming Files having BluePrint to have Blueprint"
The renaming in CCSDK-3098 caused breaking changes to the grpc api and
compile issues for kotlin scripts.
Issue-ID: CCSDK-3385
Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin')
10 files changed, 108 insertions, 108 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 f85b6424d..2186d470b 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,11 +146,11 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic status.eventType = EventType.EVENT_COMPONENT_EXECUTED.name - bluePrintRuntimeService.getBlueprintError().stepErrors(stepName)?.let { - status.message = BlueprintConstants.STATUS_FAILURE + bluePrintRuntimeService.getBluePrintError().stepErrors(stepName)?.let { + status.message = BluePrintConstants.STATUS_FAILURE } } catch (e: Exception) { - status.message = BlueprintConstants.STATUS_FAILURE + status.message = BluePrintConstants.STATUS_FAILURE status.eventType = EventType.EVENT_COMPONENT_FAILURE.name } executionServiceOutput.status = status @@ -184,7 +184,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? { @@ -196,11 +196,11 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic } fun addError(type: String, name: String, error: String) { - bluePrintRuntimeService.getBlueprintError().addError(type, name, error, stepName) + bluePrintRuntimeService.getBluePrintError().addError(type, name, error, stepName) } fun addError(error: String) { - bluePrintRuntimeService.getBlueprintError().addError(error, stepName) + bluePrintRuntimeService.getBluePrintError().addError(error, stepName) } /** @@ -229,12 +229,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 3cb46ed44..8b46ae693 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 41e26e4ab..33f5d749f 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 b798f0083..3483ce1d7 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 5a552e32a..2581e5628 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,11 +92,11 @@ 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) } } 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 4263768b9..7bb071501 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/ComponentScriptExecutorDSL.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt index 08a964b55..8592ce62b 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 7e3f16f39..ff6027341 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 @@ -29,8 +29,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutio import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionOutput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptUploadBlueprintOutput 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 @@ -63,7 +63,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)!! @@ -73,7 +73,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 e28a8c405..d765edeaf 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 @@ -30,12 +30,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 @@ -59,7 +59,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) @@ -85,12 +85,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)") @@ -103,7 +103,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) @@ -128,7 +128,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 */ @@ -187,7 +187,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() } @@ -204,7 +204,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 69cb0b6eb..2f1ae2fc5 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") } } |