import com.fasterxml.jackson.databind.JsonNode
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.BluePrintException
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType
*
* @author Brinda Santh
*/
-interface BluePrintValidatorService : Serializable {
+interface BlueprintValidatorService : Serializable {
- @Throws(BluePrintException::class)
- fun validateBlueprint(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>)
+ @Throws(BlueprintException::class)
+ fun validateBlueprint(bluePrintContext: BlueprintContext, properties: MutableMap<String, Any>)
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
fun validateBlueprint(serviceTemplate: ServiceTemplate, properties: MutableMap<String, Any>)
}
@Deprecated("Decomposed implementation moved to blueprint-validation module")
-open class BluePrintValidatorDefaultService : BluePrintValidatorService {
+open class BlueprintValidatorDefaultService : BlueprintValidatorService {
- val log = LoggerFactory.getLogger(BluePrintValidatorDefaultService::class.toString())
+ val log = LoggerFactory.getLogger(BlueprintValidatorDefaultService::class.toString())
- lateinit var bluePrintContext: BluePrintContext
+ lateinit var bluePrintContext: BlueprintContext
lateinit var serviceTemplate: ServiceTemplate
lateinit var properties: MutableMap<String, Any>
var message: StringBuilder = StringBuilder()
- private val separator: String = BluePrintConstants.PATH_DIVIDER
+ private val separator: String = BlueprintConstants.PATH_DIVIDER
var paths: MutableList<String> = arrayListOf()
- @Throws(BluePrintException::class)
- override fun validateBlueprint(bluePrintContext: BluePrintContext, properties: MutableMap<String, Any>) {
+ @Throws(BlueprintException::class)
+ override fun validateBlueprint(bluePrintContext: BlueprintContext, properties: MutableMap<String, Any>) {
validateBlueprint(bluePrintContext.serviceTemplate, properties)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
override fun validateBlueprint(serviceTemplate: ServiceTemplate, properties: MutableMap<String, Any>) {
- this.bluePrintContext = BluePrintContext(serviceTemplate)
+ this.bluePrintContext = BlueprintContext(serviceTemplate)
this.serviceTemplate = serviceTemplate
this.properties = properties
try {
} catch (e: Exception) {
log.error("validation failed in the path : {}", paths.joinToString(separator), e)
log.error("validation trace message :{} ", message)
- throw BluePrintException(
+ throw BlueprintException(
e,
format("failed to validate blueprint on path ({}) with message {}", paths.joinToString(separator), e.message)
)
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateMetadata(metaDataMap: MutableMap<String, String>) {
paths.add("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")
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateArtifactTypes(artifactTypes: MutableMap<String, ArtifactType>) {
paths.add("artifact_types")
artifactTypes.forEach { artifactName, artifactType ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateDataTypes(dataTypes: MutableMap<String, DataType>) {
paths.add("dataTypes")
dataTypes.forEach { dataTypeName, dataType ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateNodeTypes(nodeTypes: MutableMap<String, NodeType>) {
paths.add("nodeTypes")
nodeTypes.forEach { nodeTypeName, nodeType ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateNodeType(nodeTypeName: String, nodeType: NodeType) {
paths.add(nodeTypeName)
message.appendln("--> Node Type :" + paths.joinToString(separator))
// Check Derived From
checkValidNodeTypesDerivedFrom(nodeTypeName, derivedFrom)
- if (!BluePrintTypes.rootNodeTypes().contains(derivedFrom)) {
+ if (!BlueprintTypes.rootNodeTypes().contains(derivedFrom)) {
serviceTemplate.nodeTypes?.get(derivedFrom)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get derivedFrom NodeType({})'s for NodeType({}) ",
derivedFrom, nodeTypeName
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun checkValidNodeTypesDerivedFrom(nodeTypeName: String, derivedFrom: String) {
- check(BluePrintTypes.validNodeTypeDerivedFroms.contains(derivedFrom)) {
- throw BluePrintException(format("Failed to get node type ({})'s derivedFrom({}) definition ", nodeTypeName, derivedFrom))
+ check(BlueprintTypes.validNodeTypeDerivedFroms.contains(derivedFrom)) {
+ throw BlueprintException(format("Failed to get node type ({})'s derivedFrom({}) definition ", nodeTypeName, derivedFrom))
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateTopologyTemplate(topologyTemplate: TopologyTemplate) {
paths.add("topology")
message.appendln("--> Topology Template")
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateInputs(inputs: MutableMap<String, PropertyDefinition>) {
paths.add("inputs")
message.appendln("---> Input :" + paths.joinToString(separator))
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateNodeTemplates(nodeTemplates: MutableMap<String, NodeTemplate>) {
paths.add("nodeTemplates")
nodeTemplates.forEach { nodeTemplateName, nodeTemplate ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateNodeTemplate(nodeTemplateName: String, nodeTemplate: NodeTemplate) {
paths.add(nodeTemplateName)
message.appendln("---> NodeTemplate :" + paths.joinToString(separator))
val type: String = nodeTemplate.type
val nodeType: NodeType = serviceTemplate.nodeTypes?.get(type)
- ?: throw BluePrintException(format("Failed to get NodeType({}) definition for NodeTemplate({})", type, nodeTemplateName))
+ ?: throw BlueprintException(format("Failed to get NodeType({}) definition for NodeTemplate({})", type, nodeTemplateName))
nodeTemplate.artifacts?.let { validateArtifactDefinitions(nodeTemplate.artifacts!!) }
nodeTemplate.properties?.let { validatePropertyAssignments(nodeType.properties!!, nodeTemplate.properties!!) }
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateArtifactDefinitions(artifacts: MutableMap<String, ArtifactDefinition>) {
paths.add("artifacts")
artifacts.forEach { artifactDefinitionName, artifactDefinition ->
paths.add(artifactDefinitionName)
message.appendln("Validating artifact " + paths.joinToString(separator))
val type: String = artifactDefinition.type
- ?: throw BluePrintException(format("type is missing for ArtifactDefinition({})", artifactDefinitionName))
+ ?: throw BlueprintException(format("type is missing for ArtifactDefinition({})", artifactDefinitionName))
// Check Artifact Type
checkValidArtifactType(artifactDefinitionName, type)
val file: String = artifactDefinition.file
- ?: throw BluePrintException(format("file is missing for ArtifactDefinition({})", artifactDefinitionName))
+ ?: throw BlueprintException(format("file is missing for ArtifactDefinition({})", artifactDefinitionName))
paths.removeAt(paths.lastIndex)
}
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateWorkFlows(workflows: MutableMap<String, Workflow>) {
paths.add("workflows")
workflows.forEach { workflowName, workflow ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateWorkFlow(workflowName: String, workflow: Workflow) {
paths.add(workflowName)
message.appendln("---> Workflow :" + paths.joinToString(separator))
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validatePropertyDefinitions(properties: MutableMap<String, PropertyDefinition>) {
paths.add("properties")
properties.forEach { propertyName, propertyDefinition ->
paths.add(propertyName)
val dataType: String = propertyDefinition.type
when {
- BluePrintTypes.validPrimitiveTypes().contains(dataType) -> {
+ BlueprintTypes.validPrimitiveTypes().contains(dataType) -> {
// Do Nothing
}
- BluePrintTypes.validCollectionTypes().contains(dataType) -> {
+ BlueprintTypes.validCollectionTypes().contains(dataType) -> {
val entrySchemaType: String = propertyDefinition.entrySchema?.type
- ?: throw BluePrintException(format("Entry schema for DataType ({}) for the property ({}) not found", dataType, propertyName))
+ ?: throw BlueprintException(format("Entry schema for DataType ({}) for the property ({}) not found", dataType, propertyName))
checkPrimitiveOrComplex(entrySchemaType, propertyName)
}
else -> checkPropertyDataType(dataType, propertyName)
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validatePropertyAssignments(
nodeTypeProperties: MutableMap<String, PropertyDefinition>,
properties: MutableMap<String, JsonNode>
) {
properties.forEach { propertyName, propertyAssignment ->
val propertyDefinition: PropertyDefinition = nodeTypeProperties[propertyName]
- ?: throw BluePrintException(format("failed to get definition for the property ({})", propertyName))
+ ?: throw BlueprintException(format("failed to get definition for the property ({})", propertyName))
validatePropertyAssignment(propertyName, propertyDefinition, propertyAssignment)
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validatePropertyAssignment(
propertyName: String,
propertyDefinition: PropertyDefinition,
propertyAssignment: JsonNode
) {
// Check and Validate if Expression Node
- val expressionData = BluePrintExpressionService.getExpressionData(propertyAssignment)
+ val expressionData = BlueprintExpressionService.getExpressionData(propertyAssignment)
if (!expressionData.isExpression) {
checkPropertyValue(propertyName, propertyDefinition, propertyAssignment)
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateCapabilityAssignments(nodeType: NodeType, nodeTemplateName: String, nodeTemplate: NodeTemplate) {
val capabilities = nodeTemplate.capabilities
paths.add("capabilities")
paths.add(capabilityName)
val capabilityDefinition = nodeType.capabilities?.get(capabilityName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) capability definition ({}) " +
"from NodeType({}) ",
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateCapabilityAssignment(
nodeTemplateName: String,
capabilityName: String,
capabilityAssignment.properties?.let { validatePropertyAssignments(capabilityDefinition.properties!!, capabilityAssignment.properties!!) }
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateRequirementAssignments(nodeType: NodeType, nodeTemplateName: String, nodeTemplate: NodeTemplate) {
val requirements = nodeTemplate.requirements
paths.add("requirements")
requirements?.forEach { requirementName, requirementAssignment ->
paths.add(requirementName)
val requirementDefinition = nodeType.requirements?.get(requirementName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) requirement definition ({}) from" +
" NodeType({}) ",
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateRequirementAssignment(
nodeTemplateName: String,
requirementAssignmentName: String,
val capabilityName = requirementAssignment.capability
val relationship = requirementAssignment.relationship!!
- check(BluePrintTypes.validRelationShipDerivedFroms.contains(relationship)) {
- throw BluePrintException(
+ check(BlueprintTypes.validRelationShipDerivedFroms.contains(relationship)) {
+ throw BlueprintException(
format(
"Failed to get relationship type ({}) for NodeTemplate({})'s requirement({}) ",
relationship, nodeTemplateName, requirementAssignmentName
}
val relationShipNodeTemplate = serviceTemplate.topologyTemplate?.nodeTemplates?.get(requirementNodeTemplateName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get requirement NodeTemplate({})'s for NodeTemplate({}) requirement({}) ",
requirementNodeTemplateName, nodeTemplateName, requirementAssignmentName
)
relationShipNodeTemplate.capabilities?.get(capabilityName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get requirement NodeTemplate({})'s capability({}) for NodeTemplate ({})'s requirement({}) ",
requirementNodeTemplateName, capabilityName, nodeTemplateName, requirementAssignmentName
)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateInterfaceAssignments(nodeType: NodeType, nodeTemplateName: String, nodeTemplate: NodeTemplate) {
val interfaces = nodeTemplate.interfaces
interfaces?.forEach { interfaceAssignmentName, interfaceAssignment ->
paths.add(interfaceAssignmentName)
val interfaceDefinition = nodeType.interfaces?.get(interfaceAssignmentName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) interface definition ({}) from" +
" NodeType({}) ",
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateInterfaceAssignment(
nodeTemplateName: String,
interfaceAssignmentName: String,
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateInterfaceOperationsAssignment(
nodeTemplateName: String,
interfaceAssignmentName: String,
it.forEach { operationAssignmentName, operationAssignments ->
val operationDefinition = interfaceDefinition.operations?.get(operationAssignmentName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) operation definition ({}) ",
nodeTemplateName, operationAssignmentName
inputs?.forEach { propertyName, propertyAssignment ->
val propertyDefinition = operationDefinition.inputs?.get(propertyName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) operation definition ({}) " +
"property definition({})",
outputs?.forEach { propertyName, propertyAssignment ->
val propertyDefinition = operationDefinition.outputs?.get(propertyName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get NodeTemplate({}) operation definition ({}) " +
"output property definition({})",
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateCapabilityDefinitions(nodeTypeName: String, nodeType: NodeType) {
val capabilities = nodeType.capabilities
paths.add("capabilities")
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateCapabilityDefinition(
nodeTypeName: String,
nodeType: NodeType,
capabilityDefinition: CapabilityDefinition
) {
val capabilityType = capabilityDefinition.type
- check(BluePrintTypes.validCapabilityTypes.contains(capabilityType)) {
- throw BluePrintException(
+ check(BlueprintTypes.validCapabilityTypes.contains(capabilityType)) {
+ throw BlueprintException(
format(
"Failed to get CapabilityType({}) for NodeType({})",
capabilityType, nodeTypeName
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateRequirementDefinitions(nodeName: String, nodeType: NodeType) {
paths.add("requirements")
val requirements = nodeType.requirements
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateRequirementDefinition(
nodeTypeName: String,
nodeType: NodeType,
val capabilityName = requirementDefinition.capability
val relationship = requirementDefinition.relationship!!
- check(BluePrintTypes.validRelationShipDerivedFroms.contains(relationship)) {
- throw BluePrintException(
+ check(BlueprintTypes.validRelationShipDerivedFroms.contains(relationship)) {
+ throw BlueprintException(
format(
"Failed to get relationship({}) for NodeType({})'s requirement({}) ",
relationship, nodeTypeName, requirementDefinitionName
}
val relationShipNodeType = serviceTemplate.nodeTypes?.get(requirementNodeTypeName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get requirement NodeType({})'s for requirement({}) ",
requirementNodeTypeName, requirementDefinitionName
)
relationShipNodeType.capabilities?.get(capabilityName)
- ?: throw BluePrintException(
+ ?: throw BlueprintException(
format(
"Failed to get requirement NodeType({})'s capability({}) for NodeType ({})'s requirement({}) ",
requirementNodeTypeName, capabilityName, nodeTypeName, requirementDefinitionName
)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateInterfaceDefinitions(interfaces: MutableMap<String, InterfaceDefinition>) {
paths.add("interfaces")
interfaces.forEach { interfaceName, interfaceDefinition ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateOperationDefinitions(operations: MutableMap<String, OperationDefinition>) {
paths.add("operations")
operations.forEach { opertaionName, operationDefinition ->
paths.removeAt(paths.lastIndex)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun validateImplementation(implementation: Implementation) {
checkNotEmpty(implementation.primary) { "couldn't get implementation" }
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun checkValidArtifactType(artifactDefinitionName: String, artifactTypeName: String) {
val artifactType = serviceTemplate.artifactTypes?.get(artifactTypeName)
- ?: throw BluePrintException("failed to artifactType($artifactTypeName) for ArtifactDefinition($artifactDefinitionName)")
+ ?: throw BlueprintException("failed to artifactType($artifactTypeName) for ArtifactDefinition($artifactDefinitionName)")
checkValidArtifactTypeDerivedFrom(artifactTypeName, artifactType.derivedFrom)
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun checkValidArtifactTypeDerivedFrom(artifactTypeName: String, derivedFrom: String) {
- check(BluePrintTypes.validArtifactTypeDerivedFroms.contains(derivedFrom)) {
- throw BluePrintException("failed to get artifactType($artifactTypeName)'s derivedFrom($derivedFrom) definition")
+ check(BlueprintTypes.validArtifactTypeDerivedFroms.contains(derivedFrom)) {
+ throw BlueprintException("failed to get artifactType($artifactTypeName)'s derivedFrom($derivedFrom) definition")
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun checkValidDataTypeDerivedFrom(dataTypeName: String, derivedFrom: String) {
- check(BluePrintTypes.validDataTypeDerivedFroms.contains(derivedFrom)) {
- throw BluePrintException(format("Failed to get DataType({})'s derivedFrom({}) definition ", dataTypeName, derivedFrom))
+ check(BlueprintTypes.validDataTypeDerivedFroms.contains(derivedFrom)) {
+ throw BlueprintException(format("Failed to get DataType({})'s derivedFrom({}) definition ", dataTypeName, derivedFrom))
}
}
- @Throws(BluePrintException::class)
+ @Throws(BlueprintException::class)
open fun checkValidRelationshipTypeDerivedFrom(relationshipTypeName: String, derivedFrom: String) {
- check(BluePrintTypes.validRelationShipDerivedFroms.contains(derivedFrom)) {
- throw BluePrintException(format("Failed to get relationship type ({})'s derivedFrom({}) definition ", relationshipTypeName, derivedFrom))
+ check(BlueprintTypes.validRelationShipDerivedFroms.contains(derivedFrom)) {
+ throw BlueprintException(format("Failed to get relationship type ({})'s derivedFrom({}) definition ", relationshipTypeName, derivedFrom))
}
}
val propertyType = propertyDefinition.type
val isValid: Boolean
- if (BluePrintTypes.validPrimitiveTypes().contains(propertyType)) {
+ if (BlueprintTypes.validPrimitiveTypes().contains(propertyType)) {
isValid = JacksonUtils.checkJsonNodeValueOfPrimitiveType(propertyType, propertyAssignment)
- } else if (BluePrintTypes.validCollectionTypes().contains(propertyType)) {
+ } else if (BlueprintTypes.validCollectionTypes().contains(propertyType)) {
val entrySchemaType = propertyDefinition.entrySchema?.type
- ?: throw BluePrintException(format("Failed to get EntrySchema type for the collection property ({})", propertyName))
+ ?: throw BlueprintException(format("Failed to get EntrySchema type for the collection property ({})", propertyName))
- if (!BluePrintTypes.validPropertyTypes().contains(entrySchemaType)) {
+ if (!BlueprintTypes.validPropertyTypes().contains(entrySchemaType)) {
checkPropertyDataType(entrySchemaType, propertyName)
}
isValid = JacksonUtils.checkJsonNodeValueOfCollectionType(propertyType, propertyAssignment)
}
check(isValid) {
- throw BluePrintException(
+ throw BlueprintException(
format(
"property({}) defined of type({}) is not comptable with the value ({})",
propertyName, propertyType, propertyAssignment
private fun checkPropertyDataType(dataTypeName: String, propertyName: String) {
val dataType = serviceTemplate.dataTypes?.get(dataTypeName)
- ?: throw BluePrintException(format("DataType ({}) for the property ({}) not found", dataTypeName, propertyName))
+ ?: throw BlueprintException(format("DataType ({}) for the property ({}) not found", dataTypeName, propertyName))
checkValidDataTypeDerivedFrom(propertyName, dataType.derivedFrom)
}
private fun checkPrimitiveOrComplex(dataType: String, propertyName: String): Boolean {
- if (BluePrintTypes.validPrimitiveTypes().contains(dataType) || checkDataType(dataType)) {
+ if (BlueprintTypes.validPrimitiveTypes().contains(dataType) || checkDataType(dataType)) {
return true
} else {
- throw BluePrintException(format("DataType({}) for the property({}) is not valid", dataType, propertyName))
+ throw BlueprintException(format("DataType({}) for the property({}) is not valid", dataType, propertyName))
}
}