summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <bs2796@att.com>2019-01-11 11:30:40 -0500
committerMuthuramalingam, Brinda Santh <bs2796@att.com>2019-01-14 11:21:09 -0500
commit3f215fdd8239c8a32614d84c5b2dab518dbc819c (patch)
tree553329c59707a2d338af491de743a28e85755bdb /ms/blueprintsprocessor/functions
parenta8588a4aab5ff95890b9ad9ae1bc02a2043fab54 (diff)
Add blueprint Kotlin script support.
Change-Id: I92b8e9850ea07c7f671e7aada9770713854534c3 Issue-ID: CCSDK-941 Signed-off-by: Muthuramalingam, Brinda Santh <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt42
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt4
2 files changed, 46 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt
new file mode 100644
index 00000000..ffe09e4d
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution
+
+import org.jetbrains.kotlin.script.util.DependsOn
+import org.jetbrains.kotlin.script.util.Repository
+import kotlin.script.experimental.annotations.KotlinScript
+import kotlin.script.experimental.api.ScriptCompilationConfiguration
+import kotlin.script.experimental.api.defaultImports
+import kotlin.script.experimental.jvm.dependenciesFromCurrentContext
+import kotlin.script.experimental.jvm.jvm
+
+@KotlinScript(fileExtension = "resourceassignmentprocessor.kts",
+ compilationConfiguration = ResourceAssignmentProcessorScriptConfiguration::class)
+abstract class ResourceAssignmentProcessorScript {
+
+}
+
+object ResourceAssignmentProcessorScriptConfiguration : ScriptCompilationConfiguration(
+ {
+ defaultImports(DependsOn::class, Repository::class)
+ jvm {
+ dependenciesFromCurrentContext(
+ wholeClasspath = true
+ )
+ }
+ }
+) \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt
index f1de8f7d..4aec2e50 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt
@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service
open class CapabilityResourceAssignmentProcessor : ResourceAssignmentProcessor() {
companion object {
+ const val CAPABILITY_TYPE_KOTLIN_COMPONENT = "KOTLIN-COMPONENT"
const val CAPABILITY_TYPE_JAVA_COMPONENT = "JAVA-COMPONENT"
const val CAPABILITY_TYPE_JYTHON_COMPONENT = "JYTHON-COMPONENT"
}
@@ -58,6 +59,9 @@ open class CapabilityResourceAssignmentProcessor : ResourceAssignmentProcessor()
var componentResourceAssignmentProcessor: ResourceAssignmentProcessor? = null
when (instanceType) {
+ CAPABILITY_TYPE_KOTLIN_COMPONENT ->{
+ TODO("NO implementation")
+ }
CAPABILITY_TYPE_JAVA_COMPONENT -> {
// Initialize Capability Resource Assignment Processor
componentResourceAssignmentProcessor = applicationContext.getBean(instanceName, ResourceAssignmentProcessor::class.java)