diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2020-02-05 14:27:36 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-02-12 20:35:42 +0000 |
commit | 86a67360c6cd076c91954892b5c0c49b4cbc1dfa (patch) | |
tree | 5d6c01afd96c977cd3071256c8ff12418e8e46cb /ms/blueprintsprocessor/modules/blueprints | |
parent | 65bb9d0d83762e8fa8e3ab568c801908eafa0686 (diff) |
Refactoring Resource Resolution Service
Removing Node Template dependency
Issue-ID: CCSDK-2078
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I24f3e003c64f3ee40eee4699366cfadfc1d7147e
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints')
-rw-r--r-- | ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContext.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContext.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContext.kt index a112b6e6c..7c0970202 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContext.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintContext.kt @@ -231,15 +231,17 @@ class BluePrintContext(val serviceTemplate: ServiceTemplate) { return nodeTemplateByName(nodeTemplateName).artifacts } - fun nodeTemplateArtifact(nodeTemplateName: String, artifactName: String): ArtifactDefinition { + fun checkNodeTemplateArtifact(nodeTemplateName: String, artifactName: String): ArtifactDefinition? { return nodeTemplateArtifacts(nodeTemplateName)?.get(artifactName) + } + + fun nodeTemplateArtifact(nodeTemplateName: String, artifactName: String): ArtifactDefinition { + return checkNodeTemplateArtifact(nodeTemplateName, artifactName) ?: throw BluePrintException("could't get NodeTemplate($nodeTemplateName)'s ArtifactDefinition($artifactName)") } fun nodeTemplateArtifactForArtifactType(nodeTemplateName: String, artifactType: String): ArtifactDefinition { - return nodeTemplateArtifacts(nodeTemplateName)?.filter { it.value.type == artifactType }?.map { it.value }?.get( - 0 - ) + return nodeTemplateArtifacts(nodeTemplateName)?.filter { it.value.type == artifactType }?.map { it.value }?.get(0) ?: throw BluePrintException("could't get NodeTemplate($nodeTemplateName)'s Artifact Type($artifactType)") } |