diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-11-13 16:47:33 -0500 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-11-13 16:47:33 -0500 |
commit | cbbe0eac48b8df6e616f56a8ef51fbc7c955d171 (patch) | |
tree | e9a5b4a4bfc2da3e97bfb32094ae8af1bd973c24 /ms/blueprintsprocessor/modules/services/resolution-service | |
parent | b0c989325aff489c06c32fad3aa1c996d5a4b7d6 (diff) |
Blueprints Processor Microservice
Implement basic blueprint service logic workflow execution engine.
Change-Id: Ifbbad70f2bdc4ba879b07d972083a411c7cc02f1
Issue-ID: CCSDK-672
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/resolution-service')
-rw-r--r-- | ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt index d442c96be..3ee7e41ff 100644 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt @@ -17,12 +17,11 @@ package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution
-import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.BlueprintProcessorException
-import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status
-import org.onap.ccsdk.apps.controllerblueprints.core.format
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.BulkResourceSequencingUtils
import org.springframework.stereotype.Service
@@ -59,22 +58,22 @@ class ResourceResolutionService(private val resourceAssignmentProcessorFactory: val bulkSequenced = BulkResourceSequencingUtils.process(resourceAssignments)
bulkSequenced.map { batchResourceAssignments ->
- batchResourceAssignments.filter { it.name != "*" && it.name != "start"}
- .map { resourceAssignment ->
- val dictionarySource = resourceAssignment.dictionarySource
- val processorInstanceName = "resource-assignment-processor-".plus(dictionarySource)
- val resourceAssignmentProcessor = resourceAssignmentProcessorFactory.getInstance(processorInstanceName)
- ?: throw BlueprintProcessorException(format("failed to get resource processor for instance name({}) " +
- "for resource assignment({})", processorInstanceName, resourceAssignment.name))
- try {
- resourceAssignmentProcessor.validate(resourceAssignment, context)
- resourceAssignmentProcessor.process(resourceAssignment, context)
- } catch (e: Exception) {
- resourceAssignmentProcessor.errorHandle(resourceAssignment, context)
- throw BlueprintProcessorException(e)
- }
+ batchResourceAssignments.filter { it.name != "*" && it.name != "start" }
+ .map { resourceAssignment ->
+ val dictionarySource = resourceAssignment.dictionarySource
+ val processorInstanceName = "resource-assignment-processor-".plus(dictionarySource)
+ val resourceAssignmentProcessor = resourceAssignmentProcessorFactory.getInstance(processorInstanceName)
+ ?: throw BluePrintProcessorException("failed to get resource processor for instance name($processorInstanceName) " +
+ "for resource assignment(${resourceAssignment.name})")
+ try {
+ resourceAssignmentProcessor.validate(resourceAssignment, context)
+ resourceAssignmentProcessor.process(resourceAssignment, context)
+ } catch (e: Exception) {
+ resourceAssignmentProcessor.errorHandle(resourceAssignment, context)
+ throw BluePrintProcessorException(e)
+ }
- }
+ }
}
}
}
|