var description: String? = null\r
lateinit var type: String\r
@JsonProperty("default")\r
- var _default: JsonNode? = null\r
+ var defaultValue: JsonNode? = null\r
var status: String? = null\r
@JsonProperty("entry_schema")\r
- var entry_schema: String? = null\r
+ var entrySchema: String? = null\r
}\r
\r
/*\r
package org.onap.ccsdk.apps.controllerblueprints.core.factory\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintEnhancerService\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
\r
\r
/**\r
*/\r
\r
object BluePrintEnhancerFactory {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
var bluePrintEnhancerServices: MutableMap<String, BluePrintEnhancerService> = HashMap()\r
\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintParserDefaultService\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintParserService\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
\r
/**\r
*\r
*/\r
\r
object BluePrintParserFactory {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
var bluePrintParserServices: MutableMap<String, BluePrintParserService> = HashMap()\r
\r
init {\r
- logger.info("Initialised default BluePrintParser Service ")\r
+ log.info("Initialised default BluePrintParser Service ")\r
bluePrintParserServices.put(org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants.TYPE_DEFAULT, BluePrintParserDefaultService())\r
}\r
\r
\r
package org.onap.ccsdk.apps.controllerblueprints.core.service\r
\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import com.fasterxml.jackson.databind.JsonNode\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
/**\r
*\r
*\r
*/\r
class BluePrintContext(serviceTemplate: ServiceTemplate) {\r
\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
val serviceTemplate: ServiceTemplate = serviceTemplate\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*\r
import org.onap.ccsdk.apps.controllerblueprints.core.format\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.Serializable\r
\r
/**\r
\r
open class BluePrintEnhancerDefaultService(val bluePrintRepoService: BluePrintRepoService) : BluePrintEnhancerService {\r
\r
- private val log: Logger = LoggerFactory.getLogger(BluePrintEnhancerDefaultService::class.java)\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintEnhancerDefaultService::class.toString())\r
\r
lateinit var serviceTemplate: ServiceTemplate\r
\r
\r
open fun enrichPropertyDefinition(propertyName: String, propertyDefinition: PropertyDefinition) {\r
val propertyType = propertyDefinition.type\r
- ?: throw BluePrintException(format("Property type is missing for property : {}", propertyName))\r
if (BluePrintTypes.validPrimitiveTypes().contains(propertyType)) {\r
\r
} else if (BluePrintTypes.validCollectionTypes().contains(propertyType)) {\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
/**\r
*\r
*\r
* @author Brinda Santh\r
*/\r
object BluePrintExpressionService {\r
- val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
@JvmStatic\r
fun getExpressionData(propertyAssignment: Any): ExpressionData {\r
\r
@JvmStatic\r
fun getExpressionData(propertyAssignmentNode: JsonNode): ExpressionData {\r
- logger.trace("Assignment Data/Expression : {}", propertyAssignmentNode)\r
+ log.trace("Assignment Data/Expression : {}", propertyAssignmentNode)\r
val expressionData = ExpressionData(valueNode = propertyAssignmentNode)\r
if (propertyAssignmentNode is ObjectNode) {\r
\r
var reqOrCapEntityName: String? = null\r
var propertyName = ""\r
var subProperty: String? = null\r
- if (arrayNode.size() == 2) {\r
- propertyName = arrayNode[1].textValue()\r
- } else if (arrayNode.size() == 3) {\r
- reqOrCapEntityName = arrayNode[1].textValue()\r
- propertyName = arrayNode[2].textValue()\r
- } else if (arrayNode.size() > 3) {\r
- reqOrCapEntityName = arrayNode[1].textValue()\r
- propertyName = arrayNode[2].textValue()\r
- val propertyPaths: List<String> = arrayNode.filterIndexed { index, obj ->\r
- index >= 3\r
- }.map { it.textValue() }\r
- subProperty = propertyPaths.joinToString("/")\r
+ when {\r
+ arrayNode.size() == 2 -> propertyName = arrayNode[1].textValue()\r
+ arrayNode.size() == 3 -> {\r
+ reqOrCapEntityName = arrayNode[1].textValue()\r
+ propertyName = arrayNode[2].textValue()\r
+ }\r
+ arrayNode.size() > 3 -> {\r
+ reqOrCapEntityName = arrayNode[1].textValue()\r
+ propertyName = arrayNode[2].textValue()\r
+ val propertyPaths: List<String> = arrayNode.filterIndexed { index, obj ->\r
+ index >= 3\r
+ }.map { it.textValue() }\r
+ subProperty = propertyPaths.joinToString("/")\r
+ }\r
}\r
\r
return PropertyExpression(modelableEntityName = arrayNode[0].asText(),\r
}\r
\r
var reqOrCapEntityName: String? = null\r
- var propertyName: String = ""\r
+ var propertyName = ""\r
var subProperty: String? = null\r
if (arrayNode.size() == 2) {\r
propertyName = arrayNode[1].textValue()\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.ServiceTemplateUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.File\r
import java.io.Serializable\r
\r
\r
class BluePrintParserDefaultService : BluePrintParserService {\r
\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
var basePath : String = javaClass.classLoader.getResource(".").path\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import reactor.core.publisher.Mono\r
import java.io.File\r
import java.io.Serializable\r
\r
class BluePrintRepoFileService(val basePath: String) : BluePrintRepoService {\r
\r
- private val log: Logger = LoggerFactory.getLogger(BluePrintRepoFileService::class.java)\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
private val dataTypePath = basePath.plus(BluePrintConstants.PATH_DIVIDER).plus(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)\r
private val nodeTypePath = basePath.plus(BluePrintConstants.PATH_DIVIDER).plus(BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE)\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
/**\r
*\r
*\r
*/\r
open class BluePrintRuntimeService(var bluePrintContext: BluePrintContext, var context: MutableMap<String, Any> = hashMapOf()) {\r
\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintRuntimeService::class.toString())\r
\r
/*\r
Get the Node Type Definition for the Node Template, Then iterate Node Type Properties and resolve the expressing\r
*/\r
open fun resolveNodeTemplateProperties(nodeTemplateName: String): MutableMap<String, Any?> {\r
- logger.info("resolveNodeTemplatePropertyValues for node template ({})", nodeTemplateName)\r
+ log.info("resolveNodeTemplatePropertyValues for node template ({})", nodeTemplateName)\r
val propertyAssignmentValue: MutableMap<String, Any?> = hashMapOf()\r
\r
val nodeTemplate: NodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName)\r
// Set for Return of method\r
propertyAssignmentValue[nodeTypePropertyName] = resolvedValue\r
}\r
- logger.info("resolved property definition for node template ({}), values ({})", nodeTemplateName, propertyAssignmentValue)\r
+ log.info("resolved property definition for node template ({}), values ({})", nodeTemplateName, propertyAssignmentValue)\r
return propertyAssignmentValue\r
}\r
\r
open fun resolveNodeTemplateInterfaceOperationInputs(nodeTemplateName: String,\r
interfaceName: String, operationName: String): MutableMap<String, Any?> {\r
- logger.info("nodeTemplateInterfaceOperationInputsResolvedExpression for node template ({}),interface name ({}), " +\r
+ log.info("nodeTemplateInterfaceOperationInputsResolvedExpression for node template ({}),interface name ({}), " +\r
"operationName({})", nodeTemplateName, interfaceName, operationName)\r
\r
val propertyAssignmentValue: MutableMap<String, Any?> = hashMapOf()\r
?: throw BluePrintException(String.format("failed to get input definitions for node type (%s), " +\r
"interface name (%s), operationName(%s)", nodeTypeName, interfaceName, operationName))\r
\r
- logger.info("input definition for node template ({}), values ({})", nodeTemplateName, propertyAssignments)\r
+ log.info("input definition for node template ({}), values ({})", nodeTemplateName, propertyAssignments)\r
\r
// Iterate Node Type Properties\r
nodeTypeInterfaceOperationInputs.forEach { nodeTypePropertyName, nodeTypeProperty ->\r
// Set for Return of method\r
propertyAssignmentValue[nodeTypePropertyName] = resolvedValue\r
}\r
- logger.info("resolved input assignments for node template ({}), values ({})", nodeTemplateName, propertyAssignmentValue)\r
+ log.info("resolved input assignments for node template ({}), values ({})", nodeTemplateName, propertyAssignmentValue)\r
\r
return propertyAssignmentValue\r
}\r
\r
open fun resolveNodeTemplateInterfaceOperationOutputs(nodeTemplateName: String,\r
interfaceName: String, operationName: String, componentContext: MutableMap<String, Any?>) {\r
- logger.info("nodeTemplateInterfaceOperationInputsResolvedExpression for node template ({}),interface name ({}), " +\r
+ log.info("nodeTemplateInterfaceOperationInputsResolvedExpression for node template ({}),interface name ({}), " +\r
"operationName({})", nodeTemplateName, interfaceName, operationName)\r
\r
val nodeTypeName = bluePrintContext.nodeTemplateByName(nodeTemplateName).type\r
?: NullNode.getInstance()\r
// Store operation output values into context\r
setNodeTemplateOperationPropertyValue(nodeTemplateName, interfaceName, operationName, nodeTypePropertyName, resolvedValue)\r
- logger.debug("resolved output assignments for node template ({}), property name ({}), value ({})", nodeTemplateName, nodeTypePropertyName, resolvedValue)\r
+ log.debug("resolved output assignments for node template ({}), property name ({}), value ({})", nodeTemplateName, nodeTypePropertyName, resolvedValue)\r
}\r
}\r
\r
open fun setInputValue(propertyName: String, propertyDefinition: PropertyDefinition, value: JsonNode) {\r
val path = StringBuilder(BluePrintConstants.PATH_INPUTS)\r
.append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString()\r
- logger.trace("setting input path ({}), values ({})", path, value)\r
+ log.trace("setting input path ({}), values ({})", path, value)\r
context[path] = value\r
}\r
\r
.append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS).append(BluePrintConstants.PATH_DIVIDER).append(operationName)\r
.append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES)\r
.append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString()\r
- logger.trace("setting operation property path ({}), values ({})", path, value)\r
+ log.trace("setting operation property path ({}), values ({})", path, value)\r
context[path] = value\r
}\r
\r
}\r
\r
open fun assignInputs(jsonNode: JsonNode) {\r
- logger.info("assignInputs from input JSON ({})", jsonNode.toString())\r
+ log.info("assignInputs from input JSON ({})", jsonNode.toString())\r
bluePrintContext.inputs?.forEach { propertyName, property ->\r
val valueNode: JsonNode = jsonNode.at(BluePrintConstants.PATH_DIVIDER + propertyName)\r
?: NullNode.getInstance()\r
}\r
\r
open fun assignWorkflowInputs(workflowName: String, jsonNode: JsonNode) {\r
- logger.info("assign workflow {} input value ({})", workflowName, jsonNode.toString())\r
+ log.info("assign workflow {} input value ({})", workflowName, jsonNode.toString())\r
bluePrintContext.workflowByName(workflowName)?.inputs?.forEach { propertyName, property ->\r
val valueNode: JsonNode = jsonNode.at(BluePrintConstants.PATH_DIVIDER + propertyName)\r
?: NullNode.getInstance()\r
import org.apache.commons.lang3.StringUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.*\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.Serializable\r
\r
/**\r
\r
open class BluePrintValidatorDefaultService : BluePrintValidatorService {\r
\r
- val logger: Logger = LoggerFactory.getLogger(BluePrintValidatorDefaultService::class.toString())\r
+ val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintValidatorDefaultService::class.toString())\r
\r
lateinit var bluePrintContext: BluePrintContext\r
lateinit var serviceTemplate: ServiceTemplate\r
serviceTemplate.nodeTypes?.let { validateNodeTypes(serviceTemplate.nodeTypes!!) }\r
serviceTemplate.topologyTemplate?.let { validateTopologyTemplate(serviceTemplate.topologyTemplate!!) }\r
} catch (e: Exception) {\r
- logger.error("validation failed in the path : {}", paths.joinToString(separator), e)\r
- logger.error("validation trace message :{} ", message)\r
+ log.error("validation failed in the path : {}", paths.joinToString(separator), e)\r
+ log.error("validation trace message :{} ", message)\r
throw BluePrintException(e,\r
format("failed to validate blueprint on path ({}) with message {}"\r
, paths.joinToString(separator), e.message))\r
paths.add("properties")\r
properties.forEach { propertyName, propertyDefinition ->\r
paths.add(propertyName)\r
- val dataType: String = propertyDefinition.type!!\r
- if (BluePrintTypes.validPrimitiveTypes().contains(dataType)) {\r
- // Do Nothing\r
- } else if (BluePrintTypes.validCollectionTypes().contains(dataType)) {\r
- val entrySchemaType: String = propertyDefinition.entrySchema?.type\r
- ?: throw BluePrintException(format("Entry schema for data type ({}) for the property ({}) not found", dataType, propertyName))\r
- checkPrimitiveOrComplex(entrySchemaType, propertyName)\r
- } else {\r
- checkPropertyDataType(dataType, propertyName)\r
+ val dataType: String = propertyDefinition.type\r
+ when {\r
+ BluePrintTypes.validPrimitiveTypes().contains(dataType) -> {\r
+ // Do Nothing\r
+ }\r
+ BluePrintTypes.validCollectionTypes().contains(dataType) -> {\r
+ val entrySchemaType: String = propertyDefinition.entrySchema?.type\r
+ ?: throw BluePrintException(format("Entry schema for data type ({}) for the property ({}) not found", dataType, propertyName))\r
+ checkPrimitiveOrComplex(entrySchemaType, propertyName)\r
+ }\r
+ else -> checkPropertyDataType(dataType, propertyName)\r
}\r
message.appendln("property " + paths.joinToString(separator) + " of type " + dataType)\r
paths.removeAt(paths.lastIndex)\r
}\r
\r
private fun checkPropertyValue(propertyDefinition: PropertyDefinition, jsonNode: JsonNode) {\r
- //logger.info("validating path ({}), Property {}, value ({})", paths, propertyDefinition, jsonNode)\r
+ //log.info("validating path ({}), Property {}, value ({})", paths, propertyDefinition, jsonNode)\r
}\r
\r
private fun checkPropertyDataType(dataType: String, propertyName: String): Boolean {\r
import org.onap.ccsdk.apps.controllerblueprints.core.format\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.ResourceResolverUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
/**\r
*\r
*\r
*/\r
class PropertyAssignmentService(var context: MutableMap<String, Any>,\r
var bluePrintRuntimeService: BluePrintRuntimeService) {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
private var bluePrintContext: BluePrintContext = bluePrintRuntimeService.bluePrintContext\r
\r
fun resolveAssignmentExpression(nodeTemplateName: String, assignmentName: String,\r
assignment: Any): JsonNode {\r
val valueNode: JsonNode\r
- logger.trace("Assignment ({})", assignment)\r
+ log.trace("Assignment ({})", assignment)\r
val expressionData = BluePrintExpressionService.getExpressionData(assignment)\r
\r
if (expressionData.isExpression) {\r
\r
var propertyDefinition: AttributeDefinition = bluePrintContext.nodeTemplateNodeType(attributeNodeTemplateName).attributes?.get(attributeName)!!\r
\r
- logger.info("node template name ({}), property Name ({}) resolved value ({})", attributeNodeTemplateName, attributeName, nodeTemplateAttributeExpression)\r
+ log.info("node template name ({}), property Name ({}) resolved value ({})", attributeNodeTemplateName, attributeName, nodeTemplateAttributeExpression)\r
\r
// Check it it is a nested expression\r
valueNode = resolveAssignmentExpression(attributeNodeTemplateName, attributeName, nodeTemplateAttributeExpression)\r
\r
var propertyDefinition: PropertyDefinition = bluePrintContext.nodeTemplateNodeType(propertyNodeTemplateName).properties?.get(propertyName)!!\r
\r
- logger.info("node template name ({}), property Name ({}) resolved value ({})", propertyNodeTemplateName, propertyName, nodeTemplatePropertyExpression)\r
+ log.info("node template name ({}), property Name ({}) resolved value ({})", propertyNodeTemplateName, propertyName, nodeTemplatePropertyExpression)\r
\r
// Check it it is a nested expression\r
valueNode = resolveAssignmentExpression(propertyNodeTemplateName, propertyName, nodeTemplatePropertyExpression)\r
import org.apache.commons.io.FileUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ToscaMetaData\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.File\r
import java.nio.charset.Charset\r
\r
object BluePrintMetadataUtils {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
@JvmStatic\r
fun toscaMetaData(basePath: String): ToscaMetaData {\r
\r
val toscaMetaData: ToscaMetaData = BluePrintMetadataUtils.toscaMetaData(metaDataFile)\r
\r
- logger.info("Processing blueprint base path ({}) and entry definition file ({})", blueprintBasePath, toscaMetaData.entityDefinitions)\r
+ log.info("Processing blueprint base path ({}) and entry definition file ({})", blueprintBasePath, toscaMetaData.entityDefinitions)\r
\r
return BluePrintParserFactory.instance(BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile(toscaMetaData.entityDefinitions!!, blueprintBasePath)\r
\r
val toscaMetaData: ToscaMetaData = BluePrintMetadataUtils.toscaMetaData(metaDataFile)\r
\r
- logger.info("Processing blueprint base path ({}) and entry definition file ({})", blueprintBasePath, toscaMetaData.entityDefinitions)\r
+ log.info("Processing blueprint base path ({}) and entry definition file ({})", blueprintBasePath, toscaMetaData.entityDefinitions)\r
\r
val bluePrintContext: BluePrintContext = BluePrintParserFactory.instance(BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile(toscaMetaData.entityDefinitions!!, blueprintBasePath)\r
import com.fasterxml.jackson.databind.node.NullNode\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
\r
/**\r
*\r
* @author Brinda Santh\r
*/\r
object BluePrintRuntimeUtils {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
fun assignInputsFromFile(bluePrintContext: BluePrintContext, fileName: String, context: MutableMap<String, Any>) {\r
val jsonNode: JsonNode = JacksonUtils.jsonNodeFromFile(fileName)\r
}\r
\r
fun assignInputs(bluePrintContext: BluePrintContext, jsonNode: JsonNode, context: MutableMap<String, Any>) {\r
- logger.info("assignInputs from input JSON ({})", jsonNode.toString())\r
+ log.info("assignInputs from input JSON ({})", jsonNode.toString())\r
bluePrintContext.inputs?.forEach { propertyName, property ->\r
val valueNode: JsonNode = jsonNode.at("/".plus(propertyName)) ?: NullNode.getInstance()\r
\r
val path = BluePrintConstants.PATH_INPUTS.plus(BluePrintConstants.PATH_DIVIDER).plus(propertyName)\r
- logger.trace("setting input path ({}), values ({})", path, valueNode)\r
+ log.trace("setting input path ({}), values ({})", path, valueNode)\r
context[path] = valueNode\r
}\r
}\r
\r
package org.onap.ccsdk.apps.controllerblueprints.core.utils\r
\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import com.fasterxml.jackson.annotation.JsonInclude\r
import com.fasterxml.jackson.core.type.TypeReference\r
import com.fasterxml.jackson.databind.JsonNode\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
import org.onap.ccsdk.apps.controllerblueprints.core.format\r
-import org.slf4j.LoggerFactory\r
import java.io.File\r
import java.nio.charset.Charset\r
\r
* @author Brinda Santh\r
*/\r
object JacksonUtils {\r
- private val log = LoggerFactory.getLogger(JacksonUtils::class.java)\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
inline fun <reified T : Any> readValue(content: String): T =\r
jacksonObjectMapper().readValue(content, T::class.java)\r
import org.apache.commons.io.FileUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.checkNotEmpty\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.File\r
import java.net.URL\r
import java.nio.charset.Charset\r
* @author Brinda Santh\r
*/\r
object ResourceResolverUtils {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
@JvmStatic\r
fun getFileContent(filename : String, basePath : String?): String {\r
- logger.trace("file ({}), basePath ({}) ", filename, basePath)\r
+ log.trace("file ({}), basePath ({}) ", filename, basePath)\r
try{\r
var resolvedFileName : String = filename\r
if(filename.startsWith("http", true)\r
|| filename.startsWith("https", true)){\r
val givenUrl : String = URL(filename).toString()\r
val systemUrl : String = File(".").toURI().toURL().toString()\r
- logger.trace("givenUrl ({}), systemUrl ({}) ", givenUrl, systemUrl)\r
+ log.trace("givenUrl ({}), systemUrl ({}) ", givenUrl, systemUrl)\r
if(givenUrl.startsWith(systemUrl)){\r
\r
}\r
\r
@JvmStatic\r
fun getServiceTemplateFromContent(content: String): ServiceTemplate {\r
- return JacksonUtils.readValue<ServiceTemplate>(content)\r
+ return JacksonUtils.readValue(content)\r
}\r
\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
import org.onap.ccsdk.apps.controllerblueprints.core.factory.BluePrintParserFactory\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import java.io.File\r
import java.nio.charset.Charset\r
import kotlin.test.assertNotNull\r
*/\r
class BluePrintContextTest {\r
\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
lateinit var bluePrintContext: BluePrintContext\r
\r
fun testChainedProperty() {\r
val nodeType = bluePrintContext.nodeTypeChained("component-resource-assignment")\r
assertNotNull(nodeType, "Failed to get chained node type")\r
- logger.trace("Properties {}", JacksonUtils.getJson(nodeType, true))\r
+ log.trace("Properties {}", JacksonUtils.getJson(nodeType, true))\r
}\r
\r
\r
\r
import org.junit.Test\r
import org.onap.ccsdk.apps.controllerblueprints.core.factory.BluePrintParserFactory\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import kotlin.test.assertNotNull\r
\r
/**\r
* @author Brinda Santh\r
*/\r
class BluePrintParserFactoryTest {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
@Test\r
fun testBluePrintJson() {\r
val bluePrintContext: BluePrintContext = BluePrintParserFactory.instance(org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile("baseconfiguration/Definitions/activation-blueprint.json", basepath)\r
assertNotNull(bluePrintContext, "Failed to populate Blueprint context")\r
- logger.trace("Blue Print {}",bluePrintContext.blueprintJson(true))\r
+ log.trace("Blue Print {}",bluePrintContext.blueprintJson(true))\r
}\r
}
\ No newline at end of file
import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintRuntimeUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils.jsonNodeFromFile\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils.jsonNodeFromObject\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import kotlin.test.assertEquals\r
import kotlin.test.assertNotNull\r
\r
* @author Brinda Santh\r
*/\r
class BluePrintRuntimeServiceTest {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
val basepath = "load/blueprints"\r
\r
\r
\r
@Test\r
fun testResolveNodeTemplateProperties() {\r
- logger.info("************************ testResolveNodeTemplateProperties **********************")\r
+ log.info("************************ testResolveNodeTemplateProperties **********************")\r
val bluePrintContext: BluePrintContext = BluePrintParserFactory.instance(BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile("baseconfiguration/Definitions/activation-blueprint.json", basepath)\r
\r
bluePrintRuntimeService.assignInputs(inputNode)\r
\r
val propContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateProperties("activate-process")\r
- logger.info("Context {}" ,bluePrintRuntimeService.context)\r
+ log.info("Context {}" ,bluePrintRuntimeService.context)\r
\r
assertNotNull(propContext, "Failed to populate interface property values")\r
assertEquals(propContext.get("process-name"), jsonNodeFromObject("sample-action"), "Failed to populate parameter process-name")\r
\r
@Test\r
fun testResolveNodeTemplateInterfaceOperationInputs() {\r
- logger.info("************************ testResolveNodeTemplateInterfaceOperationInputs **********************")\r
+ log.info("************************ testResolveNodeTemplateInterfaceOperationInputs **********************")\r
val bluePrintContext: BluePrintContext = BluePrintParserFactory.instance(BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile("baseconfiguration/Definitions/activation-blueprint.json", basepath)\r
assertNotNull(bluePrintContext, "Failed to populate Blueprint context")\r
\r
val bluePrintRuntimeService = BluePrintRuntimeService(bluePrintContext, context)\r
\r
- logger.info("Prepared Context {}" ,context)\r
+ log.info("Prepared Context {}" ,context)\r
\r
val inContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment",\r
"DefaultComponentNode", "process")\r
\r
- logger.trace("In Context {}" ,inContext)\r
+ log.trace("In Context {}" ,inContext)\r
\r
assertNotNull(inContext, "Failed to populate interface input property values")\r
assertEquals(inContext.get("action-name"), jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name")\r
\r
@Test\r
fun testResolveNodeTemplateInterfaceOperationOutputs() {\r
- logger.info("************************ testResolveNodeTemplateInterfaceOperationOutputs **********************")\r
+ log.info("************************ testResolveNodeTemplateInterfaceOperationOutputs **********************")\r
val bluePrintContext: BluePrintContext = BluePrintParserFactory.instance(BluePrintConstants.TYPE_DEFAULT)!!\r
.readBlueprintFile("baseconfiguration/Definitions/activation-blueprint.json", basepath)\r
assertNotNull(bluePrintContext, "Failed to populate Blueprint context")\r
import org.junit.Test\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
import org.onap.ccsdk.apps.controllerblueprints.core.factory.BluePrintParserFactory\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
\r
/**\r
*\r
* @author Brinda Santh\r
*/\r
class BluePrintValidatorDefaultServiceTest {\r
- private val logger: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
val basepath = "load/blueprints"\r
\r
@Before\r
val properties : MutableMap<String, Any> = hashMapOf()\r
val validatorService = BluePrintValidatorDefaultService()\r
validatorService.validateBlueprint(bluePrintContext.serviceTemplate,properties)\r
- logger.info("Validation Message {}", properties)\r
+ log.info("Validation Message {}", properties)\r
}\r
}
\ No newline at end of file
import org.junit.Test\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
+import com.att.eelf.configuration.EELFLogger\r
+import com.att.eelf.configuration.EELFManager\r
import kotlin.test.assertEquals\r
import kotlin.test.assertNotNull\r
import kotlin.test.assertTrue\r
*/\r
class JacksonUtilsTest {\r
\r
- private val log: Logger = LoggerFactory.getLogger(this::class.toString())\r
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
val basePath = "load/blueprints"\r
\r
@Test\r
fun testJsonValue() {\r
val filePath = "data/alltype-data.json"\r
- val rootJson = JacksonUtils.jsonNodeFromClassPathFile(filePath);\r
+ val rootJson = JacksonUtils.jsonNodeFromClassPathFile(filePath)\r
assertNotNull(rootJson, "Failed to get all type data json node")\r
val intValue = rootJson.get("intValue")\r
assertTrue(JacksonUtils.checkJsonNodeValueOfType(BluePrintConstants.DATA_TYPE_INTEGER, intValue), "Failed to get as int value")\r
\r
@Test\r
fun testSorting(): Unit {\r
- val graph: TopologicalSortingUtils<String> = TopologicalSortingUtils<String>()\r
+ val graph: TopologicalSortingUtils<String> = TopologicalSortingUtils()\r
graph.add("bundle-id", "bundle-mac")\r
graph.add("bundle-id", "bundle-ip")\r
graph.add("bundle-mac", "bundle-ip")\r
import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonProperty
-import org.apache.commons.lang3.builder.ToStringBuilder
import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate
import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition
import java.io.Serializable