aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-08-02 10:02:34 -0400
committerDan Timoney <dtimoney@att.com>2019-08-09 20:03:31 +0000
commit132312ce49fa4efbe7008f3055aa86a8853bedd3 (patch)
treee6a17f60642ca0dda38216baee8b838ed678c900 /ms/blueprintsprocessor/modules/services
parent2d879240396861aa253dd65b2476f35a2ffc0493 (diff)
Add resource source template DSL.
Change-Id: If68ce2e944700cb19380d34ff3b466a9c8633472 Issue-ID: CCSDK-1577 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services')
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutorDSL.kt56
1 files changed, 29 insertions, 27 deletions
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 b678d65ba..bf49972a9 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
@@ -65,49 +65,51 @@ fun BluePrintTypes.nodeTypeComponentScriptExecutor(): NodeType {
/** Component Builder */
fun BluePrintTypes.nodeTemplateComponentScriptExecutor(id: String,
description: String,
- block: ComponentScriptExecutorNodeTemplateOperationImplBuilder.() -> Unit)
+ block: ComponentScriptExecutorNodeTemplateBuilder.() -> Unit)
: NodeTemplate {
- return ComponentScriptExecutorNodeTemplateOperationImplBuilder(id, description).apply(block).build()
+ return ComponentScriptExecutorNodeTemplateBuilder(id, description).apply(block).build()
}
-class ComponentScriptExecutorNodeTemplateOperationImplBuilder(id: String, description: String) :
- AbstractNodeTemplateOperationImplBuilder<PropertiesAssignmentBuilder, ComponentScriptExecutorInputAssignmentBuilder,
- ComponentScriptExecutorOutputAssignmentBuilder>(id, "component-script-executor",
+class ComponentScriptExecutorNodeTemplateBuilder(id: String, description: String) :
+ AbstractNodeTemplateOperationImplBuilder<PropertiesAssignmentBuilder,
+ ComponentScriptExecutorNodeTemplateBuilder.InputsBuilder,
+ ComponentScriptExecutorNodeTemplateBuilder.OutputsBuilder>(id, "component-script-executor",
"ComponentScriptExecutor",
- description)
+ description) {
-class ComponentScriptExecutorInputAssignmentBuilder : PropertiesAssignmentBuilder() {
+ class InputsBuilder : PropertiesAssignmentBuilder() {
- fun type(type: String) = type(type.asJsonPrimitive())
+ fun type(type: String) = type(type.asJsonPrimitive())
- fun type(type: JsonNode) {
- property(ComponentScriptExecutor.INPUT_SCRIPT_TYPE, type)
- }
+ fun type(type: JsonNode) {
+ property(ComponentScriptExecutor.INPUT_SCRIPT_TYPE, type)
+ }
- fun scriptClassReference(scriptClassReference: String) = scriptClassReference(scriptClassReference.asJsonPrimitive())
+ fun scriptClassReference(scriptClassReference: String) = scriptClassReference(scriptClassReference.asJsonPrimitive())
- fun scriptClassReference(scriptClassReference: JsonNode) {
- property(ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, scriptClassReference)
- }
+ fun scriptClassReference(scriptClassReference: JsonNode) {
+ property(ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, scriptClassReference)
+ }
- fun dynamicProperties(dynamicProperties: String) = dynamicProperties(dynamicProperties.asJsonType())
+ fun dynamicProperties(dynamicProperties: String) = dynamicProperties(dynamicProperties.asJsonType())
- fun dynamicProperties(dynamicProperties: JsonNode) {
- property(ComponentScriptExecutor.INPUT_DYNAMIC_PROPERTIES, dynamicProperties)
+ fun dynamicProperties(dynamicProperties: JsonNode) {
+ property(ComponentScriptExecutor.INPUT_DYNAMIC_PROPERTIES, dynamicProperties)
+ }
}
-}
-class ComponentScriptExecutorOutputAssignmentBuilder : PropertiesAssignmentBuilder() {
+ class OutputsBuilder : PropertiesAssignmentBuilder() {
- fun status(status: String) = status(status.asJsonPrimitive())
+ fun status(status: String) = status(status.asJsonPrimitive())
- fun status(status: JsonNode) {
- property(ComponentScriptExecutor.OUTPUT_STATUS, status)
- }
+ fun status(status: JsonNode) {
+ property(ComponentScriptExecutor.OUTPUT_STATUS, status)
+ }
- fun responseData(responseData: String) = responseData(responseData.asJsonType())
+ fun responseData(responseData: String) = responseData(responseData.asJsonType())
- fun responseData(responseData: JsonNode) {
- property(ComponentScriptExecutor.OUTPUT_RESPONSE_DATA, responseData)
+ fun responseData(responseData: JsonNode) {
+ property(ComponentScriptExecutor.OUTPUT_RESPONSE_DATA, responseData)
+ }
}
} \ No newline at end of file