Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / blueprints / blueprint-validation / src / main / kotlin / org / onap / ccsdk / cds / controllerblueprints / validation / BluePrintServiceTemplateValidatorImpl.kt
@@ -18,16 +18,16 @@ package org.onap.ccsdk.cds.controllerblueprints.validation
 
 import com.google.common.base.Preconditions
 import org.apache.commons.lang3.StringUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
 import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate
 import org.onap.ccsdk.cds.controllerblueprints.core.data.TopologyTemplate
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintServiceTemplateValidator
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeValidatorService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintServiceTemplateValidator
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeValidatorService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
@@ -35,21 +35,21 @@ import org.springframework.stereotype.Service
 
 @Service("default-service-template-validator")
 @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValidatorService: BlueprintTypeValidatorService) :
-    BlueprintServiceTemplateValidator {
+open class BluePrintServiceTemplateValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) :
+    BluePrintServiceTemplateValidator {
 
-    private val log = LoggerFactory.getLogger(BlueprintServiceTemplateValidatorImpl::class.toString())
+    private val log = LoggerFactory.getLogger(BluePrintServiceTemplateValidatorImpl::class.toString())
 
-    lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*>
-    lateinit var error: BlueprintError
+    lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
+    lateinit var error: BluePrintError
 
     var paths: MutableList<String> = arrayListOf()
 
-    override fun validate(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, serviceTemplate: ServiceTemplate) {
+    override fun validate(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, serviceTemplate: ServiceTemplate) {
         log.trace("Validating Service Template..")
         try {
             this.bluePrintRuntimeService = bluePrintRuntimeService
-            this.error = bluePrintRuntimeService.getBlueprintError()
+            this.error = bluePrintRuntimeService.getBluePrintError()
 
             serviceTemplate.metadata?.let { validateMetadata(serviceTemplate.metadata!!) }
             serviceTemplate.dataTypes?.let { validateDataTypes(serviceTemplate.dataTypes!!) }
@@ -58,18 +58,18 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida
             serviceTemplate.topologyTemplate?.let { validateTopologyTemplate(serviceTemplate.topologyTemplate!!) }
         } catch (e: Exception) {
             log.error("failed in blueprint service template validation", e)
-            error.addError(BlueprintConstants.PATH_SERVICE_TEMPLATE, paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!!, "BlueprintServiceTemplateValidator")
+            error.addError(BluePrintConstants.PATH_SERVICE_TEMPLATE, paths.joinToString(BluePrintConstants.PATH_DIVIDER), e.message!!, "BlueprintServiceTemplateValidator")
         }
     }
 
     fun validateMetadata(metaDataMap: MutableMap<String, String>) {
 
-        paths.add(BlueprintConstants.PATH_METADATA)
+        paths.add(BluePrintConstants.PATH_METADATA)
 
-        val templateName = metaDataMap[BlueprintConstants.METADATA_TEMPLATE_NAME]
-        val templateVersion = metaDataMap[BlueprintConstants.METADATA_TEMPLATE_VERSION]
-        val templateTags = metaDataMap[BlueprintConstants.METADATA_TEMPLATE_TAGS]
-        val templateAuthor = metaDataMap[BlueprintConstants.METADATA_TEMPLATE_AUTHOR]
+        val templateName = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_NAME]
+        val templateVersion = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_VERSION]
+        val templateTags = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_TAGS]
+        val templateAuthor = metaDataMap[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]
 
         Preconditions.checkArgument(StringUtils.isNotBlank(templateName), "failed to get template name metadata")
         Preconditions.checkArgument(StringUtils.isNotBlank(templateVersion), "failed to get template version metadata")
@@ -81,7 +81,7 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida
 
     fun validateDataTypes(dataTypes: MutableMap<String, DataType>) {
 
-        paths.add(BlueprintConstants.PATH_DATA_TYPES)
+        paths.add(BluePrintConstants.PATH_DATA_TYPES)
         dataTypes.forEach { dataTypeName, dataType ->
             // Validate Single Data Type
             bluePrintTypeValidatorService.validateDataType(bluePrintRuntimeService, dataTypeName, dataType)
@@ -90,7 +90,7 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida
     }
 
     fun validateArtifactTypes(artifactTypes: MutableMap<String, ArtifactType>) {
-        paths.add(BlueprintConstants.PATH_ARTIFACT_TYPES)
+        paths.add(BluePrintConstants.PATH_ARTIFACT_TYPES)
         artifactTypes.forEach { artifactName, artifactType ->
             // Validate Single Artifact Type
             bluePrintTypeValidatorService.validateArtifactType(bluePrintRuntimeService, artifactName, artifactType)
@@ -99,7 +99,7 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida
     }
 
     fun validateNodeTypes(nodeTypes: MutableMap<String, NodeType>) {
-        paths.add(BlueprintConstants.PATH_NODE_TYPES)
+        paths.add(BluePrintConstants.PATH_NODE_TYPES)
         nodeTypes.forEach { nodeTypeName, nodeType ->
             // Validate Single Node Type
             bluePrintTypeValidatorService.validateNodeType(bluePrintRuntimeService, nodeTypeName, nodeType)
@@ -108,7 +108,7 @@ open class BlueprintServiceTemplateValidatorImpl(private val bluePrintTypeValida
     }
 
     fun validateTopologyTemplate(topologyTemplate: TopologyTemplate) {
-        paths.add(BlueprintConstants.PATH_TOPOLOGY_TEMPLATE)
+        paths.add(BluePrintConstants.PATH_TOPOLOGY_TEMPLATE)
         bluePrintTypeValidatorService.validateTopologyTemplate(bluePrintRuntimeService, "topologyTemplate", topologyTemplate)
         paths.removeAt(paths.lastIndex)
     }