aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src
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
commit3d281342eb2352c872f46b180afbdd95338dc6ac (patch)
tree5513305796c39583c8c952b36eea59ddbc5ae3f2 /ms/blueprintsprocessor/functions/resource-resolution/src
parentd7d47b415d9e1b509e18c85f3e33e980a91ad872 (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/resource-resolution/src')
-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 000000000..ffe09e4df
--- /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 f1de8f7d3..4aec2e505 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)