package org.onap.ccsdk.cds.controllerblueprints.core.service
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
-import org.onap.ccsdk.cds.controllerblueprints.core.data.*
+import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition
+import org.onap.ccsdk.cds.controllerblueprints.core.data.AttributeDefinition
+import org.onap.ccsdk.cds.controllerblueprints.core.data.CapabilityDefinition
+import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
+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.PropertyDefinition
+import org.onap.ccsdk.cds.controllerblueprints.core.data.RequirementDefinition
+
/**
*
*
* @author Brinda Santh
*/
class BluePrintChainedService {
- var bpc : BluePrintContext
- constructor(bpc : BluePrintContext){
+ var bpc: BluePrintContext
+
+ constructor(bpc: BluePrintContext) {
this.bpc = bpc
}
recNodeTypesChained(nodeTypeName).forEach { nodeType ->
- val subAttributes = bpc.nodeTypeByName(nodeType.id!!).attributes
+ val subAttributes = bpc.nodeTypeByName(nodeType.id!!).attributes
if (subAttributes != null) {
attributes.putAll(subAttributes)
}
- val subProperties = bpc.nodeTypeByName(nodeType.id!!).properties
+ val subProperties = bpc.nodeTypeByName(nodeType.id!!).properties
if (subProperties != null) {
properties.putAll(subProperties)
}
- val subRequirements = bpc.nodeTypeByName(nodeType.id!!).requirements
+ val subRequirements = bpc.nodeTypeByName(nodeType.id!!).requirements
if (subRequirements != null) {
requirements.putAll(subRequirements)
}
- val subCapabilities = bpc.nodeTypeByName(nodeType.id!!).capabilities
+ val subCapabilities = bpc.nodeTypeByName(nodeType.id!!).capabilities
if (subCapabilities != null) {
capabilities.putAll(subCapabilities)
}
- val subInterfaces = bpc.nodeTypeByName(nodeType.id!!).interfaces
+ val subInterfaces = bpc.nodeTypeByName(nodeType.id!!).interfaces
if (subInterfaces != null) {
interfaces.putAll(subInterfaces)
}
- val subArtifacts = bpc.nodeTypeByName(nodeType.id!!).artifacts
+ val subArtifacts = bpc.nodeTypeByName(nodeType.id!!).artifacts
if (subArtifacts != null) {
artifacts.putAll(subArtifacts)
}
}
fun nodeTypeChainedProperties(nodeTypeName: String): MutableMap<String, PropertyDefinition>? {
- val nodeType = bpc.nodeTypeByName(nodeTypeName)
+ val nodeType = bpc.nodeTypeByName(nodeTypeName)
val properties = hashMapOf<String, PropertyDefinition>()
recNodeTypesChained(nodeTypeName).forEach { nodeType ->
- val subProperties = bpc.nodeTypeByName(nodeType.id!!).properties
+ val subProperties = bpc.nodeTypeByName(nodeType.id!!).properties
if (subProperties != null) {
properties.putAll(subProperties)
}
}
private fun recNodeTypesChained(nodeTypeName: String, nodeTypes: MutableList<NodeType>? = arrayListOf()): MutableList<NodeType> {
- val nodeType: NodeType = bpc.nodeTypeByName(nodeTypeName)
+ val nodeType: NodeType = bpc.nodeTypeByName(nodeTypeName)
nodeType.id = nodeTypeName
val derivedFrom: String = nodeType.derivedFrom
if (!BluePrintTypes.rootNodeTypes().contains(derivedFrom)) {
}
private fun recDataTypesChained(dataTypeName: String, dataTypes: MutableList<DataType>? = arrayListOf()): MutableList<DataType> {
- val dataType: DataType = bpc.dataTypeByName(dataTypeName)!!
+ val dataType: DataType = bpc.dataTypeByName(dataTypeName)!!
dataType.id = dataTypeName
val derivedFrom: String = dataType.derivedFrom
if (!BluePrintTypes.rootDataTypes().contains(derivedFrom)) {
dataTypes!!.add(dataType)
return dataTypes
}
-
-}
\ No newline at end of file
+}