*/
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}"
)
}
}