diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2019-09-23 16:11:17 -0400 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2019-09-29 03:12:56 +0000 |
commit | 7a04ac414b690983d863e96b487e314780572c48 (patch) | |
tree | 7df2d84fd1c28f96416c620ee82207be7d0b2945 /ms/controllerblueprints/modules/resource-dict | |
parent | f2dde8ba531cd4783fbc0872c406ec6e0d097c54 (diff) |
Refactoring ResourceAssignmentUtils
Refactoring ResourceAssignmentUtils parseResponseNodeForPrimitiveTypes API to remove cyclic value assignments
Issue-ID: CCSDK-1748
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I27b5a7d3ed2df38cf4e3e44686aec094ebdb5f25
Refactoring ResourceAssignmentUtils
Changing isNull condition to isNullOrEmpty to make sure Empty value doesn't get assigned to resource
Issue-ID: CCSDK-1748
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I0744537c7ddec80f20ffd7e6545b947439f63743
Resource Resolution Refactoring
Refactoring some logging statements and adding new loggers
Issue-ID: CCSDK-1748
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I5676659eea01056a7d29206f13473a4361516755
Diffstat (limited to 'ms/controllerblueprints/modules/resource-dict')
2 files changed, 12 insertions, 11 deletions
diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt index c222de9e5..f1e0d2c86 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt @@ -84,15 +84,16 @@ open class ResourceAssignment { var updatedBy: String? = null override fun toString(): String { - return StringBuilder() - .append("[") - .append("name=", name) - .append(", status=", status) - .append(", property=", property?.value ?: "") - .append(", dictionaryName=", dictionaryName) - .append(", dictionarySource=", dictionarySource) - .append("]") - .toString() + return """ + [ + name = $name + status = $status + required = ${property?.required} + dependencies = $dependencies + dictionaryName = $dictionaryName + dictionarySource = $dictionarySource + ] + """.trimIndent() } } diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt index 60fe6a705..cd887bf54 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt @@ -35,7 +35,7 @@ object BulkResourceSequencingUtils { fun process(resourceAssignments: MutableList<ResourceAssignment>): List<List<ResourceAssignment>> { val resourceAssignmentMap: MutableMap<String, ResourceAssignment> = hashMapOf() val sequenceBatchResourceAssignment = ArrayList<List<ResourceAssignment>>() - log.info("Assignments ({})", resourceAssignments) + log.trace("Assignments ({})", resourceAssignments) // Prepare Map resourceAssignments.forEach { resourceAssignment -> log.trace("Processing Key ({})", resourceAssignment.name) @@ -64,7 +64,7 @@ object BulkResourceSequencingUtils { } val sequencedResourceAssignments: MutableList<ResourceAssignment> = topologySorting.topSort()!! as MutableList<ResourceAssignment> - log.info("Sorted Sequenced Assignments ({})", sequencedResourceAssignments) + log.trace("Sorted Sequenced Assignments ({})", sequencedResourceAssignments) var batchResourceAssignment: MutableList<ResourceAssignment>? = null var batchAssignmentName: MutableList<String>? = null |