diff options
Diffstat (limited to 'components/resource-dict')
2 files changed, 12 insertions, 0 deletions
diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt index fae509d25..089fce0b1 100644 --- a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt +++ b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt @@ -25,6 +25,8 @@ import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException import org.onap.ccsdk.apps.controllerblueprints.core.utils.TopologicalSortingUtils import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment import com.att.eelf.configuration.EELFManager +import org.onap.ccsdk.apps.controllerblueprints.core.format +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory import java.io.Serializable /** @@ -65,6 +67,13 @@ open class ResourceAssignmentValidationDefaultService : ResourceAssignmentValida open fun validateSources(resourceAssignments: List<ResourceAssignment>) { log.info("validating resource assignment sources") + resourceAssignments.forEach { resourceAssignment -> + try { + ResourceSourceMappingFactory.getRegisterSourceMapping(resourceAssignment.dictionarySource!!) + } catch (e: BluePrintException) { + validationMessage.appendln(e.message + format(" for resource assignment({})", resourceAssignment.name)) + } + } } open fun validateTemplateNDictionaryKeys(resourceAssignments: List<ResourceAssignment>) { diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionRepoService.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionRepoService.kt index 370e1ec8c..6c83e5f93 100644 --- a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionRepoService.kt +++ b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionRepoService.kt @@ -18,11 +18,13 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoFileService
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoService
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonReactorUtils
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition
import reactor.core.publisher.Mono
+
/**
* ResourceDefinitionRepoService.
*
@@ -30,6 +32,7 @@ import reactor.core.publisher.Mono */
interface ResourceDefinitionRepoService : BluePrintRepoService {
+ @Throws(BluePrintException::class)
fun getResourceDefinition(resourceDefinitionName: String): Mono<ResourceDefinition>
}
|