*/
package org.onap.ccsdk.cds.controllerblueprints.core.service
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTemplateService
import org.springframework.stereotype.Service
@Service
-class BlueprintTemplateService(private val bluePrintLoadConfiguration: BlueprintLoadConfiguration) :
+class BluePrintTemplateService(private val bluePrintLoadConfiguration: BluePrintLoadConfiguration) :
BlueprintTemplateService {
override suspend fun generateContent(
- bluePrintRuntimeService: BlueprintRuntimeService<*>,
+ bluePrintRuntimeService: BluePrintRuntimeService<*>,
nodeTemplateName: String,
artifactName: String,
jsonData: String,
val template = bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName)
return when (templateType) {
- BlueprintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA -> {
- BlueprintJinjaTemplateService.generateContent(
+ BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA -> {
+ BluePrintJinjaTemplateService.generateContent(
template,
jsonData,
ignoreJsonNull,
bluePrintRuntimeService.bluePrintContext().version()
)
}
- BlueprintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY -> {
- BlueprintVelocityTemplateService.generateContent(template, jsonData, ignoreJsonNull, additionalContext)
+ BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY -> {
+ BluePrintVelocityTemplateService.generateContent(template, jsonData, ignoreJsonNull, additionalContext)
}
else -> {
- throw BlueprintProcessorException(
- "Unknown Artifact type, expecting ${BlueprintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA}" +
- "or ${BlueprintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY}"
+ throw BluePrintProcessorException(
+ "Unknown Artifact type, expecting ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA}" +
+ "or ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY}"
)
}
}