aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-15 13:12:09 -0500
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-15 13:12:09 -0500
commit13f780024e7ca0943f5409691fafbd503c26d837 (patch)
tree8a826a788d3ce0fdc65a151c09cedae4db2fa840 /components
parentec92866fa0bc8d8cd7a6ce4d5d5fd014d8eacef1 (diff)
Blueprints Processor Microservice
Implement Resource Resolution Processor Interface definitions. Change-Id: Ic2eb7915d48b9473639494ee9d159003bf56e81e Issue-ID: CCSDK-724 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'components')
-rw-r--r--components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceAssignmentProcessor.kt43
1 files changed, 33 insertions, 10 deletions
diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceAssignmentProcessor.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceAssignmentProcessor.kt
index a6802f67..327d50ac 100644
--- a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceAssignmentProcessor.kt
+++ b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceAssignmentProcessor.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2018 IBM.
+ * Modifications 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.
@@ -16,19 +17,41 @@
package org.onap.ccsdk.apps.controllerblueprints.resource.dict
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService
+import org.slf4j.LoggerFactory
-interface ResourceAssignmentProcessor {
+abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssignment, ResourceAssignment> {
- @Throws(BluePrintProcessorException::class)
- fun validate(resourceAssignment: ResourceAssignment, context : MutableMap<String, Any>)
+ private val log = LoggerFactory.getLogger(ResourceAssignmentProcessor::class.java)
- @Throws(BluePrintProcessorException::class)
- fun process(resourceAssignment: ResourceAssignment, context : MutableMap<String, Any>)
+ private var bluePrintRuntimeService: BluePrintRuntimeService<*>? = null
- @Throws(BluePrintProcessorException::class)
- fun errorHandle(resourceAssignment: ResourceAssignment, context : MutableMap<String, Any>)
+ open fun setBlueprintRuntimeService(bluePrintRuntimeService: BluePrintRuntimeService<*>) {
+ this.bluePrintRuntimeService = bluePrintRuntimeService
+ }
- @Throws(BluePrintProcessorException::class)
- fun reTrigger(resourceAssignment: ResourceAssignment, context : MutableMap<String, Any>)
+ open fun getBlueprintRuntimeService(): BluePrintRuntimeService<*> {
+ return this.bluePrintRuntimeService!!
+ }
+
+ override fun prepareRequest(resourceAssignment: ResourceAssignment): ResourceAssignment {
+ log.info("prepareRequest...")
+ return resourceAssignment
+ }
+
+ override fun prepareResponse(): ResourceAssignment {
+ log.info("Preparing Response...")
+ return ResourceAssignment()
+ }
+
+ override fun apply(executionServiceInput: ResourceAssignment): ResourceAssignment {
+ prepareRequest(executionServiceInput)
+ process(executionServiceInput)
+ return prepareResponse()
+ }
+
+ override abstract fun process(executionRequest: ResourceAssignment)
+
+ override abstract fun recover(runtimeException: RuntimeException, executionRequest: ResourceAssignment)
} \ No newline at end of file