package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer
-import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
+import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.InterfaceDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
import org.onap.ccsdk.cds.controllerblueprints.core.data.OperationDefinition
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTypeEnhancer
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTypeEnhancer
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.annotation.Scope
import org.springframework.stereotype.Service
@Service
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-open class BluePrintNodeTypeEnhancerImpl(
- private val bluePrintRepoService: BluePrintRepoService,
- private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService
-) : BluePrintNodeTypeEnhancer {
+open class BlueprintNodeTypeEnhancerImpl(
+ private val bluePrintRepoService: BlueprintRepoService,
+ private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService
+) : BlueprintNodeTypeEnhancer {
- private val log = logger(BluePrintNodeTypeEnhancerImpl::class)
+ private val log = logger(BlueprintNodeTypeEnhancerImpl::class)
- lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
- lateinit var bluePrintContext: BluePrintContext
+ lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*>
+ lateinit var bluePrintContext: BlueprintContext
- override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, nodeType: NodeType) {
+ override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, nodeType: NodeType) {
this.bluePrintRuntimeService = bluePrintRuntimeService
this.bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val derivedFrom = nodeType.derivedFrom
- if (!BluePrintTypes.rootNodeTypes().contains(derivedFrom)) {
- val derivedFromNodeType = BluePrintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, name)
+ if (!BlueprintTypes.rootNodeTypes().contains(derivedFrom)) {
+ val derivedFromNodeType = BlueprintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, name)
// Enrich NodeType
enhance(bluePrintRuntimeService, derivedFrom, derivedFromNodeType)
}
// Populate Requirement Node
requirementDefinition.node?.let { requirementNodeTypeName ->
// Get Requirement NodeType from Repo and Update Service Template
- val requirementNodeType = BluePrintEnhancerUtils.populateNodeType(
+ val requirementNodeType = BlueprintEnhancerUtils.populateNodeType(
bluePrintContext,
bluePrintRepoService, requirementNodeTypeName
)
// Enhance Relationship Type
val relationShipTypeName = requirementDefinition.relationship
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
"couldn't get relationship name for the NodeType($nodeTypeName) " +
"Requirement($requirementName)"
)
* Get the Relationship Type from database and add to Blueprint Context
*/
open fun enrichRelationShipType(relationshipName: String) {
- BluePrintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, relationshipName)
+ BlueprintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, relationshipName)
}
}