diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-26 12:00:59 -0400 |
---|---|---|
committer | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-28 15:44:01 -0400 |
commit | daab14bd058de198c80b71d63e108fd788b7f5ee (patch) | |
tree | 252cfdef5b2e1500e5bd152f3f5c52602b6b0deb /ms/blueprintsprocessor/functions | |
parent | 82e396d6917519468376d177dd6a2710e84fa23a (diff) |
Revert "Renaming Files having BluePrint to have Blueprint"
The renaming in CCSDK-3098 caused breaking changes to the grpc api and
compile issues for kotlin scripts.
Issue-ID: CCSDK-3385
Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
83 files changed, 727 insertions, 727 deletions
diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt index 2eafcd458..133e4a52b 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt @@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.TextNode import kotlinx.coroutines.delay import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode @@ -55,7 +55,7 @@ import java.util.NoSuchElementException @Component("component-remote-ansible-executor") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class ComponentRemoteAnsibleExecutor( - private val blueprintRestLibPropertyService: BlueprintRestLibPropertyService, + private val blueprintRestLibPropertyService: BluePrintRestLibPropertyService, private val mapper: ObjectMapper ) : AbstractComponentFunction() { diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt index 88cf0992f..7be03333f 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt @@ -27,13 +27,13 @@ import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService.WebClientResponse -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.putJsonElement -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner @@ -94,7 +94,7 @@ class ComponentRemoteAnsibleExecutorTest { ) } returns WebClientResponse(200, getReport()) val selector = mapper.readTree(endpointSelector) - val bluePrintRestLibPropertyService = mockk<BlueprintRestLibPropertyService>() + val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>() every { bluePrintRestLibPropertyService.blueprintWebClientService(selector) } returns webClientService val awxRemoteExecutor = ComponentRemoteAnsibleExecutor(bluePrintRestLibPropertyService, mapper) awxRemoteExecutor.checkDelay = 1 @@ -112,7 +112,7 @@ class ComponentRemoteAnsibleExecutorTest { } // then - assertTrue(bluePrintRuntimeService.getBlueprintError().allErrors().isEmpty()) + assertTrue(bluePrintRuntimeService.getBluePrintError().allErrors().isEmpty()) } @Test @@ -128,7 +128,7 @@ class ComponentRemoteAnsibleExecutorTest { webClientService.exchangeResource("GET", "/api/v2/inventories/?name=Demo+Inventory", "") } returns WebClientResponse(404, "") val selector = mapper.readTree(endpointSelector) - val bluePrintRestLibPropertyService = mockk<BlueprintRestLibPropertyService>() + val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>() every { bluePrintRestLibPropertyService.blueprintWebClientService(selector) } returns webClientService val awxRemoteExecutor = ComponentRemoteAnsibleExecutor(bluePrintRestLibPropertyService, mapper) awxRemoteExecutor.checkDelay = 1 @@ -146,7 +146,7 @@ class ComponentRemoteAnsibleExecutorTest { } // then - val errors = bluePrintRuntimeService.getBlueprintError().allErrors() + val errors = bluePrintRuntimeService.getBluePrintError().allErrors() assertEquals(1, errors.size) } @@ -169,7 +169,7 @@ class ComponentRemoteAnsibleExecutorTest { ) } returns WebClientResponse(500, "") val selector = mapper.readTree(endpointSelector) - val bluePrintRestLibPropertyService = mockk<BlueprintRestLibPropertyService>() + val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>() every { bluePrintRestLibPropertyService.blueprintWebClientService(selector) } returns webClientService val awxRemoteExecutor = ComponentRemoteAnsibleExecutor(bluePrintRestLibPropertyService, mapper) awxRemoteExecutor.checkDelay = 1 @@ -187,15 +187,15 @@ class ComponentRemoteAnsibleExecutorTest { } // then - val errors = bluePrintRuntimeService.getBlueprintError().allErrors() + val errors = bluePrintRuntimeService.getBluePrintError().allErrors() assertEquals(1, errors.size) } private fun createBlueprintRuntimeService( awxRemoteExecutor: ComponentRemoteAnsibleExecutor, executionServiceInput: ExecutionServiceInput - ): BlueprintRuntimeService<MutableMap<String, JsonNode>> { - val bluePrintRuntimeService = BlueprintMetadataUtils.bluePrintRuntime( + ): BluePrintRuntimeService<MutableMap<String, JsonNode>> { + val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( "123456-1000", "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_ansible" ) @@ -208,9 +208,9 @@ class ComponentRemoteAnsibleExecutorTest { bluePrintRuntimeService.assignWorkflowInputs(workflowName, input) val stepMetaData: MutableMap<String, JsonNode> = hashMapOf() - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-ansible") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemoteAnsibleExecutor") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-ansible") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemoteAnsibleExecutor") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process") val stepInputData = StepData().apply { name = "execute-remote-ansible" diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt index 341455309..b6f2dcb94 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliExecutorExtensions.kt @@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BlueprintSshClientService import org.onap.ccsdk.cds.blueprintsprocessor.ssh.sshClientService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService /** * Register the CLI module exposed dependency @@ -31,5 +31,5 @@ fun AbstractComponentFunction.cliDeviceInfo(requirementName: String): JsonNode { } fun AbstractComponentFunction.getSshClientService(cliDeviceInfo: JsonNode): BlueprintSshClientService { - return BlueprintDependencyService.sshClientService(cliDeviceInfo) + return BluePrintDependencyService.sshClientService(cliDeviceInfo) } diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt b/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt index c9109a3f1..3cefa3274 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/ComponentCliExecutorTest.kt @@ -23,22 +23,22 @@ import io.mockk.mockk import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BlueprintSshLibConfiguration -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BluePrintSshLibConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation -import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintScriptsServiceImpl -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintScriptsServiceImpl +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.annotation.DirtiesContext @@ -52,8 +52,8 @@ import kotlin.test.assertNotNull classes = [ CliExecutorConfiguration::class, ExecutionServiceConfiguration::class, - BlueprintSshLibConfiguration::class, BlueprintScriptsServiceImpl::class, - BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class, BlueprintDependencyService::class + BluePrintSshLibConfiguration::class, BluePrintScriptsServiceImpl::class, + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, BluePrintDependencyService::class ] ) @DirtiesContext @@ -76,15 +76,15 @@ class ComponentCliExecutorTest { } payload = JacksonUtils.jsonNode("{}") as ObjectNode } - val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234") + val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234") componentScriptExecutor.bluePrintRuntimeService = bluePrintRuntime componentScriptExecutor.stepName = "sample-step" val operationInputs = hashMapOf<String, JsonNode>() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "activate-cli".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() - operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_TYPE] = BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "activate-cli".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() + operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_TYPE] = BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive() operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE] = "internal.scripts.TestCliScriptFunction".asJsonPrimitive() @@ -94,7 +94,7 @@ class ComponentCliExecutorTest { } executionServiceInput.stepData = stepInputData - val blueprintContext = mockk<BlueprintContext>() + val blueprintContext = mockk<BluePrintContext>() every { blueprintContext.nodeTemplateOperationImplementation( any(), any(), any() diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt index cf7de679b..7527f4a25 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt @@ -19,7 +19,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.apache.logging.log4j.util.Strings import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot.Status.RUNNING -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.slf4j.LoggerFactory import org.springframework.dao.DataIntegrityViolationException import org.springframework.stereotype.Service @@ -111,7 +111,7 @@ open class ResourceConfigSnapshotService(private val resourceConfigSnapshotRepos "dated=(${storedSnapshot.createdDate})" ) } catch (ex: DataIntegrityViolationException) { - throw BlueprintException("Failed to store configuration snapshot entry.", ex) + throw BluePrintException("Failed to store configuration snapshot entry.", ex) } storedSnapshot } diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt index 99de66489..3a3dd102a 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt @@ -31,9 +31,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.Compone import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.OPERATION_STORE import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshotService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.ComponentScan @@ -55,7 +55,7 @@ class ComponentConfigSnapshotsExecutorTest { @Autowired lateinit var cfgSnapshotService: ResourceConfigSnapshotService lateinit var cfgSnapshotComponent: ComponentConfigSnapshotsExecutor - private var bluePrintRuntimeService = BlueprintMetadataUtils.bluePrintRuntime( + private var bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( "123456-1000", "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts" ) @@ -99,7 +99,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_FETCH, resId, resType, ResourceConfigSnapshot.Status.RUNNING.name) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -138,7 +138,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_FETCH, resId, resType, ResourceConfigSnapshot.Status.CANDIDATE.name) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -176,7 +176,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_STORE, resId, resType, snapshotConfig) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -211,7 +211,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_FETCH, "asdasd", "PNF", ResourceConfigSnapshot.Status.RUNNING.name) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -238,7 +238,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties("update", "asdasd", "PNF", ResourceConfigSnapshot.Status.RUNNING.name) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -247,7 +247,7 @@ class ComponentConfigSnapshotsExecutorTest { } // then; we should get error in our output properties - assertTrue(bluePrintRuntimeService.getBlueprintError().allErrors().size == 1) + assertTrue(bluePrintRuntimeService.getBluePrintError().allErrors().size == 1) assertEquals( ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_ERROR.asJsonPrimitive(), bluePrintRuntimeService.getNodeTemplateAttributeValue( @@ -278,7 +278,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_DIFF, resId, resType, "YANG") cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.", e.message @@ -319,7 +319,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_DIFF, resId, resType, DIFF_JSON) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.", e.message @@ -328,7 +328,7 @@ class ComponentConfigSnapshotsExecutorTest { } // then; we should get success - assertTrue(bluePrintRuntimeService.getBlueprintError().allErrors().size == 0) + assertTrue(bluePrintRuntimeService.getBluePrintError().allErrors().size == 0) assertEquals( ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(), bluePrintRuntimeService.getNodeTemplateAttributeValue( @@ -368,7 +368,7 @@ class ComponentConfigSnapshotsExecutorTest { prepareRequestProperties(OPERATION_DIFF, resId, resType, DIFF_XML) cfgSnapshotComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { kotlin.test.assertEquals( "Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.", e.message @@ -377,7 +377,7 @@ class ComponentConfigSnapshotsExecutorTest { } // then; we should get success - assertTrue(bluePrintRuntimeService.getBlueprintError().allErrors().size == 0) + assertTrue(bluePrintRuntimeService.getBluePrintError().allErrors().size == 0) assertEquals( ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(), bluePrintRuntimeService.getNodeTemplateAttributeValue( diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/TestDatabaseConfiguration.kt index b65191347..96045ee07 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots"], entityManagerFactoryRef = "primaryEntityManager", diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt index 2419e5a13..cc423a09a 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt @@ -17,9 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintCoreConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -27,12 +27,12 @@ import org.springframework.context.annotation.Import @Configuration @Import( - BlueprintPropertyConfiguration::class, - BlueprintPropertiesService::class, - BlueprintCoreConfiguration::class + BluePrintPropertyConfiguration::class, + BluePrintPropertiesService::class, + BluePrintCoreConfiguration::class ) @EnableConfigurationProperties -open class K8sConnectionPluginConfiguration(private var bluePrintPropertiesService: BlueprintPropertiesService) { +open class K8sConnectionPluginConfiguration(private var bluePrintPropertiesService: BluePrintPropertiesService) { @Bean("k8s-plugin-properties") open fun getProperties(): K8sConnectionPluginProperties { diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt index ae2d1f634..73c0e8029 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt @@ -25,7 +25,7 @@ import com.fasterxml.jackson.module.kotlin.readValue import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.template.K8sTemplate import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.slf4j.LoggerFactory import org.springframework.http.HttpMethod.DELETE import org.springframework.http.HttpMethod.GET @@ -54,7 +54,7 @@ class K8sPluginDefinitionApi( return result.status in 200..299 } catch (e: Exception) { log.error("Caught exception trying to get k8s rb definition") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -74,7 +74,7 @@ class K8sPluginDefinitionApi( return result.status in 200..299 } catch (e: Exception) { log.error("Caught exception trying to get k8s rb profile") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -96,7 +96,7 @@ class K8sPluginDefinitionApi( } } catch (e: Exception) { log.error("Caught exception trying to create k8s rb profile ${profile.profileName}") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -118,7 +118,7 @@ class K8sPluginDefinitionApi( log.debug("Profile uploaded properly") } catch (e: Exception) { log.error("Caught exception trying to upload k8s rb profile ${profile.profileName}") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -137,7 +137,7 @@ class K8sPluginDefinitionApi( } } catch (e: Exception) { log.error("Caught exception during create template") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -154,7 +154,7 @@ class K8sPluginDefinitionApi( } } catch (e: Exception) { log.error("Caught exception trying to upload k8s rb template ${template.templateName}") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -172,7 +172,7 @@ class K8sPluginDefinitionApi( } } catch (e: Exception) { log.error("Caught exception during get template") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -184,7 +184,7 @@ class K8sPluginDefinitionApi( return objectMapper.readValue(result.body) } catch (e: Exception) { log.error("Caught exception during get template") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -196,7 +196,7 @@ class K8sPluginDefinitionApi( return result.status in 200..299 } catch (e: Exception) { log.error("Caught exception during get template") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt index 80531b13d..067c75b3e 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt @@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ArrayNode import com.fasterxml.jackson.databind.node.ObjectNode import org.apache.commons.io.FileUtils -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi @@ -31,14 +31,14 @@ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -53,7 +53,7 @@ import java.nio.file.Paths @Component("component-k8s-profile-upload") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class K8sProfileUploadComponent( - private var bluePrintPropertiesService: BlueprintPropertiesService, + private var bluePrintPropertiesService: BluePrintPropertiesService, private val resourceResolutionService: ResourceResolutionService ) : @@ -132,7 +132,7 @@ open class K8sProfileUploadComponent( if ((profileName == null) || (definitionName == null) || (definitionVersion == null)) { log.warn("Prefix $prefix does not have required data for us to continue.") } else if (!api.hasDefinition(definitionName, definitionVersion)) { - throw BlueprintProcessorException("K8s RB Definition ($definitionName/$definitionVersion) not found ") + throw BluePrintProcessorException("K8s RB Definition ($definitionName/$definitionVersion) not found ") } else if (profileName == "") { log.warn("K8s rb profile name is empty! Either define profile name to use or choose default") } else if (api.hasProfile(definitionName, definitionVersion, profileName)) { @@ -144,15 +144,15 @@ open class K8sProfileUploadComponent( val profileK8sVersion: String? = prefixInputParamsMap[INPUT_K8S_PROFILE_K8S_VERSION]?.returnNullIfMissing()?.asText() var profileSource: String? = prefixInputParamsMap[INPUT_K8S_PROFILE_SOURCE]?.returnNullIfMissing()?.asText() if (profileNamespace == null) - throw BlueprintProcessorException("Profile $profileName namespace is missing") + throw BluePrintProcessorException("Profile $profileName namespace is missing") if (profileSource == null) { profileSource = profileName log.info("Profile name used instead of profile source") } val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, profileSource) - if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE) - throw BlueprintProcessorException( + if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE) + throw BluePrintProcessorException( "Unexpected profile artifact type for profile source " + "$profileSource. Expecting: $artifact.type" ) @@ -239,19 +239,19 @@ open class K8sProfileUploadComponent( tempProfilePath, manifestFiles ) } else - throw BlueprintProcessorException("Manifest file is missing") + throw BluePrintProcessorException("Manifest file is missing") // Preparation of the final profile content val finalProfileFilePath = Paths.get( tempMainPath.toString().plus(File.separator).plus( "$k8sRbProfileName.tar.gz" ) ) - if (!BlueprintArchiveUtils.compress( + if (!BluePrintArchiveUtils.compress( tempProfilePath, finalProfileFilePath.toFile(), ArchiveType.TarGz ) ) { - throw BlueprintProcessorException("Profile compression has failed") + throw BluePrintProcessorException("Profile compression has failed") } FileUtils.deleteDirectory(tempProfilePath) @@ -261,7 +261,7 @@ open class K8sProfileUploadComponent( throw t } } else - throw BlueprintProcessorException("Profile source $ks8ProfileLocation is missing in CBA folder") + throw BluePrintProcessorException("Profile source $ks8ProfileLocation is missing in CBA folder") } private fun readManifestFiles(profileSource: File, destinationFolder: File): ArrayList<File>? { @@ -353,7 +353,7 @@ open class K8sProfileUploadComponent( if (!isFileInTheManifestFiles(finalFile, manifestFiles)) return val fileContent = templatedFile.bufferedReader().readText() - val finalFileContent = BlueprintVelocityTemplateService.generateContent( + val finalFileContent = BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true ) diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt index ceb4e80e7..969277751 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt @@ -23,21 +23,21 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ArrayNode import com.fasterxml.jackson.databind.node.ObjectNode import org.apache.commons.io.FileUtils -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory @@ -52,7 +52,7 @@ import java.nio.file.Paths @Component("component-k8s-config-template") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class K8sConfigTemplateComponent( - private var bluePrintPropertiesService: BlueprintPropertiesService, + private var bluePrintPropertiesService: BluePrintPropertiesService, private val resourceResolutionService: ResourceResolutionService ) : @@ -141,8 +141,8 @@ open class K8sConfigTemplateComponent( } val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, templateSource) - if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) - throw BlueprintProcessorException( + if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) + throw BluePrintProcessorException( "Unexpected template artifact type for template source $templateSource. Expecting: $artifact.type" ) val template = K8sTemplate() @@ -222,8 +222,8 @@ open class K8sConfigTemplateComponent( "$k8sRbTemplateName.tar.gz" ) ) - if (!BlueprintArchiveUtils.compress(tempPath, finalTemplateFilePath.toFile(), ArchiveType.TarGz)) { - throw BlueprintProcessorException("Config template compression has failed") + if (!BluePrintArchiveUtils.compress(tempPath, finalTemplateFilePath.toFile(), ArchiveType.TarGz)) { + throw BluePrintProcessorException("Config template compression has failed") } FileUtils.deleteDirectory(tempPath) @@ -233,7 +233,7 @@ open class K8sConfigTemplateComponent( throw t } } else - throw BlueprintProcessorException("Config source $k8sConfigLocation is missing in CBA folder") + throw BluePrintProcessorException("Config source $k8sConfigLocation is missing in CBA folder") } private fun templateLocation(location: File, params: JsonNode, destinationFolder: File) { @@ -256,7 +256,7 @@ open class K8sConfigTemplateComponent( private fun templateFile(templateFile: File, params: JsonNode, destinationFolder: File) { val finalFile = File(destinationFolder.path.plus(File.separator).plus(templateFile.nameWithoutExtension)) val fileContent = templateFile.bufferedReader().readText() - val finalFileContent = BlueprintVelocityTemplateService.generateContent( + val finalFileContent = BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true ) diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt index 7a487f205..f1affacf4 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode import com.fasterxml.jackson.databind.node.ObjectNode import com.fasterxml.jackson.dataformat.yaml.YAMLFactory import com.fasterxml.jackson.module.kotlin.convertValue -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sConfigValueRequest @@ -14,12 +14,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sPluginIn import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory @@ -33,7 +33,7 @@ import java.nio.file.Paths @Component("component-k8s-config-value") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class K8sConfigValueComponent( - private var bluePrintPropertiesService: BlueprintPropertiesService, + private var bluePrintPropertiesService: BluePrintPropertiesService, private val resourceResolutionService: ResourceResolutionService ) : AbstractComponentFunction() { @@ -105,7 +105,7 @@ open class K8sConfigValueComponent( else if (operationType == OperationType.DELETE.toString()) deleteOperation(instanceId, configName) else - throw BlueprintProcessorException("Unknown operation type: $operationType") + throw BluePrintProcessorException("Unknown operation type: $operationType") } } @@ -124,8 +124,8 @@ open class K8sConfigValueComponent( outputPrefixStatuses[prefix] = OUTPUT_ERROR val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, valueSource) - if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) - throw BlueprintProcessorException( + if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) + throw BluePrintProcessorException( "Unexpected config artifact type for config value source $valueSource. Expecting: $artifact.type" ) val configValueRequest = K8sConfigValueRequest() @@ -153,8 +153,8 @@ open class K8sConfigValueComponent( outputPrefixStatuses[prefix] = OUTPUT_ERROR val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, valueSource) - if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) - throw BlueprintProcessorException( + if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG) + throw BluePrintProcessorException( "Unexpected config artifact type for config value source $valueSource. Expecting: $artifact.type" ) if (api.hasConfigurationValues(instanceId, configName)) { @@ -165,7 +165,7 @@ open class K8sConfigValueComponent( configValueRequest.values = parseResult(valueSource, artifact.file) api.editConfigurationValues(configValueRequest, instanceId, configName) } else { - throw BlueprintProcessorException("Error while getting configuration value") + throw BluePrintProcessorException("Error while getting configuration value") } } } @@ -189,7 +189,7 @@ open class K8sConfigValueComponent( ) if (!configeValueSourceFilePath.toFile().exists() || configeValueSourceFilePath.toFile().isDirectory) - throw BlueprintProcessorException("Specified config value source $k8sConfigLocation is not a file") + throw BluePrintProcessorException("Specified config value source $k8sConfigLocation is not a file") var obj: Any? = null val yamlReader = ObjectMapper(YAMLFactory()) @@ -225,7 +225,7 @@ open class K8sConfigValueComponent( private fun templateValues(templateFile: File, params: JsonNode): String { val fileContent = templateFile.bufferedReader().readText() - return BlueprintVelocityTemplateService.generateContent( + return BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true ) @@ -238,7 +238,7 @@ open class K8sConfigValueComponent( if (profileSourceFileFolderPath.toFile().exists() && !profileSourceFileFolderPath.toFile().isDirectory) return profileSourceFileFolderPath.toFile() else - throw BlueprintProcessorException("Template value $profileSourceFileFolderPath is missing in CBA folder") + throw BluePrintProcessorException("Template value $profileSourceFileFolderPath is missing in CBA folder") } private fun getTemplatePrefixList(node: JsonNode?): ArrayList<String> { diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt index 3305481e1..dbcc13395 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt @@ -26,7 +26,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckList import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckSimple import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import org.springframework.http.HttpMethod.DELETE @@ -55,10 +55,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Did not find any objects with tag")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -77,10 +77,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -116,10 +116,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -155,10 +155,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -180,10 +180,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -205,10 +205,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -230,10 +230,10 @@ class K8sPluginInstanceApi( } else if (result.status == 500 && result.body.contains("Error finding master table")) null else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -252,10 +252,10 @@ class K8sPluginInstanceApi( ) parsedObject } else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to create config instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -274,10 +274,10 @@ class K8sPluginInstanceApi( ) parsedObject } else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to edit config instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -293,7 +293,7 @@ class K8sPluginInstanceApi( return result.status in 200..299 } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -312,10 +312,10 @@ class K8sPluginInstanceApi( ) parsedObject } else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get config instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -329,10 +329,10 @@ class K8sPluginInstanceApi( ) log.debug(result.toString()) if (result.status !in 200..299) - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to delete config instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -351,10 +351,10 @@ class K8sPluginInstanceApi( ) parsedObject } else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -373,10 +373,10 @@ class K8sPluginInstanceApi( ) parsedObject } else - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } @@ -390,10 +390,10 @@ class K8sPluginInstanceApi( ) log.debug(result.toString()) if (result.status !in 200..299) - throw BlueprintProcessorException(result.body) + throw BluePrintProcessorException(result.body) } catch (e: Exception) { log.error("Caught exception trying to get k8s rb instance") - throw BlueprintProcessorException("${e.message}") + throw BluePrintProcessorException("${e.message}") } } } diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizeExtensions.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizeExtensions.kt index 77adb0a87..d8e71d413 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizeExtensions.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizeExtensions.kt @@ -18,19 +18,19 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService /** * Register the MessagePrioritizationStateService and exposed dependency */ -fun BlueprintDependencyService.messagePrioritizationStateService(): MessagePrioritizationStateService = +fun BluePrintDependencyService.messagePrioritizationStateService(): MessagePrioritizationStateService = instance(MessagePrioritizationStateService::class) /** * Expose messagePrioritizationStateService to AbstractComponentFunction */ fun AbstractComponentFunction.messagePrioritizationStateService() = - BlueprintDependencyService.messagePrioritizationStateService() + BluePrintDependencyService.messagePrioritizationStateService() /** * MessagePrioritization correlation extensions diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/AbstractMessagePrioritizeProcessor.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/AbstractMessagePrioritizeProcessor.kt index 341a2aa8d..d4f8470c8 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/AbstractMessagePrioritizeProcessor.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/AbstractMessagePrioritizeProcessor.kt @@ -17,10 +17,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.kafka import org.apache.kafka.streams.processor.ProcessorContext -import org.onap.ccsdk.cds.blueprintsprocessor.message.kafka.AbstractBlueprintMessageProcessor +import org.onap.ccsdk.cds.blueprintsprocessor.message.kafka.AbstractBluePrintMessageProcessor /** CDS Message Prioritization Kafka Stream Processor abstract class to implement */ -abstract class AbstractMessagePrioritizeProcessor<K, V> : AbstractBlueprintMessageProcessor<K, V>() { +abstract class AbstractMessagePrioritizeProcessor<K, V> : AbstractBluePrintMessageProcessor<K, V>() { override fun init(processorContext: ProcessorContext) { this.processorContext = processorContext diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/DefaultMessagePrioritizeProcessor.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/DefaultMessagePrioritizeProcessor.kt index 6c1f7478c..1b0612492 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/DefaultMessagePrioritizeProcessor.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/DefaultMessagePrioritizeProcessor.kt @@ -23,7 +23,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.M import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.MessagePrioritizationStateService import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.MessageState import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -37,7 +37,7 @@ open class DefaultMessagePrioritizeProcessor( override suspend fun processNB(key: ByteArray, value: ByteArray) { val messagePrioritize = JacksonUtils.readValue(String(value), MessagePrioritization::class.java) - ?: throw BlueprintProcessorException("failed to convert") + ?: throw BluePrintProcessorException("failed to convert") try { kafkaMessagePrioritizationService.prioritize(messagePrioritize) } catch (e: Exception) { @@ -62,7 +62,7 @@ open class DefaultMessagePrioritizeProcessor( if (kafkaMessagePrioritizationService is AbstractKafkaMessagePrioritizationService) { kafkaMessagePrioritizationService.setKafkaProcessorContext(processorContext) } else { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "messagePrioritizationService is not instance of " + "AbstractKafkaMessagePrioritizationService, it is ${kafkaMessagePrioritizationService.javaClass}" ) diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/KafkaMessagePrioritizationConsumer.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/KafkaMessagePrioritizationConsumer.kt index ecdcbff08..4ab399f54 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/KafkaMessagePrioritizationConsumer.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/KafkaMessagePrioritizationConsumer.kt @@ -24,15 +24,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.P import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.utils.MessageProcessorUtils.bluePrintProcessorSupplier import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaStreamsBasicAuthConsumerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties -import org.onap.ccsdk.cds.blueprintsprocessor.message.service.BlueprintMessageLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.message.service.BluePrintMessageLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.message.service.BlueprintMessageConsumerService import org.onap.ccsdk.cds.blueprintsprocessor.message.service.KafkaStreamConsumerFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.splitCommaAsList open class KafkaMessagePrioritizationConsumer( - private val bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService, + private val bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService, private val kafkaMessagePrioritizationService: MessagePrioritizationService ) { @@ -50,7 +50,7 @@ open class KafkaMessagePrioritizationConsumer( return object : KafkaStreamConsumerFunction { val kafkaConsumerConfiguration = prioritizationConfiguration.kafkaConfiguration - ?: throw BlueprintProcessorException("failed to get kafka consumer configuration") + ?: throw BluePrintProcessorException("failed to get kafka consumer configuration") override suspend fun createTopology( messageConsumerProperties: MessageConsumerProperties, @@ -91,7 +91,7 @@ open class KafkaMessagePrioritizationConsumer( suspend fun startConsuming(prioritizationConfiguration: PrioritizationConfiguration) { val kafkaConsumerConfiguration = prioritizationConfiguration.kafkaConfiguration - ?: throw BlueprintProcessorException("failed to get kafka consumer configuration") + ?: throw BluePrintProcessorException("failed to get kafka consumer configuration") streamingConsumerService = consumerService(kafkaConsumerConfiguration.inputTopicSelector) diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/MessagePrioritizationSerde.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/MessagePrioritizationSerde.kt index 4b1a3f375..5595863d4 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/MessagePrioritizationSerde.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/kafka/MessagePrioritizationSerde.kt @@ -20,7 +20,7 @@ import org.apache.kafka.common.serialization.Deserializer import org.apache.kafka.common.serialization.Serde import org.apache.kafka.common.serialization.Serializer import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import java.nio.charset.Charset @@ -37,7 +37,7 @@ open class MessagePrioritizationSerde : Serde<MessagePrioritization> { return object : Deserializer<MessagePrioritization> { override fun deserialize(topic: String, data: ByteArray): MessagePrioritization { return JacksonUtils.readValue(String(data), MessagePrioritization::class.java) - ?: throw BlueprintProcessorException("failed to convert") + ?: throw BluePrintProcessorException("failed to convert") } override fun configure(configs: MutableMap<String, *>?, isKey: Boolean) { diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/AbstractNatsMessagePrioritizationService.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/AbstractNatsMessagePrioritizationService.kt index babddbde4..502a7822d 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/AbstractNatsMessagePrioritizationService.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/AbstractNatsMessagePrioritizationService.kt @@ -22,7 +22,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.d import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.ids import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.service.AbstractMessagePrioritizationService import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.utils.MessageProcessorUtils -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsService import org.onap.ccsdk.cds.blueprintsprocessor.nats.utils.NatsClusterUtils import org.onap.ccsdk.cds.controllerblueprints.core.asByteArray import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType @@ -34,7 +34,7 @@ abstract class AbstractNatsMessagePrioritizationService( private val log = logger(AbstractNatsMessagePrioritizationService::class) - lateinit var bluePrintNatsService: BlueprintNatsService + lateinit var bluePrintNatsService: BluePrintNatsService override suspend fun output(messages: List<MessagePrioritization>) { log.info("$$$$$ received in output processor id(${messages.ids()})") diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/NatsMessagePrioritizationConsumer.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/NatsMessagePrioritizationConsumer.kt index 0976127d1..a0b2cf462 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/NatsMessagePrioritizationConsumer.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/nats/NatsMessagePrioritizationConsumer.kt @@ -22,29 +22,29 @@ import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.MessagePrioritizationService import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization import org.onap.ccsdk.cds.blueprintsprocessor.nats.asJsonType -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsLibPropertyService -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsService import org.onap.ccsdk.cds.blueprintsprocessor.nats.utils.NatsClusterUtils import org.onap.ccsdk.cds.blueprintsprocessor.nats.utils.SubscriptionOptionsUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asType import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils open class NatsMessagePrioritizationConsumer( - private val bluePrintNatsLibPropertyService: BlueprintNatsLibPropertyService, + private val bluePrintNatsLibPropertyService: BluePrintNatsLibPropertyService, private val natsMessagePrioritizationService: MessagePrioritizationService ) { private val log = logger(NatsMessagePrioritizationConsumer::class) - lateinit var bluePrintNatsService: BlueprintNatsService + lateinit var bluePrintNatsService: BluePrintNatsService private lateinit var subscription: Subscription suspend fun startConsuming() { val prioritizationConfiguration = natsMessagePrioritizationService.getConfiguration() val natsConfiguration = prioritizationConfiguration.natsConfiguration - ?: throw BlueprintProcessorException("couldn't get NATS consumer configuration") + ?: throw BluePrintProcessorException("couldn't get NATS consumer configuration") check((natsMessagePrioritizationService is AbstractNatsMessagePrioritizationService)) { "messagePrioritizationService is not of type AbstractNatsMessagePrioritizationService." @@ -73,7 +73,7 @@ open class NatsMessagePrioritizationConsumer( log.info("Nats prioritization consumer listener shutdown complete") } - private fun consumerService(selector: String): BlueprintNatsService { + private fun consumerService(selector: String): BluePrintNatsService { return bluePrintNatsLibPropertyService.bluePrintNatsService(selector) } diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationStateServiceImpl.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationStateServiceImpl.kt index b66a2bd92..ed16fd44f 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationStateServiceImpl.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationStateServiceImpl.kt @@ -21,7 +21,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.M import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.PrioritizationMessageRepository import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.toFormatedCorrelation -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.addDate import org.onap.ccsdk.cds.controllerblueprints.core.utils.controllerDate @@ -48,7 +48,7 @@ open class MessagePrioritizationStateServiceImpl( override suspend fun getMessage(id: String): MessagePrioritization { return prioritizationMessageRepository.findById(id).orElseGet(null) - ?: throw BlueprintProcessorException("couldn't find message for id($id)") + ?: throw BluePrintProcessorException("couldn't find message for id($id)") } override suspend fun getMessages(ids: List<String>): List<MessagePrioritization>? { diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageCorrelationUtils.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageCorrelationUtils.kt index f42be52af..7ab0be098 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageCorrelationUtils.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageCorrelationUtils.kt @@ -20,7 +20,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.C import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.toFormatedCorrelation import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.toTypeNCorrelation -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException object MessageCorrelationUtils { @@ -50,7 +50,7 @@ object MessageCorrelationUtils { val unknownMessageTypes = collectedMessages.filter { !types.contains(it.type) }.map { it.id } if (!unknownMessageTypes.isNullOrEmpty()) { - throw BlueprintProcessorException("Messages($unknownMessageTypes) is not in type of($types)") + throw BluePrintProcessorException("Messages($unknownMessageTypes) is not in type of($types)") } val copyTypes = types.toTypedArray().copyOf().toMutableList() diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageProcessorUtils.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageProcessorUtils.kt index 3eba4ed86..86cec3697 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageProcessorUtils.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/utils/MessageProcessorUtils.kt @@ -22,14 +22,14 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.kafka.AbstractMessagePrioritizeProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.toFormatedCorrelation -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService object MessageProcessorUtils { /** Utility to create the cluster lock for message [messagePrioritization] prioritization procssing.*/ suspend fun prioritizationGrouplock(messagePrioritization: MessagePrioritization): ClusterLock? { - val clusterService = BlueprintDependencyService.optionalClusterService() + val clusterService = BluePrintDependencyService.optionalClusterService() return if (clusterService != null && clusterService.clusterJoined() && !messagePrioritization.correlationId.isNullOrBlank() @@ -39,31 +39,31 @@ object MessageProcessorUtils { val lockName = "prioritize::${messagePrioritization.group}::$correlationId" val clusterLock = clusterService.clusterLock(lockName) clusterLock.lock() - if (!clusterLock.isLocked()) throw BlueprintProcessorException("failed to lock($lockName)") + if (!clusterLock.isLocked()) throw BluePrintProcessorException("failed to lock($lockName)") clusterLock } else null } /** Utility to create the cluster lock for expiry scheduler*/ suspend fun prioritizationExpiryLock(): ClusterLock? { - val clusterService = BlueprintDependencyService.optionalClusterService() + val clusterService = BluePrintDependencyService.optionalClusterService() return if (clusterService != null && clusterService.clusterJoined()) { val lockName = "prioritize-expiry" val clusterLock = clusterService.clusterLock(lockName) clusterLock.lock() - if (!clusterLock.isLocked()) throw BlueprintProcessorException("failed to lock($lockName)") + if (!clusterLock.isLocked()) throw BluePrintProcessorException("failed to lock($lockName)") clusterLock } else null } /** Utility to create the cluster lock for expiry scheduler*/ suspend fun prioritizationCleanLock(): ClusterLock? { - val clusterService = BlueprintDependencyService.optionalClusterService() + val clusterService = BluePrintDependencyService.optionalClusterService() return if (clusterService != null && clusterService.clusterJoined()) { val lockName = "prioritize-clean" val clusterLock = clusterService.clusterLock(lockName) clusterLock.lock() - if (!clusterLock.isLocked()) throw BlueprintProcessorException("failed to lock($lockName)") + if (!clusterLock.isLocked()) throw BluePrintProcessorException("failed to lock($lockName)") clusterLock } else null } @@ -80,7 +80,7 @@ object MessageProcessorUtils { fun <K, V> bluePrintProcessorSupplier(name: String): ProcessorSupplier<K, V> { return ProcessorSupplier<K, V> { // Dynamically resolve the Prioritization Processor - BlueprintDependencyService.instance<AbstractMessagePrioritizeProcessor<K, V>>(name) + BluePrintDependencyService.instance<AbstractMessagePrioritizeProcessor<K, V>>(name) } } } diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt index 9f74daa50..e5dbe6af5 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt @@ -27,8 +27,8 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.PrioritizationMessageRepository import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.kafka.DefaultMessagePrioritizeProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.kafka.KafkaMessagePrioritizationConsumer @@ -38,17 +38,17 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.s import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.service.SampleMessagePrioritizationService import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.service.SampleNatsMessagePrioritizationService import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.utils.MessagePrioritizationSample -import org.onap.ccsdk.cds.blueprintsprocessor.message.BlueprintMessageLibConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.message.service.BlueprintMessageLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.message.BluePrintMessageLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.message.service.BluePrintMessageLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.message.service.KafkaMessageProducerService -import org.onap.ccsdk.cds.blueprintsprocessor.nats.BlueprintNatsLibConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.BluePrintNatsLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.nats.utils.NatsClusterUtils import org.onap.ccsdk.cds.controllerblueprints.core.asByteArray import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.mock.mockito.MockBean @@ -65,8 +65,8 @@ import kotlin.test.assertNotNull @DirtiesContext @ContextConfiguration( classes = [ - BlueprintMessageLibConfiguration::class, BlueprintNatsLibConfiguration::class, - BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class, + BluePrintMessageLibConfiguration::class, BluePrintNatsLibConfiguration::class, + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, MessagePrioritizationConfiguration::class, TestDatabaseConfiguration::class ] ) @@ -115,10 +115,10 @@ open class MessagePrioritizationConsumerTest { lateinit var prioritizationMessageRepository: PrioritizationMessageRepository @Autowired - lateinit var bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService + lateinit var bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService @Autowired - lateinit var bluePrintNatsLibPropertyService: BlueprintNatsLibPropertyService + lateinit var bluePrintNatsLibPropertyService: BluePrintNatsLibPropertyService @Autowired lateinit var messagePrioritizationStateService: MessagePrioritizationStateService @@ -128,15 +128,15 @@ open class MessagePrioritizationConsumerTest { @Before fun setup() { - BlueprintDependencyService.inject(applicationContext) + BluePrintDependencyService.inject(applicationContext) } @Test - fun testBlueprintKafkaJDBCKeyStore() { + fun testBluePrintKafkaJDBCKeyStore() { runBlocking { assertNotNull(prioritizationMessageRepository, "failed to get prioritizationMessageRepository") - val messagePrioritizationService: MessagePrioritizationStateService = BlueprintDependencyService + val messagePrioritizationService: MessagePrioritizationStateService = BluePrintDependencyService .instance(MessagePrioritizationStateService::class) assertNotNull(messagePrioritizationService, "failed to get messagePrioritizationService") @@ -248,7 +248,7 @@ open class MessagePrioritizationConsumerTest { ) // Register the processor - BlueprintDependencyService.registerSingleton( + BluePrintDependencyService.registerSingleton( MessagePrioritizationConstants.PROCESSOR_PRIORITIZE, defaultMessagePrioritizeProcessor ) diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt index 6e667c28b..b964388cb 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorExtensions.kt @@ -22,13 +22,13 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.Dev import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils /** * Register the Netconf module exposed dependency */ -fun BlueprintDependencyService.netconfClientService(): ResourceResolutionService = +fun BluePrintDependencyService.netconfClientService(): ResourceResolutionService = instance(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION) fun AbstractComponentFunction.netconfDevice(requirementName: String): NetconfDevice { diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt index cdfd93c82..f3df55b4b 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutorTest.kt @@ -31,10 +31,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.BlueprintJythonService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.putJsonElement -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.context.ApplicationContext @@ -66,7 +66,7 @@ class ComponentNetconfExecutorTest { ExecutionServiceInput::class.java )!! - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -92,9 +92,9 @@ class ComponentNetconfExecutorTest { // TODO("Set Attribute properties") val stepMetaData: MutableMap<String, JsonNode> = hashMapOf() - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "activate-netconf") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentNetconfExecutor") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "activate-netconf") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentNetconfExecutor") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process") // Set Step Inputs in Blueprint Runtime Service componentNetconfExecutor.bluePrintRuntimeService = bluePrintRuntimeService val stepInputData = StepData().apply { diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt index b32ccea13..e2b6f6560 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt @@ -24,8 +24,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts.BlueprintJythonServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts.PythonExecutorConstants import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.data.OperationAssignment import org.slf4j.LoggerFactory @@ -66,12 +66,12 @@ open class ComponentJythonExecutor( .nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName) val artifactName: String = operationAssignment.implementation?.primary - ?: throw BlueprintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") + ?: throw BluePrintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") val artifactDefinition = bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) val pythonFileName = artifactDefinition.file - ?: throw BlueprintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)") + ?: throw BluePrintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)") val pythonClassName = FilenameUtils.getBaseName(pythonFileName) @@ -80,7 +80,7 @@ open class ComponentJythonExecutor( checkNotEmpty(content) { "artifact ($artifactName) content is empty" } val instanceDependenciesNode: ArrayNode = operationInputs[PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES] as? ArrayNode - ?: throw BlueprintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})") + ?: throw BluePrintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})") val jythonInstance: MutableMap<String, Any> = hashMapOf() jythonInstance["log"] = LoggerFactory.getLogger(pythonClassName) @@ -99,6 +99,6 @@ open class ComponentJythonExecutor( componentFunction.operationName = operationName componentFunction.processId = processId componentFunction.workflowName = workflowName - componentFunction.scriptType = BlueprintConstants.SCRIPT_JYTHON + componentFunction.scriptType = BluePrintConstants.SCRIPT_JYTHON } } diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt index 5f6d98fd2..013c991cc 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt @@ -19,7 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor import com.fasterxml.jackson.databind.JsonNode import com.google.protobuf.ByteString -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.PrepareRemoteEnvInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteIdentifier @@ -31,7 +31,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintMod import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceConstant import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.RemoteScriptExecutionService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.checkFileExists @@ -52,7 +52,7 @@ import org.springframework.stereotype.Component @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class ComponentRemotePythonExecutor( private val remoteScriptExecutionService: RemoteScriptExecutionService, - private val bluePrintPropertiesService: BlueprintPropertiesService, + private val bluePrintPropertiesService: BluePrintPropertiesService, private val blueprintModelRepository: BlueprintModelRepository ) : AbstractComponentFunction() { @@ -107,7 +107,7 @@ open class ComponentRemotePythonExecutor( .nodeTemplateInterfaceOperation(nodeTemplateName, interfaceName, operationName) val artifactName: String = operationAssignment.implementation?.primary - ?: throw BlueprintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") + ?: throw BluePrintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") val artifactDefinition = bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) @@ -298,7 +298,7 @@ open class ComponentRemotePythonExecutor( } private fun noBlueprintErrors() = - bluePrintRuntimeService.getBlueprintError().stepErrors(stepName).isNullOrEmpty() + bluePrintRuntimeService.getBluePrintError().stepErrors(stepName).isNullOrEmpty() override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { addError("Failed in ComponentRemotePythonExecutor : ${runtimeException.message}") diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt index 6788310aa..3df25c402 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt @@ -18,8 +18,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ArrayNode -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType @@ -32,53 +32,53 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeType import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils /** Component Extensions **/ -fun BlueprintTypes.nodeTypeComponentRemotePythonExecutor(): NodeType { +fun BluePrintTypes.nodeTypeComponentRemotePythonExecutor(): NodeType { return nodeType( - id = "component-remote-python-executor", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_COMPONENT, + id = "component-remote-python-executor", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, description = "This is Remote Python Execution Component." ) { attribute( - ComponentRemotePythonExecutor.ATTRIBUTE_PREPARE_ENV_LOG, BlueprintConstants.DATA_TYPE_STRING, + ComponentRemotePythonExecutor.ATTRIBUTE_PREPARE_ENV_LOG, BluePrintConstants.DATA_TYPE_STRING, false ) attribute( - ComponentRemotePythonExecutor.ATTRIBUTE_EXEC_CMD_LOG, BlueprintConstants.DATA_TYPE_LIST, + ComponentRemotePythonExecutor.ATTRIBUTE_EXEC_CMD_LOG, BluePrintConstants.DATA_TYPE_LIST, false ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } attribute( - ComponentRemotePythonExecutor.ATTRIBUTE_RESPONSE_DATA, BlueprintConstants.DATA_TYPE_JSON, + ComponentRemotePythonExecutor.ATTRIBUTE_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON, false ) operation("ComponentRemotePythonExecutor", "ComponentRemotePythonExecutor Operation") { inputs { property( - ComponentRemotePythonExecutor.INPUT_ENDPOINT_SELECTOR, BlueprintConstants.DATA_TYPE_STRING, + ComponentRemotePythonExecutor.INPUT_ENDPOINT_SELECTOR, BluePrintConstants.DATA_TYPE_STRING, false, "Remote Container or Server selector name." ) { defaultValue(ComponentRemotePythonExecutor.DEFAULT_SELECTOR) } property( - ComponentRemotePythonExecutor.INPUT_DYNAMIC_PROPERTIES, BlueprintConstants.DATA_TYPE_JSON, + ComponentRemotePythonExecutor.INPUT_DYNAMIC_PROPERTIES, BluePrintConstants.DATA_TYPE_JSON, false, "Dynamic Json Content or DSL Json reference." ) property( - ComponentRemotePythonExecutor.INPUT_ARGUMENT_PROPERTIES, BlueprintConstants.DATA_TYPE_JSON, + ComponentRemotePythonExecutor.INPUT_ARGUMENT_PROPERTIES, BluePrintConstants.DATA_TYPE_JSON, false, "Argument Json Content or DSL Json reference." ) property( - ComponentRemotePythonExecutor.INPUT_COMMAND, BlueprintConstants.DATA_TYPE_STRING, + ComponentRemotePythonExecutor.INPUT_COMMAND, BluePrintConstants.DATA_TYPE_STRING, true, "Command to execute." ) property( - ComponentRemotePythonExecutor.INPUT_PACKAGES, BlueprintConstants.DATA_TYPE_LIST, + ComponentRemotePythonExecutor.INPUT_PACKAGES, BluePrintConstants.DATA_TYPE_LIST, false, "Packages to install based on type." ) { entrySchema("dt-system-packages") @@ -88,26 +88,26 @@ fun BlueprintTypes.nodeTypeComponentRemotePythonExecutor(): NodeType { } } -fun BlueprintTypes.dataTypeDtSystemPackages(): DataType { +fun BluePrintTypes.dataTypeDtSystemPackages(): DataType { return dataType( - id = "dt-system-packages", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT, + id = "dt-system-packages", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT, description = "This represent System Package Data Type" ) { - property("type", BlueprintConstants.DATA_TYPE_LIST, true, "") { + property("type", BluePrintConstants.DATA_TYPE_LIST, true, "") { constrain { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) validValues(arrayListOf("ansible_galaxy".asJsonPrimitive(), "pip".asJsonPrimitive())) } } - property("package", BlueprintConstants.DATA_TYPE_LIST, true, "") { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + property("package", BluePrintConstants.DATA_TYPE_LIST, true, "") { + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } } } /** Component Builder */ -fun BlueprintTypes.nodeTemplateComponentRemotePythonExecutor( +fun BluePrintTypes.nodeTemplateComponentRemotePythonExecutor( id: String, description: String, block: ComponentRemotePythonExecutorNodeTemplateBuilder.() -> Unit diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/JythonComponentFunction.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/JythonComponentFunction.kt index 0ac542bd0..891b09d88 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/JythonComponentFunction.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/JythonComponentFunction.kt @@ -18,15 +18,15 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException open class JythonComponentFunction : AbstractScriptComponentFunction() { override suspend fun processNB(executionRequest: ExecutionServiceInput) { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } } diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceImpl.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceImpl.kt index 9faacd9de..b0ce73588 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceImpl.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceImpl.kt @@ -20,11 +20,11 @@ import com.fasterxml.jackson.databind.node.ArrayNode import org.apache.commons.io.FilenameUtils import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.BlueprintJythonService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.data.OperationAssignment import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -42,7 +42,7 @@ class BlueprintJythonServiceImpl( val log: Logger = LoggerFactory.getLogger(BlueprintJythonService::class.java) inline fun <reified T> jythonInstance( - blueprintContext: BlueprintContext, + blueprintContext: BluePrintContext, pythonClassName: String, content: String, dependencyInstanceNames: MutableMap<String, Any>? @@ -54,7 +54,7 @@ class BlueprintJythonServiceImpl( pythonPath.addAll(pythonExecutorProperty.modulePaths) val blueprintPythonConfigurations = - BlueprintPython(pythonExecutorProperty.executionPath, pythonPath, arrayListOf()) + BluePrintPython(pythonExecutorProperty.executionPath, pythonPath, arrayListOf()) val blueprintPythonHost = BlueprintPythonHost(blueprintPythonConfigurations) val pyObject = blueprintPythonHost.getPythonComponent(content, pythonClassName, dependencyInstanceNames) @@ -64,7 +64,7 @@ class BlueprintJythonServiceImpl( return pyObject.__tojava__(T::class.java) as T } - override fun jythonComponentInstance(bluePrintContext: BlueprintContext, scriptClassReference: String): + override fun jythonComponentInstance(bluePrintContext: BluePrintContext, scriptClassReference: String): BlueprintFunctionNode<*, *> { val pythonFileName = bluePrintContext.rootPath @@ -101,13 +101,13 @@ class BlueprintJythonServiceImpl( val blueprintBasePath: String = bluePrintContext.rootPath val artifactName: String = operationAssignment.implementation?.primary - ?: throw BlueprintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") + ?: throw BluePrintProcessorException("missing primary field to get artifact name for node template ($nodeTemplateName)") val artifactDefinition = bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) val pythonFileName = artifactDefinition.file - ?: throw BlueprintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)") + ?: throw BluePrintProcessorException("missing file name for node template ($nodeTemplateName)'s artifactName($artifactName)") val pythonClassName = FilenameUtils.getBaseName(pythonFileName) log.info("Getting Jython Script Class($pythonClassName)") @@ -125,7 +125,7 @@ class BlueprintJythonServiceImpl( val instanceDependenciesNode: ArrayNode = operationInputs[PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES] as? ArrayNode - ?: throw BlueprintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})") + ?: throw BluePrintProcessorException("Failed to get property(${PythonExecutorConstants.INPUT_INSTANCE_DEPENDENCIES})") instanceDependenciesNode.forEach { instanceName -> jythonInstances[instanceName.textValue()] = applicationContext.getBean(instanceName.textValue()) diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt index 0fe68cf6a..f8f0e7e32 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt @@ -16,13 +16,13 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage import org.python.core.PyObject import org.python.util.PythonInterpreter @Deprecated("CDS won't support JythonService") -open class BlueprintPythonHost(private val bluePrintPython: BlueprintPython) { +open class BlueprintPythonHost(private val bluePrintPython: BluePrintPython) { private val blueprintPythonInterpreterProxy: BlueprintPythonInterpreterProxy @@ -45,14 +45,14 @@ open class BlueprintPythonHost(private val bluePrintPython: BlueprintPython) { bluePrintPython.moduleName = "Blueprint Python Script [Class Name = $interfaceName]" try { return blueprintPythonInterpreterProxy.getPythonInstance(properties) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to get python instance." throw e.updateErrorMessage( ExecutionServiceDomains.PYTHON_EXECUTOR, errorMsg, "Error in environment properties" ) } catch (e: Exception) { - throw BlueprintProcessorException("Failed to execute Jython component $e", e) + throw BluePrintProcessorException("Failed to execute Jython component $e", e) } } diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonInterpreterProxy.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonInterpreterProxy.kt index 9d98d90c7..0fb33f9c2 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonInterpreterProxy.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonInterpreterProxy.kt @@ -15,13 +15,13 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.python.core.PyObject import org.python.core.PySyntaxError import org.python.util.PythonInterpreter @Deprecated("CDS won't support JythonService") -open class BlueprintPythonInterpreterProxy(private val bluePrintPython: BlueprintPython) : PythonInterpreter() { +open class BlueprintPythonInterpreterProxy(private val bluePrintPython: BluePrintPython) : PythonInterpreter() { fun getPythonInstance(properties: MutableMap<String, Any>?): PyObject { properties?.forEach { (name, value) -> @@ -34,7 +34,7 @@ open class BlueprintPythonInterpreterProxy(private val bluePrintPython: Blueprin try { this.exec(bluePrintPython.content) } catch (e: PySyntaxError) { - throw BlueprintProcessorException("Error executing Jython code! Python error: '$e'", e) + throw BluePrintProcessorException("Error executing Jython code! Python error: '$e'", e) } } diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/PythonExecutorConfiguration.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/PythonExecutorConfiguration.kt index 3484fdbeb..593c0552b 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/PythonExecutorConfiguration.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/PythonExecutorConfiguration.kt @@ -52,7 +52,7 @@ class PythonExecutorConstants { } @Deprecated("CDS won't support JythonService") -open class BlueprintPython( +open class BluePrintPython( executablePath: String, blueprintPythonPlatform: MutableList<String>, val argv: MutableList<String> diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt index 089a33931..d5fa0b20c 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt @@ -26,9 +26,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.mock.MockInstanceConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts.PythonExecutorConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts.PythonExecutorProperty -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.putJsonElement -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -63,15 +63,15 @@ class ComponentJythonExecutorTest { ExecutionServiceInput::class.java )!! - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) val stepMetaData: MutableMap<String, JsonNode> = hashMapOf() - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "activate-jython") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentJythonExecutor") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "activate-jython") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentJythonExecutor") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process") componentJythonExecutor.bluePrintRuntimeService = bluePrintRuntimeService val stepInputData = StepData().apply { name = "activate-jython" diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSLTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSLTest.kt index 0318664a0..46a3120d5 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSLTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSLTest.kt @@ -17,21 +17,21 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import kotlin.test.assertNotNull class ComponentRemotePythonExecutorDSLTest { @Test fun testNodeTypeComponentRemotePythonExecutor() { - val nodeType = BlueprintTypes.nodeTypeComponentRemotePythonExecutor() + val nodeType = BluePrintTypes.nodeTypeComponentRemotePythonExecutor() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeComponentRemotePythonExecutor") } @Test fun testNodeTemplateComponentRemotePythonExecutor() { - val nodeTemplate = BlueprintTypes.nodeTemplateComponentRemotePythonExecutor( + val nodeTemplate = BluePrintTypes.nodeTemplateComponentRemotePythonExecutor( "test-nodetemplate", "test nodetemplate" ) { diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt index 2fd33f2a6..b81f05c6e 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorTest.kt @@ -22,7 +22,7 @@ import io.mockk.every import io.mockk.mockk import kotlinx.coroutines.runBlocking import org.junit.Test -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.PrepareRemoteEnvInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.RemoteScriptExecutionInput @@ -33,13 +33,13 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StatusType import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelRepository import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.RemoteScriptExecutionService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.putJsonElement -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -53,7 +53,7 @@ class ComponentRemotePythonExecutorTest { val componentRemotePythonExecutor = ComponentRemotePythonExecutor( remoteScriptExecutionService, - mockk<BlueprintPropertiesService>(), + mockk<BluePrintPropertiesService>(), mockk<BlueprintModelRepository>() ) @@ -63,7 +63,7 @@ class ComponentRemotePythonExecutorTest { ExecutionServiceInput::class.java )!! - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "123456-1000", "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts" ) @@ -75,9 +75,9 @@ class ComponentRemotePythonExecutorTest { ) val stepMetaData: MutableMap<String, JsonNode> = hashMapOf() - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-python") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemotePythonExecutor") - stepMetaData.putJsonElement(BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-python") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemotePythonExecutor") + stepMetaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process") componentRemotePythonExecutor.bluePrintRuntimeService = bluePrintRuntimeService val stepInputData = StepData().apply { name = "execute-remote-python" @@ -98,12 +98,12 @@ class ComponentRemotePythonExecutorTest { val remoteScriptExecutionService = MockRemoteScriptExecutionService() val componentRemotePythonExecutor = ComponentRemotePythonExecutor( remoteScriptExecutionService, - mockk<BlueprintPropertiesService>(), + mockk<BluePrintPropertiesService>(), mockk<BlueprintModelRepository>() ) - val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("123456-1000") + val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("123456-1000") - every { bluePrintRuntime.getBlueprintError() } answers { BlueprintError() } // successful case. + every { bluePrintRuntime.getBluePrintError() } answers { BluePrintError() } // successful case. every { bluePrintRuntime.setNodeTemplateAttributeValue(any(), any(), any()) } answers {} val input = getMockedOutput(bluePrintRuntime) @@ -115,20 +115,20 @@ class ComponentRemotePythonExecutorTest { /** * Mocked input information for remote python executor. */ - fun getMockedOutput(svc: DefaultBlueprintRuntimeService): + fun getMockedOutput(svc: DefaultBluePrintRuntimeService): ExecutionServiceInput { val stepMetaData: MutableMap<String, JsonNode> = hashMapOf() stepMetaData.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, + BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-python" ) stepMetaData.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_INTERFACE, + BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemotePythonExecutor" ) stepMetaData.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process" + BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process" ) val mapper = ObjectMapper() @@ -138,15 +138,15 @@ class ComponentRemotePythonExecutorTest { val operationalInputs: MutableMap<String, JsonNode> = hashMapOf() operationalInputs.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, + BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "execute-remote-python" ) operationalInputs.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_INTERFACE, + BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ComponentRemotePythonExecutor" ) operationalInputs.putJsonElement( - BlueprintConstants.PROPERTY_CURRENT_OPERATION, "process" + BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process" ) operationalInputs.putJsonElement("endpoint-selector", "aai") operationalInputs.putJsonElement("dynamic-properties", rootNode) @@ -179,7 +179,7 @@ class ComponentRemotePythonExecutorTest { "ComponentRemotePythonExecutor", "process" ) } returns operationOutputs - val bluePrintRuntimeService = BlueprintMetadataUtils.bluePrintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( "123456-1000", "./../../../../components/model-" + "catalog/blueprint-model/test-blueprint/" + diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceTest.kt index ad87f3c19..94ec1413f 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintJythonServiceTest.kt @@ -23,7 +23,7 @@ import io.mockk.mockk import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -39,13 +39,13 @@ import kotlin.test.assertNotNull "blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints"]) class BlueprintJythonServiceTest { - lateinit var blueprintContext: BlueprintContext + lateinit var blueprintContext: BluePrintContext @Autowired private lateinit var blueprintJythonService: BlueprintJythonServiceImpl @BeforeTest fun init() { - blueprintContext = mockk<BlueprintContext>() + blueprintContext = mockk<BluePrintContext>() every { blueprintContext.rootPath } returns normalizedPathName("target") } diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHostTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHostTest.kt index 2ebd10c38..0efaaa113 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHostTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHostTest.kt @@ -26,7 +26,7 @@ import kotlin.test.BeforeTest import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [BlueprintPython::class, PythonExecutorProperty::class, String::class]) +@ContextConfiguration(classes = [BluePrintPython::class, PythonExecutorProperty::class, String::class]) @TestPropertySource( properties = [ @@ -48,7 +48,7 @@ class BlueprintPythonHostTest { pythonPath.add(blueprintBasePath) pythonPath.addAll(pythonExecutorProperty.modulePaths) - blueprintPythonHost = BlueprintPythonHost(BlueprintPython(pythonExecutorProperty.executionPath, pythonPath, arrayListOf())) + blueprintPythonHost = BlueprintPythonHost(BluePrintPython(pythonExecutorProperty.executionPath, pythonPath, arrayListOf())) } @Test diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt index 69db6cf8e..8087f7e3f 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentRuntimeService.kt @@ -1,12 +1,12 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService -class ResourceAssignmentRuntimeService(private var id: String, private var bluePrintContext: BlueprintContext) : - DefaultBlueprintRuntimeService(id, bluePrintContext) { +class ResourceAssignmentRuntimeService(private var id: String, private var bluePrintContext: BluePrintContext) : + DefaultBluePrintRuntimeService(id, bluePrintContext) { private lateinit var resolutionId: String private var resourceStore: MutableMap<String, JsonNode> = hashMapOf() @@ -29,7 +29,7 @@ class ResourceAssignmentRuntimeService(private var id: String, private var blueP fun getResolutionStore(key: String): JsonNode { return resourceStore[key] - ?: throw BlueprintProcessorException("failed to get execution property ($key)") + ?: throw BluePrintProcessorException("failed to get execution property ($key)") } fun checkResolutionStore(key: String): Boolean { @@ -62,7 +62,7 @@ class ResourceAssignmentRuntimeService(private var id: String, private var blueP fun getDictionaryStore(key: String): JsonNode { return resourceStore["dictionary-$key"] - ?: throw BlueprintProcessorException("failed to get execution property (dictionary-$key)") + ?: throw BluePrintProcessorException("failed to get execution property (dictionary-$key)") } fun checkDictionaryStore(key: String): Boolean { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt index 66077c4ed..c755e89bf 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertyDefinitionBuilder @@ -24,12 +24,12 @@ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition /** Resource Definition DSL **/ -fun BlueprintTypes.resourceDefinitions(block: ResourceDefinitionsBuilder.() -> Unit): +fun BluePrintTypes.resourceDefinitions(block: ResourceDefinitionsBuilder.() -> Unit): MutableMap<String, ResourceDefinition> { return ResourceDefinitionsBuilder().apply(block).build() } -fun BlueprintTypes.resourceDefinition( +fun BluePrintTypes.resourceDefinition( name: String, description: String, block: ResourceDefinitionBuilder.() -> Unit @@ -38,12 +38,12 @@ fun BlueprintTypes.resourceDefinition( } /** Resource Mapping DSL **/ -fun BlueprintTypes.resourceAssignments(block: ResourceAssignmentsBuilder.() -> Unit): +fun BluePrintTypes.resourceAssignments(block: ResourceAssignmentsBuilder.() -> Unit): MutableMap<String, ResourceAssignment> { return ResourceAssignmentsBuilder().apply(block).build() } -fun BlueprintTypes.resourceAssignment( +fun BluePrintTypes.resourceAssignment( name: String, dictionaryName: String, dictionarySource: String, diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt index ada1a720e..0435d1d2c 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt @@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.asObjectNode import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing @@ -94,11 +94,11 @@ open class ResourceResolutionComponent(private val resourceResolutionService: Re // validate inputs if we need to store the resource and template resolution. if (storeResult) { if (resolutionKey.isNotEmpty() && (resourceId.isNotEmpty() || resourceType.isNotEmpty())) { - throw BlueprintProcessorException("Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.") + throw BluePrintProcessorException("Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.") } else if ((resourceType.isNotEmpty() && resourceId.isEmpty()) || (resourceType.isEmpty() && resourceId.isNotEmpty())) { - throw BlueprintProcessorException("Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.") + throw BluePrintProcessorException("Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.") } else if (resourceType.isEmpty() && resourceId.isEmpty() && resolutionKey.isEmpty()) { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Can't proceed with the resolution: can't persist resolution without a correlation key. " + "Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false." ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt index c8b9e2c87..774873a43 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType @@ -33,94 +33,94 @@ import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType /** Component Extensions **/ fun ServiceTemplateBuilder.nodeTypeComponentResourceResolution() { - val nodeType = BlueprintTypes.nodeTypeComponentResourceResolution() + val nodeType = BluePrintTypes.nodeTypeComponentResourceResolution() if (this.nodeTypes == null) this.nodeTypes = hashMapOf() this.nodeTypes!![nodeType.id!!] = nodeType } -fun BlueprintTypes.nodeTypeComponentResourceResolution(): NodeType { +fun BluePrintTypes.nodeTypeComponentResourceResolution(): NodeType { return nodeType( - id = "component-resource-resolution", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_COMPONENT, + id = "component-resource-resolution", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, description = "Resource Assignment Component" ) { attribute( - ResourceResolutionComponent.ATTRIBUTE_ASSIGNMENT_PARAM, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.ATTRIBUTE_ASSIGNMENT_PARAM, BluePrintConstants.DATA_TYPE_STRING, true ) attribute( - ResourceResolutionComponent.ATTRIBUTE_STATUS, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.ATTRIBUTE_STATUS, BluePrintConstants.DATA_TYPE_STRING, true ) operation("ResourceResolutionComponent", "ResourceResolutionComponent Operation") { inputs { property( - ResourceResolutionComponent.INPUT_REQUEST_ID, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.INPUT_REQUEST_ID, BluePrintConstants.DATA_TYPE_STRING, true, "Request Id, Unique Id for the request." ) property( - ResourceResolutionComponent.INPUT_RESOURCE_ID, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.INPUT_RESOURCE_ID, BluePrintConstants.DATA_TYPE_STRING, false, "Resource Id." ) property( - ResourceResolutionComponent.INPUT_ACTION_NAME, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.INPUT_ACTION_NAME, BluePrintConstants.DATA_TYPE_STRING, false, "Action Name of the process" ) property( - ResourceResolutionComponent.INPUT_DYNAMIC_PROPERTIES, BlueprintConstants.DATA_TYPE_JSON, + ResourceResolutionComponent.INPUT_DYNAMIC_PROPERTIES, BluePrintConstants.DATA_TYPE_JSON, false, "Dynamic Json Content or DSL Json reference." ) property( - ResourceResolutionComponent.INPUT_RESOLUTION_KEY, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.INPUT_RESOLUTION_KEY, BluePrintConstants.DATA_TYPE_STRING, false, "Key for service instance related correlation." ) property( - ResourceResolutionComponent.INPUT_RESOLUTION_SUMMARY, BlueprintConstants.DATA_TYPE_BOOLEAN, + ResourceResolutionComponent.INPUT_RESOLUTION_SUMMARY, BluePrintConstants.DATA_TYPE_BOOLEAN, false, "Enables ResolutionSummary output" ) property( - ResourceResolutionComponent.INPUT_OCCURRENCE, BlueprintConstants.DATA_TYPE_INTEGER, + ResourceResolutionComponent.INPUT_OCCURRENCE, BluePrintConstants.DATA_TYPE_INTEGER, false, "Number of time to perform the resolution." ) { defaultValue(1) } property( - ResourceResolutionComponent.INPUT_STORE_RESULT, BlueprintConstants.DATA_TYPE_BOOLEAN, + ResourceResolutionComponent.INPUT_STORE_RESULT, BluePrintConstants.DATA_TYPE_BOOLEAN, false, "Whether or not to store the output." ) property( - ResourceResolutionComponent.INPUT_RESOURCE_TYPE, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.INPUT_RESOURCE_TYPE, BluePrintConstants.DATA_TYPE_STRING, false, "Request type." ) property( - ResourceResolutionComponent.INPUT_ARTIFACT_PREFIX_NAMES, BlueprintConstants.DATA_TYPE_LIST, + ResourceResolutionComponent.INPUT_ARTIFACT_PREFIX_NAMES, BluePrintConstants.DATA_TYPE_LIST, true, "Template , Resource Assignment Artifact Prefix names" ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } } outputs { property( - ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_PARAMS, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_PARAMS, BluePrintConstants.DATA_TYPE_STRING, true, "Output Response" ) property( - ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_MAP, BlueprintConstants.DATA_TYPE_MAP, + ResourceResolutionComponent.OUTPUT_RESOURCE_ASSIGNMENT_MAP, BluePrintConstants.DATA_TYPE_MAP, true, "Output Resolved Values" ) property( - ResourceResolutionComponent.OUTPUT_STATUS, BlueprintConstants.DATA_TYPE_STRING, + ResourceResolutionComponent.OUTPUT_STATUS, BluePrintConstants.DATA_TYPE_STRING, true, "Status of the Component Execution ( success or failure )" ) } @@ -134,7 +134,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentResourceResolution( description: String, block: ComponentResourceResolutionNodeTemplateBuilder.() -> Unit ) { - val nodeTemplate = BlueprintTypes.nodeTemplateComponentResourceResolution( + val nodeTemplate = BluePrintTypes.nodeTemplateComponentResourceResolution( id, description, block ) @@ -142,7 +142,7 @@ fun TopologyTemplateBuilder.nodeTemplateComponentResourceResolution( nodeTemplates!![nodeTemplate.id!!] = nodeTemplate } -fun BlueprintTypes.nodeTemplateComponentResourceResolution( +fun BluePrintTypes.nodeTemplateComponentResourceResolution( id: String, description: String, block: ComponentResourceResolutionNodeTemplateBuilder.() -> Unit diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt index a3cc1ef18..4774ad57a 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionExtensions.kt @@ -20,22 +20,22 @@ import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolution import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolutionDBService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService /** * Register the Resolution module exposed dependency */ -fun BlueprintDependencyService.resourceResolutionService(): ResourceResolutionService = +fun BluePrintDependencyService.resourceResolutionService(): ResourceResolutionService = instance(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION) -fun BlueprintDependencyService.resourceResolutionDBService(): ResourceResolutionDBService = +fun BluePrintDependencyService.resourceResolutionDBService(): ResourceResolutionDBService = instance(ResourceResolutionDBService::class.java) suspend fun AbstractComponentFunction.storedContentFromResolvedArtifactNB( resolutionKey: String, artifactName: String ): String { - return BlueprintDependencyService.resourceResolutionService() + return BluePrintDependencyService.resourceResolutionService() .resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey) } @@ -44,7 +44,7 @@ suspend fun AbstractComponentFunction.storedResourceResolutionsNB( artifactName: String, occurrence: Int = 1 ): List<ResourceResolution> { - return BlueprintDependencyService.resourceResolutionDBService() + return BluePrintDependencyService.resourceResolutionDBService() .findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence( bluePrintRuntimeService, resolutionKey, @@ -57,7 +57,7 @@ suspend fun AbstractComponentFunction.storedResourceResolutionsNB( * Return resolved and mashed artifact content for artifact prefix [artifactPrefix] */ suspend fun AbstractComponentFunction.contentFromResolvedArtifactNB(artifactPrefix: String): String { - return BlueprintDependencyService.resourceResolutionService() + return BluePrintDependencyService.resourceResolutionService() .resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactPrefix, mapOf()) .first } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index ea420dca4..6b4260ad0 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -27,15 +27,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.T import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceDefinitionUtils.createResourceAssignments -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.common.ApplicationConstants.LOG_REDACTED -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -56,13 +56,13 @@ interface ResourceResolutionService { fun registeredResourceSources(): List<String> suspend fun resolveFromDatabase( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, artifactTemplate: String, resolutionKey: String ): String suspend fun resolveResources( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactNames: List<String>, properties: Map<String, Any>, @@ -70,7 +70,7 @@ interface ResourceResolutionService { ): ResourceResolutionResult suspend fun resolveResources( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactPrefix: String, properties: Map<String, Any> @@ -80,7 +80,7 @@ interface ResourceResolutionService { * with other [resourceDefinitions] dependencies for the sources [sources] * Used to get the same resource values from multiple sources. **/ suspend fun resolveResourceDefinition( - blueprintRuntimeService: BlueprintRuntimeService<*>, + blueprintRuntimeService: BluePrintRuntimeService<*>, resourceDefinitions: MutableMap<String, ResourceDefinition>, resolveDefinition: String, sources: List<String> @@ -88,7 +88,7 @@ interface ResourceResolutionService { MutableMap<String, JsonNode> suspend fun resolveResourceAssignments( - blueprintRuntimeService: BlueprintRuntimeService<*>, + blueprintRuntimeService: BluePrintRuntimeService<*>, resourceDefinitions: MutableMap<String, ResourceDefinition>, resourceAssignments: MutableList<ResourceAssignment>, artifactPrefix: String, @@ -100,7 +100,7 @@ interface ResourceResolutionService { open class ResourceResolutionServiceImpl( private var applicationContext: ApplicationContext, private var templateResolutionDBService: TemplateResolutionService, - private var blueprintTemplateService: BlueprintTemplateService, + private var blueprintTemplateService: BluePrintTemplateService, private var resourceResolutionDBService: ResourceResolutionDBService ) : ResourceResolutionService { @@ -114,7 +114,7 @@ open class ResourceResolutionServiceImpl( } override suspend fun resolveFromDatabase( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, artifactTemplate: String, resolutionKey: String ): String { @@ -126,7 +126,7 @@ open class ResourceResolutionServiceImpl( } override suspend fun resolveResources( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactNames: List<String>, properties: Map<String, Any>, @@ -153,16 +153,16 @@ open class ResourceResolutionServiceImpl( val failedResolution = resourceAssignmentList.filter { it.status != "success" && it.property?.required == true }.map { it.name } if (failedResolution.isNotEmpty()) { val errorMessages = mutableListOf("Failed to resolve required values: $failedResolution").apply { - this.addAll(resourceAssignmentRuntimeService.getBlueprintError().allErrors()) + this.addAll(resourceAssignmentRuntimeService.getBluePrintError().allErrors()) } - bluePrintRuntimeService.getBlueprintError().addErrors(stepName, errorMessages) + bluePrintRuntimeService.getBluePrintError().addErrors(stepName, errorMessages) } } return ResourceResolutionResult(templateMap, assignmentMap) } override suspend fun resolveResources( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactPrefix: String, properties: Map<String, Any> @@ -181,7 +181,7 @@ open class ResourceResolutionServiceImpl( val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment::class.java) as? MutableList<ResourceAssignment> - ?: throw BlueprintProcessorException("couldn't get Dictionary Definitions") + ?: throw BluePrintProcessorException("couldn't get Dictionary Definitions") if (isToStore(properties)) { val existingResourceResolution = isNewResolution(bluePrintRuntimeService, properties, artifactPrefix) @@ -245,7 +245,7 @@ open class ResourceResolutionServiceImpl( } override suspend fun resolveResourceDefinition( - blueprintRuntimeService: BlueprintRuntimeService<*>, + blueprintRuntimeService: BluePrintRuntimeService<*>, resourceDefinitions: MutableMap<String, ResourceDefinition>, resolveDefinition: String, sources: List<String> @@ -269,7 +269,7 @@ open class ResourceResolutionServiceImpl( * request. */ override suspend fun resolveResourceAssignments( - blueprintRuntimeService: BlueprintRuntimeService<*>, + blueprintRuntimeService: BluePrintRuntimeService<*>, resourceDefinitions: MutableMap<String, ResourceDefinition>, resourceAssignments: MutableList<ResourceAssignment>, artifactPrefix: String, @@ -292,7 +292,7 @@ open class ResourceResolutionServiceImpl( // Execute Non Dependent Assignments in parallel ( ie asynchronously ) val deferred = batchResourceAssignments .filter { it.name != "*" && it.name != "start" } - .filter { it.status != BlueprintConstants.STATUS_SUCCESS } + .filter { it.status != BluePrintConstants.STATUS_SUCCESS } .map { resourceAssignment -> async { val dictionaryName = resourceAssignment.dictionaryName @@ -302,12 +302,12 @@ open class ResourceResolutionServiceImpl( val resourceAssignmentProcessor = applicationContext.getBean(processorName) as? ResourceAssignmentProcessor - ?: throw BlueprintProcessorException( + ?: throw BluePrintProcessorException( "failed to get resource processor ($processorName) " + "for resource assignment(${resourceAssignment.name})" ) try { - // Set Blueprint Runtime Service + // Set BluePrint Runtime Service resourceAssignmentProcessor.raRuntimeService = resourceAssignmentRuntimeService // Set Resource Dictionaries resourceAssignmentProcessor.resourceDictionaries = resourceDefinitions @@ -328,10 +328,10 @@ open class ResourceResolutionServiceImpl( } // Set errors from RA - blueprintRuntimeService.setBlueprintError(resourceAssignmentRuntimeService.getBlueprintError()) + blueprintRuntimeService.setBluePrintError(resourceAssignmentRuntimeService.getBluePrintError()) } catch (e: RuntimeException) { log.error("Fail in processing ${resourceAssignment.name}", e) - throw BlueprintProcessorException(e) + throw BluePrintProcessorException(e) } } } @@ -359,10 +359,10 @@ open class ResourceResolutionServiceImpl( } else -> { val resourceDefinition = resourceDefinitions[dictionaryName] - ?: throw BlueprintProcessorException("couldn't get resource dictionary definition for $dictionaryName") + ?: throw BluePrintProcessorException("couldn't get resource dictionary definition for $dictionaryName") val resourceSource = resourceDefinition.sources[dictionarySource] - ?: throw BlueprintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dictionaryName source($dictionarySource)") ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR.plus(resourceSource.type) } @@ -382,7 +382,7 @@ open class ResourceResolutionServiceImpl( // Check whether resolution already exist in the database for the specified resolution-key or resourceId/resourceType private suspend fun isNewResolution( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, properties: Map<String, Any>, artifactPrefix: String ): List<ResourceResolution> { @@ -434,7 +434,7 @@ open class ResourceResolutionServiceImpl( resourceAssignmentList: MutableList<ResourceAssignment> ) { resourceResolutionList.forEach { resourceResolution -> - if (resourceResolution.status == BlueprintConstants.STATUS_SUCCESS) { + if (resourceResolution.status == BluePrintConstants.STATUS_SUCCESS) { resourceAssignmentList.forEach { if (compareOne(resourceResolution, it)) { log.info( diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt index a681b4f68..62ec2bdf4 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt @@ -18,8 +18,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType @@ -30,30 +30,30 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuil import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeType import kotlin.reflect.KClass -fun BlueprintTypes.nodeTypeSourceInput(): NodeType { +fun BluePrintTypes.nodeTypeSourceInput(): NodeType { return nodeType( - id = "source-input", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, + id = "source-input", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, description = "This is Input Resource Source Node Type" ) {} } -fun BlueprintTypes.nodeTypeSourceDefault(): NodeType { +fun BluePrintTypes.nodeTypeSourceDefault(): NodeType { return nodeType( - id = "source-default", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, + id = "source-default", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, description = "This is Default Resource Source Node Type" ) {} } -fun BlueprintTypes.nodeTypeSourceDb(): NodeType { +fun BluePrintTypes.nodeTypeSourceDb(): NodeType { return nodeType( - id = "source-db", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, + id = "source-db", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, description = "This is Database Resource Source Node Type" ) { property( - "type", BlueprintConstants.DATA_TYPE_STRING, + "type", BluePrintConstants.DATA_TYPE_STRING, true, "" ) { defaultValue("SQL".asJsonPrimitive()) @@ -62,42 +62,42 @@ fun BlueprintTypes.nodeTypeSourceDb(): NodeType { } } property( - "endpoint-selector", BlueprintConstants.DATA_TYPE_STRING, + "endpoint-selector", BluePrintConstants.DATA_TYPE_STRING, false, "" ) property( - "query", BlueprintConstants.DATA_TYPE_STRING, + "query", BluePrintConstants.DATA_TYPE_STRING, true, "" ) property( - "input-key-mapping", BlueprintConstants.DATA_TYPE_MAP, + "input-key-mapping", BluePrintConstants.DATA_TYPE_MAP, true, "" ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } property( - "output-key-mapping", BlueprintConstants.DATA_TYPE_MAP, + "output-key-mapping", BluePrintConstants.DATA_TYPE_MAP, false, "" ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } property( - "key-dependencies", BlueprintConstants.DATA_TYPE_LIST, + "key-dependencies", BluePrintConstants.DATA_TYPE_LIST, true, "Resource Resolution dependency dictionary names." ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } } } -fun BlueprintTypes.nodeTypeSourceRest(): NodeType { +fun BluePrintTypes.nodeTypeSourceRest(): NodeType { return nodeType( - id = "source-rest", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, + id = "source-rest", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, description = "This is Rest Resource Source Node Type" ) { property( - "type", BlueprintConstants.DATA_TYPE_STRING, + "type", BluePrintConstants.DATA_TYPE_STRING, true, "" ) { defaultValue("JSON".asJsonPrimitive()) @@ -106,7 +106,7 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType { } } property( - "verb", BlueprintConstants.DATA_TYPE_STRING, + "verb", BluePrintConstants.DATA_TYPE_STRING, true, "" ) { defaultValue("GET".asJsonPrimitive()) @@ -120,25 +120,25 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType { } } property( - "payload", BlueprintConstants.DATA_TYPE_STRING, + "payload", BluePrintConstants.DATA_TYPE_STRING, false, "" ) { defaultValue("".asJsonPrimitive()) } property( - "endpoint-selector", BlueprintConstants.DATA_TYPE_STRING, + "endpoint-selector", BluePrintConstants.DATA_TYPE_STRING, false, "" ) property( - "url-path", BlueprintConstants.DATA_TYPE_STRING, + "url-path", BluePrintConstants.DATA_TYPE_STRING, true, "" ) property( - "path", BlueprintConstants.DATA_TYPE_STRING, + "path", BluePrintConstants.DATA_TYPE_STRING, true, "" ) property( - "expression-type", BlueprintConstants.DATA_TYPE_STRING, + "expression-type", BluePrintConstants.DATA_TYPE_STRING, false, "" ) { defaultValue("JSON_PATH".asJsonPrimitive()) @@ -147,62 +147,62 @@ fun BlueprintTypes.nodeTypeSourceRest(): NodeType { } } property( - "input-key-mapping", BlueprintConstants.DATA_TYPE_MAP, + "input-key-mapping", BluePrintConstants.DATA_TYPE_MAP, true, "" ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } property( - "output-key-mapping", BlueprintConstants.DATA_TYPE_MAP, + "output-key-mapping", BluePrintConstants.DATA_TYPE_MAP, false, "" ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } property( - "key-dependencies", BlueprintConstants.DATA_TYPE_LIST, + "key-dependencies", BluePrintConstants.DATA_TYPE_LIST, true, "Resource Resolution dependency dictionary names." ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } } } -fun BlueprintTypes.nodeTypeSourceCapability(): NodeType { +fun BluePrintTypes.nodeTypeSourceCapability(): NodeType { return nodeType( - id = "source-capability", version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, + id = "source-capability", version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE, description = "This is Component Resource Source Node Type" ) { property( - ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BlueprintConstants.DATA_TYPE_STRING, + ComponentScriptExecutor.INPUT_SCRIPT_TYPE, BluePrintConstants.DATA_TYPE_STRING, true, "Request Id, Unique Id for the request." ) { - defaultValue(BlueprintConstants.SCRIPT_KOTLIN) + defaultValue(BluePrintConstants.SCRIPT_KOTLIN) constrain { validValues( arrayListOf( - BlueprintConstants.SCRIPT_KOTLIN.asJsonPrimitive(), - BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive(), - BlueprintConstants.SCRIPT_JYTHON.asJsonPrimitive() + BluePrintConstants.SCRIPT_KOTLIN.asJsonPrimitive(), + BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive(), + BluePrintConstants.SCRIPT_JYTHON.asJsonPrimitive() ) ) } } property( - ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, BlueprintConstants.DATA_TYPE_STRING, + ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE, BluePrintConstants.DATA_TYPE_STRING, true, "Kotlin Script class name or jython script name." ) property( - "key-dependencies", BlueprintConstants.DATA_TYPE_LIST, + "key-dependencies", BluePrintConstants.DATA_TYPE_LIST, true, "Resource Resolution dependency dictionary names." ) { - entrySchema(BlueprintConstants.DATA_TYPE_STRING) + entrySchema(BluePrintConstants.DATA_TYPE_STRING) } } } /** Node Template Source Input **/ -fun BlueprintTypes.nodeTemplateSourceInput( +fun BluePrintTypes.nodeTemplateSourceInput( id: String, description: String, block: SourceInputNodeTemplateBuilder.() -> Unit @@ -217,7 +217,7 @@ class SourceInputNodeTemplateBuilder(id: String, description: String) : ) /** Node Template Source Default **/ -fun BlueprintTypes.nodeTemplateSourceDefault( +fun BluePrintTypes.nodeTemplateSourceDefault( id: String, description: String, block: SourceDefaultNodeTemplateBuilder.() -> Unit @@ -232,7 +232,7 @@ class SourceDefaultNodeTemplateBuilder(id: String, description: String) : ) /** Node Template Source DB **/ -fun BlueprintTypes.nodeTemplateSourceDb( +fun BluePrintTypes.nodeTemplateSourceDb( id: String, description: String, block: SourceDbNodeTemplateBuilder.() -> Unit @@ -299,7 +299,7 @@ class KeyMappingBuilder() { } /** Node Template Source Rest **/ -fun BlueprintTypes.nodeTemplateSourceRest( +fun BluePrintTypes.nodeTemplateSourceRest( id: String, description: String, block: SourceRestNodeTemplateBuilder.() -> Unit @@ -378,7 +378,7 @@ class SourceRestNodeTemplateBuilder(id: String, description: String) : } /** Node Template Source Rest **/ -fun BlueprintTypes.nodeTemplateSourceCapability( +fun BluePrintTypes.nodeTemplateSourceCapability( id: String, description: String, block: SourceCapabilityNodeTemplateBuilder.() -> Unit diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt index a1f3249ab..71cf6ceea 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapability.kt @@ -20,10 +20,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.rest.restClientService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -51,7 +51,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() { /** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") val resourceSourceProperties = checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " } @@ -81,7 +81,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() { resourceSourceProperties["resolved-payload"] = JacksonUtils.jsonNode(generatedPayload) // Get the Rest Client service, selector will be included in application.properties - val restClientService = BlueprintDependencyService.restClientService( + val restClientService = BluePrintDependencyService.restClientService( "ipassign-ms" ) @@ -100,7 +100,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() { "Failed to dictionary name ($dName), dictionary source($($dName) " + "response_code: ($responseStatusCode)" log.warn(errMsg) - throw BlueprintProcessorException(errMsg) + throw BluePrintProcessorException(errMsg) } // Parse the error Body and assign the property value } @@ -108,7 +108,7 @@ open class IpAssignResolutionCapability : ResourceAssignmentProcessor() { ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Failed in template key ($resourceAssignment) assignments with: ${e.message}", e ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt index 4f656a8f0..139d8232f 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapability.kt @@ -20,10 +20,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.rest.restClientService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -51,7 +51,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() { /** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") val resourceSourceProperties = checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " } @@ -82,7 +82,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() { resourceSourceProperties["resolved-payload"] = JacksonUtils.jsonNode(generatedPayload) // Get the Rest Client service, selector will be included in application.properties - val restClientService = BlueprintDependencyService.restClientService( + val restClientService = BluePrintDependencyService.restClientService( "naming-ms" ) @@ -102,7 +102,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() { "Failed to dictionary name ($dName), dictionary source($($dName) " + "response_code: ($responseStatusCode)" log.warn(errMsg) - throw BlueprintProcessorException(errMsg) + throw BluePrintProcessorException(errMsg) } // Parse the error Body and assign the property value } @@ -110,7 +110,7 @@ open class NamingResolutionCapability : ResourceAssignmentProcessor() { ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Failed in template key ($resourceAssignment) assignments with: ${e.message}", e ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt index 592408b67..5958c7899 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBService.kt @@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory @@ -34,7 +34,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso private val log = LoggerFactory.getLogger(ResourceResolutionDBService::class.toString()) suspend fun findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, key: String, occurrence: Int, artifactPrefix: String @@ -42,8 +42,8 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso return try { val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!! - val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!! + val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!! + val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!! resourceResolutionRepository.findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKeyAndOccurrence( blueprintName, @@ -58,7 +58,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso } suspend fun findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResourceIdAndResourceTypeAndOccurrence( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, resourceId: String, resourceType: String, occurrence: Int, @@ -68,8 +68,8 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!! - val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!! + val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!! + val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!! resourceResolutionRepository.findByBlueprintNameAndBlueprintVersionAndArtifactNameAndResourceIdAndResourceTypeAndOccurrence( blueprintName, @@ -134,15 +134,15 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso suspend fun write( properties: Map<String, Any>, - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, artifactPrefix: String, resourceAssignment: ResourceAssignment ): ResourceResolution = withContext(Dispatchers.IO) { val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!! - val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!! + val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!! + val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!! val resolutionKey = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] as String val resourceId = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] as String @@ -182,7 +182,7 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso resourceResolution.resourceType = resourceType resourceResolution.resourceId = resourceId resourceResolution.value = resourceAssignment.property?.value?.let { - if (BlueprintConstants.STATUS_SUCCESS == resourceAssignment.status) + if (BluePrintConstants.STATUS_SUCCESS == resourceAssignment.status) JacksonUtils.getValue(it).toString() else "" } ?: "" @@ -190,12 +190,12 @@ class ResourceResolutionDBService(private val resourceResolutionRepository: Reso resourceResolution.dictionaryName = resourceAssignment.dictionaryName resourceResolution.dictionaryVersion = resourceAssignment.version resourceResolution.dictionarySource = resourceAssignment.dictionarySource - resourceResolution.status = resourceAssignment.status ?: BlueprintConstants.STATUS_FAILURE + resourceResolution.status = resourceAssignment.status ?: BluePrintConstants.STATUS_FAILURE try { resourceResolutionRepository.saveAndFlush(resourceResolution) } catch (ex: Exception) { - throw BlueprintException("Failed to store resource resolution result.", ex) + throw BluePrintException("Failed to store resource resolution result.", ex) } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt index cbd8b8310..4bdd5d985 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionService.kt @@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.slf4j.LoggerFactory import org.springframework.dao.DataIntegrityViolationException import org.springframework.dao.EmptyResultDataAccessException @@ -33,7 +33,7 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa private val log = LoggerFactory.getLogger(TemplateResolutionService::class.toString()) suspend fun findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, artifactPrefix: String, resolutionKey: String ): String = @@ -41,8 +41,8 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!! - val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!! + val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!! + val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!! findByResolutionKeyAndBlueprintNameAndBlueprintVersionAndArtifactName( blueprintName, @@ -93,14 +93,14 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa suspend fun write( properties: Map<String, Any>, result: String, - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, artifactPrefix: String ): TemplateResolution = withContext(Dispatchers.IO) { val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - val blueprintVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION]!! - val blueprintName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME]!! + val blueprintVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]!! + val blueprintName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]!! val resolutionKey = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] as String val resourceId = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] as String val resourceType = properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_TYPE] as String @@ -187,7 +187,7 @@ class TemplateResolutionService(private val templateResolutionRepository: Templa " (resourceId: $resourceId resourceType: $resourceType) occurrence:$occurrence error: {}", ex.message ) - throw BlueprintException("Failed to store resource api result.", ex) + throw BluePrintException("Failed to store resource api result.", ex) } } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt index 5e834d73d..9f318a314 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt @@ -22,7 +22,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Capa import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory @@ -53,7 +53,7 @@ open class CapabilityResourceResolutionProcessor(private var componentFunctionSc /** Check Resource Assignment has the source definitions, If not get from Resource Definition **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") val resourceSourceProps = checkNotNull(resourceSource.properties) { "failed to get $resourceSource properties" } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt index 114b5b889..98df3f1cf 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt @@ -17,14 +17,14 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService -import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BlueprintDBLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty @@ -47,7 +47,7 @@ import java.util.HashMap @Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-db") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) open class DatabaseResourceAssignmentProcessor( - private val bluePrintDBLibPropertyService: BlueprintDBLibPropertyService, + private val bluePrintDBLibPropertyService: BluePrintDBLibPropertyService, private val primaryDBLibGenericService: PrimaryDBLibGenericService ) : ResourceAssignmentProcessor() { @@ -66,7 +66,7 @@ open class DatabaseResourceAssignmentProcessor( } // Check the value has populated for mandatory case ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to process Database resource resolution in template key ($resourceAssignment) assignments." throw e.updateErrorMessage( ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg, @@ -74,7 +74,7 @@ open class DatabaseResourceAssignmentProcessor( ) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) + throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) } } @@ -86,7 +86,7 @@ open class DatabaseResourceAssignmentProcessor( /** Check Resource Assignment has the source definitions, If not get from Resource Definition **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") val resourceSourceProperties = checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " } @@ -119,7 +119,7 @@ open class DatabaseResourceAssignmentProcessor( populateResource(resourceAssignment, sourceProperties, rows) } - private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BlueprintDBLibGenericService { + private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BluePrintDBLibGenericService { return if (isNotEmpty(sourceProperties.endpointSelector)) { val dbPropertiesJson = raRuntimeService.resolveDSLExpression(sourceProperties.endpointSelector!!) bluePrintDBLibPropertyService.JdbcTemplate(dbPropertiesJson) @@ -128,7 +128,7 @@ open class DatabaseResourceAssignmentProcessor( } } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) private fun validate(resourceAssignment: ResourceAssignment) { checkNotEmpty(resourceAssignment.name) { "resource assignment template key is not defined" } checkNotEmpty(resourceAssignment.dictionaryName) { @@ -156,7 +156,7 @@ open class DatabaseResourceAssignmentProcessor( return namedParameters } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) private fun populateResource( resourceAssignment: ResourceAssignment, sourceProperties: DatabaseResourceSource, diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt index e904ebcb4..9e5bd08cd 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessor.kt @@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory @@ -51,7 +51,7 @@ open class DefaultResourceResolutionProcessor : ResourceAssignmentProcessor() { } // Check the value has populated for mandatory case ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to process default resource resolution in template key ($resourceAssignment) assignments." throw e.updateErrorMessage( ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg, @@ -59,7 +59,7 @@ open class DefaultResourceResolutionProcessor : ResourceAssignmentProcessor() { ) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) + throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt index c3add86fd..caf6b6acb 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessor.kt @@ -20,7 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -52,13 +52,13 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() { } // Check the value has populated for mandatory case ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to process input resource resolution in template key ($resourceAssignment) assignments." ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) logger.error(errorMsg) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with : (${e.message})", e) + throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with : (${e.message})", e) } } @@ -71,7 +71,7 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() { /** Check Resource Assignment has the source definitions, If not get from Resource Definition **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") try { val resourceSourceProperties = checkNotNull(resourceSource.properties) { @@ -86,7 +86,7 @@ open class InputResourceResolutionProcessor : ResourceAssignmentProcessor() { // keyDependency = service-instance.service-instance-id setFromInputKeyDependencies(keyDependency, resourceAssignment); // New API which picks attribute from Input } catch (e: IllegalStateException) { - throw BlueprintProcessorException(e) + throw BluePrintProcessorException(e) } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt index ce00ac17b..c075e1b4d 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt @@ -22,13 +22,13 @@ import com.fasterxml.jackson.databind.JsonNode import org.apache.commons.collections.MapUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode import org.onap.ccsdk.cds.controllerblueprints.core.isNullOrMissing -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.slf4j.LoggerFactory @@ -50,7 +50,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig */ open fun <T> scriptPropertyInstanceType(name: String): T { return scriptPropertyInstances as? T - ?: throw BlueprintProcessorException("couldn't get script property instance ($name)") + ?: throw BluePrintProcessorException("couldn't get script property instance ($name)") } open fun setFromInput(resourceAssignment: ResourceAssignment): Boolean { @@ -64,7 +64,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, value) return true } - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { // NoOp - couldn't find value from input } return false @@ -83,7 +83,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig return true } } - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { // NoOp - couldn't find value from input } return false @@ -110,7 +110,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig return valueToResolve } // TODO("Optimize to JSON Node directly without velocity").asJsonNode().toString() - return BlueprintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString()) + return BluePrintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString()) } final override suspend fun applyNB(resourceAssignment: ResourceAssignment): Boolean { @@ -126,7 +126,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig suspend fun executeScript(resourceAssignment: ResourceAssignment) { return when (scriptType) { - BlueprintConstants.SCRIPT_JYTHON -> { + BluePrintConstants.SCRIPT_JYTHON -> { executeScriptBlocking(resourceAssignment) } else -> { @@ -163,39 +163,39 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig */ final override fun apply(resourceAssignment: ResourceAssignment): Boolean { - throw BlueprintException("Not Implemented, use applyNB method") + throw BluePrintException("Not Implemented, use applyNB method") } final override fun prepareRequest(resourceAssignment: ResourceAssignment): ResourceAssignment { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } final override fun prepareResponse(): Boolean { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } final override suspend fun prepareRequestNB(resourceAssignment: ResourceAssignment): ResourceAssignment { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } final override suspend fun prepareResponseNB(): Boolean { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } override fun process(resourceAssignment: ResourceAssignment) { - throw BlueprintException("Not Implemented, child class will implement this") + throw BluePrintException("Not Implemented, child class will implement this") } override fun recover(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) { - throw BlueprintException("Not Implemented, child class will implement this") + throw BluePrintException("Not Implemented, child class will implement this") } fun addError(type: String, name: String, error: String) { - raRuntimeService.getBlueprintError().addError(type, name, error, getName()) + raRuntimeService.getBluePrintError().addError(type, name, error, getName()) } fun addError(error: String) { - raRuntimeService.getBlueprintError().addError(error, getName()) + raRuntimeService.getBluePrintError().addError(error, getName()) } fun isTemplateKeyValueNull(resourceAssignment: ResourceAssignment): Boolean { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt index c17e14000..b81455c83 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt @@ -20,11 +20,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty @@ -44,7 +44,7 @@ import org.springframework.stereotype.Service */ @Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-rest") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyService: BlueprintRestLibPropertyService) : +open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyService: BluePrintRestLibPropertyService) : ResourceAssignmentProcessor() { private val logger = LoggerFactory.getLogger(RestResourceResolutionProcessor::class.java) @@ -66,7 +66,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS /** Check Resource Assignment has the source definitions, If not get from Resource Definitions **/ val resourceSource = resourceAssignment.dictionarySourceDefinition ?: resourceDefinition?.sources?.get(dSource) - ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)") + ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)") val resourceSourceProperties = checkNotNull(resourceSource.properties) { "failed to get source properties for $dName " } @@ -104,7 +104,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS val responseBody = response.body val outputKeyMapping = sourceProperties.outputKeyMapping if (responseStatusCode in 200..299 && outputKeyMapping.isNullOrEmpty()) { - resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS + resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS logger.info("AS>> outputKeyMapping==null, will not populateResource") } else if (responseStatusCode in 200..299 && !responseBody.isBlank()) { populateResource(resourceAssignment, sourceProperties, responseBody, path) @@ -112,12 +112,12 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS val errMsg = "Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath) response_code: ($responseStatusCode)" logger.warn(errMsg) - throw BlueprintProcessorException(errMsg) + throw BluePrintProcessorException(errMsg) } } // Check the value has populated for mandatory case ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to process REST resource resolution in template key ($resourceAssignment) assignments." ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, errorMsg) throw e.updateErrorMessage( @@ -126,7 +126,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS ) } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message) - throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) + throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e) } } @@ -142,7 +142,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS } } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) private fun populateResource( resourceAssignment: ResourceAssignment, sourceProperties: RestResourceSource, @@ -175,7 +175,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, parsedResponseNode) } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) private fun validate(resourceAssignment: ResourceAssignment) { checkNotEmpty(resourceAssignment.name) { "resource assignment template key is not defined" } checkNotEmpty(resourceAssignment.dictionaryName) { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt index 5a03450ed..7ab3126bb 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt @@ -26,9 +26,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode import com.fasterxml.jackson.databind.node.TextNode import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.checkFileExists import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty @@ -39,8 +39,8 @@ import org.onap.ccsdk.cds.controllerblueprints.core.isNullOrMissing import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.rootFieldsToMap -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect @@ -59,14 +59,14 @@ class ResourceAssignmentUtils { suspend fun resourceDefinitions(blueprintBasePath: String): MutableMap<String, ResourceDefinition> { val dictionaryFile = normalizedFile( - blueprintBasePath, BlueprintConstants.TOSCA_DEFINITIONS_DIR, + blueprintBasePath, BluePrintConstants.TOSCA_DEFINITIONS_DIR, ResourceResolutionConstants.FILE_NAME_RESOURCE_DEFINITION_TYPES ) checkFileExists(dictionaryFile) { "resource definition file(${dictionaryFile.absolutePath}) is missing" } return JacksonReactorUtils.getMapFromFile(dictionaryFile, ResourceDefinition::class.java) } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun setResourceDataValue( resourceAssignment: ResourceAssignment, raRuntimeService: ResourceAssignmentRuntimeService, @@ -76,7 +76,7 @@ class ResourceAssignmentUtils { return setResourceDataValue(resourceAssignment, raRuntimeService, value.asJsonType()) } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun setResourceDataValue( resourceAssignment: ResourceAssignment, raRuntimeService: ResourceAssignmentRuntimeService, @@ -108,11 +108,11 @@ class ResourceAssignmentUtils { ) setResourceValue(resourceAssignment, raRuntimeService, value) resourceAssignment.updatedDate = Date() - resourceAssignment.updatedBy = BlueprintConstants.USER_SYSTEM - resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS + resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM + resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS } } catch (e: Exception) { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Failed in setting value for template key " + "(${resourceAssignment.name}) and dictionary key (${resourceAssignment.dictionaryName}) of " + "type (${resourceProp.type}) with error message (${e.message})", @@ -139,7 +139,7 @@ class ResourceAssignmentUtils { .mapValues { e -> e.value.asText() } as MutableMap<String, Any> val newValue: JsonNode try { - newValue = BlueprintVelocityTemplateService + newValue = BluePrintVelocityTemplateService .generateContent(template, null, true, resolutionStore) .also { if (hasLogProtect(metadata)) @@ -149,7 +149,7 @@ class ResourceAssignmentUtils { } .let { v -> v.asJsonType() } } catch (e: Exception) { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "transform-template failed: $template", e ) } @@ -164,24 +164,24 @@ class ResourceAssignmentUtils { fun setFailedResourceDataValue(resourceAssignment: ResourceAssignment, message: String?) { if (isNotEmpty(resourceAssignment.name)) { resourceAssignment.updatedDate = Date() - resourceAssignment.updatedBy = BlueprintConstants.USER_SYSTEM - resourceAssignment.status = BlueprintConstants.STATUS_FAILURE + resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM + resourceAssignment.status = BluePrintConstants.STATUS_FAILURE resourceAssignment.message = message } } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun assertTemplateKeyValueNotNull(resourceAssignment: ResourceAssignment) { val resourceProp = checkNotNull(resourceAssignment.property) { "Failed to populate mandatory resource resource mapping $resourceAssignment" } if (resourceProp.required != null && resourceProp.required!! && resourceProp.value.isNullOrMissing()) { logger.error("failed to populate mandatory resource mapping ($resourceAssignment)") - throw BlueprintProcessorException("failed to populate mandatory resource mapping ($resourceAssignment)") + throw BluePrintProcessorException("failed to populate mandatory resource mapping ($resourceAssignment)") } } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun generateResourceDataForAssignments(assignments: List<ResourceAssignment>): String { val result: String try { @@ -209,13 +209,13 @@ class ResourceAssignmentUtils { logger.info("Generated Resource Param Data ($result)") } } catch (e: Exception) { - throw BlueprintProcessorException("Resource Assignment is failed with $e.message", e) + throw BluePrintProcessorException("Resource Assignment is failed with $e.message", e) } return result } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun generateResourceForAssignments(assignments: List<ResourceAssignment>): MutableMap<String, JsonNode> { val data: MutableMap<String, JsonNode> = hashMapOf() assignments.forEach { @@ -291,7 +291,7 @@ class ResourceAssignmentUtils { } fun transformToRARuntimeService( - blueprintRuntimeService: BlueprintRuntimeService<*>, + blueprintRuntimeService: BluePrintRuntimeService<*>, templateArtifactName: String ): ResourceAssignmentRuntimeService { @@ -305,7 +305,7 @@ class ResourceAssignmentUtils { return resourceAssignmentRuntimeService } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun getPropertyType( raRuntimeService: ResourceAssignmentRuntimeService, dataTypeName: String, @@ -321,12 +321,12 @@ class ResourceAssignmentUtils { logger.trace("Data type({})'s property ({}) is ({})", dataTypeName, propertyName, type) } catch (e: Exception) { logger.error("couldn't get data type($dataTypeName)'s property ($propertyName), error message $e") - throw BlueprintProcessorException("${e.message}", e) + throw BluePrintProcessorException("${e.message}", e) } return type } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) fun parseResponseNode( responseNode: JsonNode, resourceAssignment: ResourceAssignment, @@ -336,18 +336,18 @@ class ResourceAssignmentUtils { val metadata = resourceAssignment.property!!.metadata try { if ((resourceAssignment.property?.type).isNullOrEmpty()) { - throw BlueprintProcessorException("Couldn't get data dictionary type for dictionary name (${resourceAssignment.name})") + throw BluePrintProcessorException("Couldn't get data dictionary type for dictionary name (${resourceAssignment.name})") } val type = resourceAssignment.property!!.type val valueToPrint = getValueToLog(metadata, responseNode) logger.info("For template key (${resourceAssignment.name}) trying to get value from responseNode ($valueToPrint)") return when (type) { - in BlueprintTypes.validPrimitiveTypes() -> { + in BluePrintTypes.validPrimitiveTypes() -> { // Primitive Types parseResponseNodeForPrimitiveTypes(responseNode, resourceAssignment, outputKeyMapping) } - in BlueprintTypes.validCollectionTypes() -> { + in BluePrintTypes.validCollectionTypes() -> { // Array Types parseResponseNodeForCollection(responseNode, resourceAssignment, raRuntimeService, outputKeyMapping) } @@ -358,7 +358,7 @@ class ResourceAssignmentUtils { } } catch (e: Exception) { logger.error("Fail to parse response data, error message $e") - throw BlueprintProcessorException("${e.message}", e) + throw BluePrintProcessorException("${e.message}", e) } } @@ -387,7 +387,7 @@ class ResourceAssignmentUtils { } if (returnNode.isNullOrMissing() || returnNode!!.isComplexType() && !returnNode.has(outputKeyMapping[outputKey])) { - throw BlueprintProcessorException("Fail to find output key mapping ($outputKey) in the responseNode.") + throw BluePrintProcessorException("Fail to find output key mapping ($outputKey) in the responseNode.") } val returnValue = if (returnNode.isComplexType()) { @@ -411,7 +411,7 @@ class ResourceAssignmentUtils { val metadata = resourceAssignment.property!!.metadata var resultNode: JsonNode if ((resourceAssignment.property?.entrySchema?.type).isNullOrEmpty()) { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Couldn't get data type for dictionary type " + "(${resourceAssignment.property!!.type}) and dictionary name ($dName)" ) @@ -441,7 +441,7 @@ class ResourceAssignmentUtils { ) } else -> { - throw BlueprintProcessorException("Key-value response expected to match the responseNode.") + throw BluePrintProcessorException("Key-value response expected to match the responseNode.") } } } else { @@ -486,7 +486,7 @@ class ResourceAssignmentUtils { ): ObjectNode { val outputKeyMappingHasOnlyOneElement = checkIfOutputKeyMappingProvideOneElement(outputKeyMapping) when (entrySchemaType) { - in BlueprintTypes.validPrimitiveTypes() -> { + in BluePrintTypes.validPrimitiveTypes() -> { if (outputKeyMappingHasOnlyOneElement) { val outputKeyMap = outputKeyMapping.entries.first() if (resourceAssignment.keyIdentifiers.none { it.name == outputKeyMap.key }) { @@ -503,7 +503,7 @@ class ResourceAssignmentUtils { metadata ) } else { - throw BlueprintProcessorException("Expect one entry in output-key-mapping") + throw BluePrintProcessorException("Expect one entry in output-key-mapping") } } else -> { @@ -533,7 +533,7 @@ class ResourceAssignmentUtils { ) } else -> { - throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") + throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") } } } @@ -557,7 +557,7 @@ class ResourceAssignmentUtils { resourceAssignment.keyIdentifiers.add(KeyIdentifier(outputKeyMap.key, returnValue)) return returnValue } else { - throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") + throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") } } @@ -669,7 +669,7 @@ class ResourceAssignmentUtils { ) } else -> { - throw BlueprintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") + throw BluePrintProcessorException("Output-key-mapping do not map the Data Type $entrySchemaType") } } } else { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt index 4b4e04e16..1bf854cbd 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceDefinitionUtils.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.asListOfString import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition @@ -48,7 +48,7 @@ object ResourceDefinitionUtils { MutableList<ResourceAssignment> { /** Check if resolve definition is defined in the resource definition Map */ val resourceDefinition = resourceDefinitions[resolveDefinition] - ?: throw BlueprintProcessorException("failed to get resolve definition($resolveDefinition)") + ?: throw BluePrintProcessorException("failed to get resolve definition($resolveDefinition)") val resourceAssignments: MutableList<ResourceAssignment> = arrayListOf() @@ -56,7 +56,7 @@ object ResourceDefinitionUtils { val definitionDependencies = definitionDependencies(resourceDefinition, sources) definitionDependencies.forEach { definitionDependencyName -> val definitionDependency = resourceDefinitions[definitionDependencyName] - ?: throw BlueprintProcessorException("failed to get dependency definition($definitionDependencyName)") + ?: throw BluePrintProcessorException("failed to get dependency definition($definitionDependencyName)") val resourceAssignment = ResourceAssignment().apply { name = definitionDependency.name diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt index bdb47e711..7dcaab733 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -25,7 +25,7 @@ class ResourceDefinitionDSLTest { @Test fun testResourceDefinitionDSL() { - val testResourceDefinition = BlueprintTypes.resourceDefinition( + val testResourceDefinition = BluePrintTypes.resourceDefinition( "service-instance-id", "VFW Service Instance Name" ) { @@ -79,7 +79,7 @@ class ResourceDefinitionDSLTest { // println(resourceDefinition.asJsonString(true)) assertNotNull(testResourceDefinition, "failed to generate testResourceDefinition") - val testResourceDefinitions = BlueprintTypes.resourceDefinitions { + val testResourceDefinitions = BluePrintTypes.resourceDefinitions { resourceDefinition(testResourceDefinition) } assertNotNull(testResourceDefinitions, "failed to generate testResourceDefinitions") @@ -88,7 +88,7 @@ class ResourceDefinitionDSLTest { @Test fun testResourceAssignment() { - val testResourceAssignment = BlueprintTypes.resourceAssignment( + val testResourceAssignment = BluePrintTypes.resourceAssignment( "instance-name", "service-instance-name", "odl-mdsal" ) { @@ -99,7 +99,7 @@ class ResourceDefinitionDSLTest { // println(resourceAssignment.asJsonString(true)) assertNotNull(testResourceAssignment, "failed to generate resourceAssignment") - val testResourceAssignments = BlueprintTypes.resourceAssignments { + val testResourceAssignments = BluePrintTypes.resourceAssignments { resourceAssignment(testResourceAssignment) resourceAssignment( "instance-name1", diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt index 09eef46d4..f7c41bdac 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.dsl.getAttribute import kotlin.test.Test import kotlin.test.assertNotNull @@ -25,14 +25,14 @@ class ResourceResolutionComponentDSLTest { @Test fun testNodeTypeComponentResourceResolution() { - val nodeType = BlueprintTypes.nodeTypeComponentResourceResolution() + val nodeType = BluePrintTypes.nodeTypeComponentResourceResolution() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeComponentResourceResolution") } @Test fun testNodeTemplateComponentResourceResolution() { - val nodeTemplate = BlueprintTypes.nodeTemplateComponentResourceResolution("resource-resolve", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateComponentResourceResolution("resource-resolve", "") { definedOperation("Resolve resources") { inputs { actionName("resolve") diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt index 74a88b4e3..84d132a55 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt @@ -26,10 +26,10 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import kotlin.test.assertEquals import kotlin.test.fail @@ -44,7 +44,7 @@ class ResourceResolutionComponentTest { private val resourceType = "ServiceInstance" private val occurrence = 1 private val props = mutableMapOf<String, JsonNode>() - private val bluePrintRuntimeService = mockk<BlueprintRuntimeService<*>>() + private val bluePrintRuntimeService = mockk<BluePrintRuntimeService<*>>() private val artifactNames = listOf("template") private val nodeTemplateName = "nodeTemplateName" @@ -79,7 +79,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { assertEquals( "Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.", e.message @@ -98,7 +98,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { assertEquals( "Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.", e.message @@ -118,7 +118,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { assertEquals( "Can't proceed with the resolution: can't persist resolution without a correlation key. " + "Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false.", @@ -164,9 +164,9 @@ class ResourceResolutionComponentTest { @Test fun testRecover() { runBlocking { - val blueprintError = BlueprintError() + val blueprintError = BluePrintError() val exception = RuntimeException("message") - every { bluePrintRuntimeService.getBlueprintError() } returns blueprintError + every { bluePrintRuntimeService.getBluePrintError() } returns blueprintError resourceResolutionComponent.recoverNB(exception, executionRequest) assertEquals(1, blueprintError.allErrors().size) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index a1de557d5..3d2a9755c 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -30,11 +30,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.MockCapabilityScriptRA import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.slf4j.LoggerFactory @@ -106,7 +106,7 @@ class ResourceResolutionServiceTest { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -160,7 +160,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -200,7 +200,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -245,7 +245,7 @@ class ResourceResolutionServiceTest { props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = true Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -291,7 +291,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -344,7 +344,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -384,13 +384,13 @@ class ResourceResolutionServiceTest { @Test fun testResourceResolutionForDefinition() { - val resourceDefinitions = BlueprintTypes.resourceDefinitions { + val resourceDefinitions = BluePrintTypes.resourceDefinitions { resourceDefinition(name = "port-speed", description = "Port Speed") { property(type = "string", required = true) sources { sourceCapability(id = "sdno", description = "SDNO Source") { definedProperties { - type(BlueprintConstants.SCRIPT_KOTLIN) + type(BluePrintConstants.SCRIPT_KOTLIN) scriptClassReference(MockCapabilityScriptRA::class.qualifiedName!!) keyDependencies(arrayListOf("device-id")) } @@ -417,9 +417,9 @@ class ResourceResolutionServiceTest { } runBlocking { val raRuntimeService = mockk<ResourceAssignmentRuntimeService>() - every { raRuntimeService.bluePrintContext() } returns mockk<BlueprintContext>() - every { raRuntimeService.getBlueprintError() } returns BlueprintError() - every { raRuntimeService.setBlueprintError(any()) } returns Unit + every { raRuntimeService.bluePrintContext() } returns mockk<BluePrintContext>() + every { raRuntimeService.getBluePrintError() } returns BluePrintError() + every { raRuntimeService.setBluePrintError(any()) } returns Unit every { raRuntimeService.getInputValue("device-id") } returns "123456".asJsonPrimitive() every { raRuntimeService.putResolutionStore(any(), any()) } returns Unit diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt index 1dff814ac..2e9dc9e2a 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import kotlin.test.Test import kotlin.test.assertNotNull @@ -24,42 +24,42 @@ class ResourceSourceDSLTest { @Test fun testNodeTypeSourceInput() { - val nodeType = BlueprintTypes.nodeTypeSourceInput() + val nodeType = BluePrintTypes.nodeTypeSourceInput() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceInput") } @Test fun testNodeTypeSourceDefault() { - val nodeType = BlueprintTypes.nodeTypeSourceDefault() + val nodeType = BluePrintTypes.nodeTypeSourceDefault() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceDefault") } @Test fun testNodeTypeSourceDb() { - val nodeType = BlueprintTypes.nodeTypeSourceDb() + val nodeType = BluePrintTypes.nodeTypeSourceDb() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceDb") } @Test fun testNodeTypeSourceRest() { - val nodeType = BlueprintTypes.nodeTypeSourceRest() + val nodeType = BluePrintTypes.nodeTypeSourceRest() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceRest") } @Test fun testNodeTypeSourceCapability() { - val nodeType = BlueprintTypes.nodeTypeSourceCapability() + val nodeType = BluePrintTypes.nodeTypeSourceCapability() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceCapability") } @Test fun testNodeTemplateSourceInput() { - val nodeTemplate = BlueprintTypes.nodeTemplateSourceInput("InputSystem", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateSourceInput("InputSystem", "") { } // println(nodeTemplate.asJsonString(true)) assertNotNull(nodeTemplate, "failed to generate nodeTemplateSourceInput") @@ -67,7 +67,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceDefault() { - val nodeTemplate = BlueprintTypes.nodeTemplateSourceDefault("DefaultSystem", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateSourceDefault("DefaultSystem", "") { } // println(nodeTemplate.asJsonString(true)) assertNotNull(nodeTemplate, "failed to generate nodeTemplateSourceDefault") @@ -75,7 +75,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceDb() { - val nodeTemplate = BlueprintTypes.nodeTemplateSourceDb("DbSystem", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateSourceDb("DbSystem", "") { definedProperties { type("SQL") query("SELECT * FROM DB WHERE name = \$name") @@ -95,7 +95,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceRest() { - val nodeTemplate = BlueprintTypes.nodeTemplateSourceRest("restSystem", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateSourceRest("restSystem", "") { definedProperties { type("JSON") endpointSelector("rest-source-endpoint") @@ -119,7 +119,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceCapability() { - val nodeTemplate = BlueprintTypes.nodeTemplateSourceCapability("capabiltySystem", "") { + val nodeTemplate = BluePrintTypes.nodeTemplateSourceCapability("capabiltySystem", "") { definedProperties { type("kotlin") scriptClassReference("Scripts/Sample.kt") diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt index d720bd836..096d7ff27 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution", diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt index e48ac388d..4ce5df18f 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt @@ -29,14 +29,14 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignments import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceDefinitions import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -57,7 +57,7 @@ class IpAssignResolutionCapabilityTest { @Before fun setup() { - mockkObject(BlueprintDependencyService) + mockkObject(BluePrintDependencyService) val blueprintWebClientService = mockk<BlueprintWebClientService>() // Create mock Response @@ -72,9 +72,9 @@ class IpAssignResolutionCapabilityTest { ) every { blueprintWebClientService.exchangeResource(any(), any(), any()) } returns mockResponse - val restLibPropertyService = mockk<BlueprintRestLibPropertyService>() + val restLibPropertyService = mockk<BluePrintRestLibPropertyService>() every { restLibPropertyService.blueprintWebClientService("ipassign-ms") } returns blueprintWebClientService - every { BlueprintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService + every { BluePrintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService } @Test @@ -152,7 +152,7 @@ class IpAssignResolutionCapabilityTest { /** Test dictionaries */ private fun resourceDefinitions(): MutableMap<String, ResourceDefinition> { - return BlueprintTypes.resourceDefinitions { + return BluePrintTypes.resourceDefinitions { resourceDefinition("CloudRegionId", "Cloud Region Id Resource Definition") { tags("CloudRegionId") updatedBy("saurav.paira@att.com") @@ -230,7 +230,7 @@ class IpAssignResolutionCapabilityTest { } private fun resourceAssignments(): MutableMap<String, ResourceAssignment> { - return BlueprintTypes.resourceAssignments { + return BluePrintTypes.resourceAssignments { resourceAssignment( name = "CloudRegionId", dictionaryName = "CloudRegionId", dictionarySource = "input" diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt index 66f302f6f..8c0aca49e 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt @@ -29,16 +29,16 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignments import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceDefinitions import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -60,7 +60,7 @@ class NamingResolutionCapabilityTest { @Before fun setup() { - mockkObject(BlueprintDependencyService) + mockkObject(BluePrintDependencyService) val blueprintWebClientService = mockk<BlueprintWebClientService>() // Create mock Response @@ -74,9 +74,9 @@ class NamingResolutionCapabilityTest { ) every { blueprintWebClientService.exchangeResource(any(), any(), any()) } returns mockResponse - val restLibPropertyService = mockk<BlueprintRestLibPropertyService>() + val restLibPropertyService = mockk<BluePrintRestLibPropertyService>() every { restLibPropertyService.blueprintWebClientService("naming-ms") } returns blueprintWebClientService - every { BlueprintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService + every { BluePrintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService } @Test @@ -89,8 +89,8 @@ class NamingResolutionCapabilityTest { } returns NamingResolutionCapability() val raRuntimeService = mockk<ResourceAssignmentRuntimeService>() - every { raRuntimeService.getBlueprintError() } returns BlueprintError() - every { raRuntimeService.bluePrintContext() } returns mockk<BlueprintContext>() + every { raRuntimeService.getBluePrintError() } returns BluePrintError() + every { raRuntimeService.bluePrintContext() } returns mockk<BluePrintContext>() every { raRuntimeService.getInputValue("vf-module-name") } returns NullNode.getInstance() every { raRuntimeService.getInputValue("vnfc-name") } returns NullNode.getInstance() @@ -154,7 +154,7 @@ class NamingResolutionCapabilityTest { /** Test dictionaries */ private fun resourceDefinitions(): MutableMap<String, ResourceDefinition> { - return BlueprintTypes.resourceDefinitions { + return BluePrintTypes.resourceDefinitions { resourceDefinition("naming-code", "naming-code Resource Definition") { tags("naming-code") updatedBy("brindasanth@onap.com") @@ -274,7 +274,7 @@ class NamingResolutionCapabilityTest { } private fun resourceAssignments(): MutableMap<String, ResourceAssignment> { - return BlueprintTypes.resourceAssignments { + return BluePrintTypes.resourceAssignments { resourceAssignment( name = "naming-code", dictionaryName = "naming-code", dictionarySource = "input" diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt index 51825a5f9..fa59876a9 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt @@ -23,10 +23,10 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.dao.EmptyResultDataAccessException import kotlin.test.assertEquals @@ -46,13 +46,13 @@ open class ResourceResolutionDBServiceTest { private val blueprintVersion = "1.0.0" private val metadata = hashMapOf<String, String>() private val props = hashMapOf<String, Any>() - private val bluePrintContext = mockk<BlueprintContext>() - private val bluePrintRuntimeService = mockk<DefaultBlueprintRuntimeService>() + private val bluePrintContext = mockk<BluePrintContext>() + private val bluePrintRuntimeService = mockk<DefaultBluePrintRuntimeService>() @Before fun setup() { - metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion - metadata[BlueprintConstants.METADATA_TEMPLATE_NAME] = blueprintName + metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion + metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] = blueprintName props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = resolutionKey props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] = resourceId @@ -206,7 +206,7 @@ open class ResourceResolutionDBServiceTest { fun writeTest() { val resourceResolution = ResourceResolution() val resourceAssignment = ResourceAssignment() - resourceAssignment.property?.status = BlueprintConstants.STATUS_SUCCESS + resourceAssignment.property?.status = BluePrintConstants.STATUS_SUCCESS resourceAssignment.property?.value = "result".asJsonPrimitive() resourceAssignment.dictionarySource = "ddSource" resourceAssignment.dictionaryName = "ddName" @@ -229,7 +229,7 @@ open class ResourceResolutionDBServiceTest { fun writeWithNullValue() { val slot = slot<ResourceResolution>() val resourceAssignment = ResourceAssignment() - resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS + resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS resourceAssignment.dictionarySource = "ddSource" resourceAssignment.dictionaryName = "ddName" resourceAssignment.version = 1 diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt index 0a7722f53..71d895574 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt @@ -7,9 +7,9 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService import org.springframework.dao.EmptyResultDataAccessException import kotlin.test.assertEquals @@ -29,13 +29,13 @@ class TemplateResolutionServiceTest { private val result = "result" private val metadata = hashMapOf<String, String>() private val props = hashMapOf<String, Any>() - private val bluePrintContext = mockk<BlueprintContext>() - private val bluePrintRuntimeService = mockk<DefaultBlueprintRuntimeService>() + private val bluePrintContext = mockk<BluePrintContext>() + private val bluePrintRuntimeService = mockk<DefaultBluePrintRuntimeService>() @Before fun setup() { - metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion - metadata[BlueprintConstants.METADATA_TEMPLATE_NAME] = blueprintName + metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion + metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] = blueprintName props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = resolutionKey props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] = resourceId diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt index b6c20cd5a..a2ec75d02 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt @@ -15,12 +15,12 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService -class MockBlueprintRestLibPropertyService(bluePrintProperties: BlueprintPropertiesService) : - BlueprintRestLibPropertyService(bluePrintProperties) { +class MockBluePrintRestLibPropertyService(bluePrintProperties: BluePrintPropertiesService) : + BluePrintRestLibPropertyService(bluePrintProperties) { fun mockBlueprintWebClientService(selector: String): MockBlueprintWebClientService { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt index 653a2c1f4..2219f2348 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt @@ -17,9 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.moc import io.mockk.coEvery import io.mockk.mockk -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidatorService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -27,8 +27,8 @@ import org.springframework.context.annotation.Configuration open class MockDBLibGenericService { @Bean(name = ["MariaDatabaseConfiguration", "MySqlDatabaseConfiguration"]) - open fun createDatabaseConfiguration(): BlueprintDBLibGenericService { - return mockk<BlueprintDBLibGenericService>() + open fun createDatabaseConfiguration(): BluePrintDBLibGenericService { + return mockk<BluePrintDBLibGenericService>() } } @@ -36,10 +36,10 @@ open class MockDBLibGenericService { open class MockBlueprintProcessorCatalogServiceImpl { @Bean(name = ["bluePrintRuntimeValidatorService"]) - open fun bluePrintRuntimeValidatorService(): BlueprintValidatorService { - val bluePrintValidatorService = mockk<BlueprintValidatorService>() - coEvery { bluePrintValidatorService.validateBlueprints(any<String>()) } returns true - coEvery { bluePrintValidatorService.validateBlueprints(any<BlueprintRuntimeService<*>>()) } returns true + open fun bluePrintRuntimeValidatorService(): BluePrintValidatorService { + val bluePrintValidatorService = mockk<BluePrintValidatorService>() + coEvery { bluePrintValidatorService.validateBluePrints(any<String>()) } returns true + coEvery { bluePrintValidatorService.validateBluePrints(any<BluePrintRuntimeService<*>>()) } returns true return bluePrintValidatorService } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt index 77c90ba51..69099152e 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt @@ -22,8 +22,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -33,7 +33,7 @@ import java.util.HashMap class MockRestResourceResolutionProcessor( private val blueprintRestLibPropertyService: - MockBlueprintRestLibPropertyService + MockBluePrintRestLibPropertyService ) : ResourceAssignmentProcessor() { private val logger = LoggerFactory.getLogger(MockRestResourceResolutionProcessor::class.java) @@ -97,12 +97,12 @@ class MockRestResourceResolutionProcessor( val errMsg = "Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath) response_code: ($responseStatusCode)" logger.warn(errMsg) - throw BlueprintProcessorException(errMsg) + throw BluePrintProcessorException(errMsg) } } } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(executionRequest, e.message) - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Failed in template resolutionKey ($executionRequest) assignments with: ${e.message}", e ) @@ -117,7 +117,7 @@ class MockRestResourceResolutionProcessor( return blueprintRestLibPropertyService.mockBlueprintWebClientService(resourceAssignment.dictionarySource!!) } - @Throws(BlueprintProcessorException::class) + @Throws(BluePrintProcessorException::class) private fun populateResource( resourceAssignment: ResourceAssignment, sourceProperties: RestResourceSource, @@ -132,15 +132,15 @@ class MockRestResourceResolutionProcessor( val responseNode = JacksonUtils.jsonNode(restResponse).at(path) when (type) { - in BlueprintTypes.validPrimitiveTypes() -> { + in BluePrintTypes.validPrimitiveTypes() -> { ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, responseNode) } - in BlueprintTypes.validCollectionTypes() -> { + in BluePrintTypes.validCollectionTypes() -> { // Array Types entrySchemaType = resourceAssignment.property!!.entrySchema!!.type val arrayNode = responseNode as ArrayNode - if (entrySchemaType !in BlueprintTypes.validPrimitiveTypes()) { + if (entrySchemaType !in BluePrintTypes.validPrimitiveTypes()) { val responseArrayNode = responseNode.toList() for (responseSingleJsonNode in responseArrayNode) { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt index b289cfe3e..1b0058b90 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt @@ -27,13 +27,13 @@ import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignment import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -53,14 +53,14 @@ class CapabilityResourceResolutionProcessorTest { } returns MockCapabilityScriptRA() val raRuntimeService = mockk<ResourceAssignmentRuntimeService>() - every { raRuntimeService.bluePrintContext() } returns mockk<BlueprintContext>() + every { raRuntimeService.bluePrintContext() } returns mockk<BluePrintContext>() every { raRuntimeService.getInputValue("test-property") } returns NullNode.getInstance() val capabilityResourceResolutionProcessor = CapabilityResourceResolutionProcessor(componentFunctionScriptingService) capabilityResourceResolutionProcessor.raRuntimeService = raRuntimeService - val resourceAssignment = BlueprintTypes.resourceAssignment( + val resourceAssignment = BluePrintTypes.resourceAssignment( name = "test-property", dictionaryName = "ra-dict-name", dictionarySource = "capability" ) { @@ -86,14 +86,14 @@ class CapabilityResourceResolutionProcessorTest { fun `test jython capability`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/capability_python" ) val componentFunctionScriptingService = mockk<ComponentFunctionScriptingService>() coEvery { componentFunctionScriptingService - .scriptInstance<ResourceAssignmentProcessor>(any(), BlueprintConstants.SCRIPT_JYTHON, any()) + .scriptInstance<ResourceAssignmentProcessor>(any(), BluePrintConstants.SCRIPT_JYTHON, any()) } returns MockCapabilityScriptRA() val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt index 6689aff81..0c8ec7d95 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt @@ -19,14 +19,14 @@ import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService -import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BlueprintDBLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.TestDatabaseConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBlueprintProcessorCatalogServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -38,7 +38,7 @@ import kotlin.test.assertNotNull @ContextConfiguration( classes = [ TestDatabaseConfiguration::class, - PrimaryDBLibGenericService::class, BlueprintDBLibPropertyService::class, + PrimaryDBLibGenericService::class, BluePrintDBLibPropertyService::class, DatabaseResourceAssignmentProcessor::class, MockDBLibGenericService::class, MockBlueprintProcessorCatalogServiceImpl::class ] @@ -52,7 +52,7 @@ class DatabaseResourceResolutionProcessorTest { @Test fun `test database resource resolution processor db`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt index 7cec75950..a109131fe 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt @@ -20,7 +20,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -39,7 +39,7 @@ class DefaultResourceResolutionProcessorTest { @Test fun `test default resource resolution`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt index aae35f4d3..cf8dc0c59 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt @@ -25,7 +25,7 @@ import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -45,7 +45,7 @@ class InputResourceResolutionProcessorTest { fun `InputResourceResolutionProcessor should be able to resolve a value for an input parameter`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt index 9fabf5dbd..cb7214123 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt @@ -18,15 +18,15 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService -import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockRestResourceResolutionProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -38,15 +38,15 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - MockRestResourceResolutionProcessor::class, MockBlueprintRestLibPropertyService::class, - BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class, RestClientProperties::class + MockRestResourceResolutionProcessor::class, MockBluePrintRestLibPropertyService::class, + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, RestClientProperties::class ] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) class RestResourceResolutionProcessorTest { @Autowired - lateinit var bluePrintRestLibPropertyService: MockBlueprintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: MockBluePrintRestLibPropertyService private lateinit var restResourceResolutionProcessor: MockRestResourceResolutionProcessor @@ -58,7 +58,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest resource resolution`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -92,7 +92,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest aai get resource resolution`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -126,7 +126,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest aai put resource resolution`() { runBlocking { - val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( + val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt index d9e93150c..2f07e3b9a 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt @@ -36,7 +36,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.EntrySchema import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -70,7 +70,7 @@ class ResourceAssignmentUtilsTest { fun setup() { val bluePrintContext = runBlocking { - BlueprintMetadataUtils.getBlueprintContext( + BluePrintMetadataUtils.getBluePrintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) } diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutor.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutor.kt index f9c9ce88d..4b9333544 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutor.kt +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutor.kt @@ -18,9 +18,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientSer import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentRemoteScriptExecutor import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.PROPERTY_CONNECTION_CONFIG -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.PROPERTY_CONNECTION_CONFIG +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils.Companion.jsonNodeFromObject @@ -41,14 +41,14 @@ open class Mount : AbstractScriptComponentFunction() { val webclientService = restconfClientService(deviceInformation) val nodeId = requestPayloadActionProperty(NODE_ID)?.first()?.textValue() - ?: throw BlueprintProcessorException("Failed to load $NODE_ID properties.") + ?: throw BluePrintProcessorException("Failed to load $NODE_ID properties.") val mountPayload = requestPayloadActionProperty(MOUNT_PAYLOAD)?.first() - ?: throw BlueprintProcessorException("Failed to load $MOUNT_PAYLOAD properties.") + ?: throw BluePrintProcessorException("Failed to load $MOUNT_PAYLOAD properties.") restconfMountDeviceJson(webclientService, nodeId, mountPayload.toString()) setAttribute( ComponentRemoteScriptExecutor.ATTRIBUTE_STATUS, - BlueprintConstants.STATUS_SUCCESS.asJsonPrimitive() + BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive() ) } @@ -67,7 +67,7 @@ open class Execute : AbstractScriptComponentFunction() { override suspend fun processNB(executionRequest: ExecutionServiceInput) { val nodeIdJson = requestPayloadActionProperty(NODE_ID)?.first() - ?: throw BlueprintProcessorException("Failed to load $NODE_ID properties.") + ?: throw BluePrintProcessorException("Failed to load $NODE_ID properties.") val failFastJsonNode = requestPayloadActionProperty(FAIL_FAST)!! val failFast = if (failFastJsonNode.isEmpty) false else failFastJsonNode.first().booleanValue() @@ -78,7 +78,7 @@ open class Execute : AbstractScriptComponentFunction() { val nodeId = nodeIdJson.textValue() val actionList = requestPayloadActionProperty("action")?.first() - ?: throw BlueprintProcessorException("Failed to load action properties.") + ?: throw BluePrintProcessorException("Failed to load action properties.") validateActionList(actionList) val actionListResults: MutableList<Map<String, JsonNode>> = mutableListOf() @@ -113,12 +113,12 @@ open class Execute : AbstractScriptComponentFunction() { if (response.status in HTTP_SUCCESS_RANGE) { log.info("\nRestconf execution response : \n{}", responseBody.asJsonType().toPrettyString()) actionResult[ComponentScriptExecutor.ATTRIBUTE_STATUS] = - BlueprintConstants.STATUS_SUCCESS.asJsonPrimitive() + BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive() } else { actionResult[ComponentScriptExecutor.ATTRIBUTE_STATUS] = - BlueprintConstants.STATUS_FAILURE.asJsonPrimitive() + BluePrintConstants.STATUS_FAILURE.asJsonPrimitive() addError( - BlueprintConstants.STATUS_FAILURE, + BluePrintConstants.STATUS_FAILURE, ComponentScriptExecutor.ATTRIBUTE_STATUS, actionResponse.asText() ) @@ -131,17 +131,17 @@ open class Execute : AbstractScriptComponentFunction() { } setAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, jsonNodeFromObject(actionListResults)) - setAttribute(ComponentScriptExecutor.ATTRIBUTE_STATUS, BlueprintConstants.STATUS_SUCCESS.asJsonPrimitive()) + setAttribute(ComponentScriptExecutor.ATTRIBUTE_STATUS, BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive()) actionListResults.forEach { actionResult -> val actionResultStatus = actionResult[ComponentScriptExecutor.ATTRIBUTE_STATUS] - if (BlueprintConstants.STATUS_SUCCESS.asJsonPrimitive() != actionResultStatus) { + if (BluePrintConstants.STATUS_SUCCESS.asJsonPrimitive() != actionResultStatus) { setAttribute( ComponentScriptExecutor.ATTRIBUTE_STATUS, - BlueprintConstants.STATUS_FAILURE.asJsonPrimitive() + BluePrintConstants.STATUS_FAILURE.asJsonPrimitive() ) val errorResponse = actionResult[ACTION_OUTPUT]!! addError( - BlueprintConstants.STATUS_FAILURE, ComponentScriptExecutor.ATTRIBUTE_STATUS, + BluePrintConstants.STATUS_FAILURE, ComponentScriptExecutor.ATTRIBUTE_STATUS, errorResponse.asText() ) } @@ -178,19 +178,19 @@ open class Execute : AbstractScriptComponentFunction() { private fun validateActionList(actionList: JsonNode) { if (actionList.isEmpty) { - throw BlueprintProcessorException("No actions defined") + throw BluePrintProcessorException("No actions defined") } actionList.forEach { action -> action.get(ACTION_PATH) - ?: throw BlueprintProcessorException("Failed to load action path.") + ?: throw BluePrintProcessorException("Failed to load action path.") action.get(ACTION_DATASTORE) - ?: throw BlueprintProcessorException("Failed to load action datastore.") + ?: throw BluePrintProcessorException("Failed to load action datastore.") val actionTypeJsonNode = action.get(ACTION_TYPE) - ?: throw BlueprintProcessorException("Failed to load action type.") + ?: throw BluePrintProcessorException("Failed to load action type.") when (val actionType = RestconfRequestType.valueOf(actionTypeJsonNode.asText().toUpperCase())) { RestconfRequestType.PATCH, RestconfRequestType.PUT, RestconfRequestType.POST -> { action.get(ACTION_PAYLOAD) - ?: throw BlueprintProcessorException("Failed to load action $actionType payload.") + ?: throw BluePrintProcessorException("Failed to load action $actionType payload.") } } } diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutorExtensions.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutorExtensions.kt index aade8965b..5892c9f8b 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutorExtensions.kt +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/RestconfExecutorExtensions.kt @@ -24,9 +24,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.restconf.executor.Restco import org.onap.ccsdk.cds.blueprintsprocessor.rest.restClientService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintRetryException -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService /** * Register the Restconf module exposed dependency @@ -34,11 +34,11 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyS val log = LoggerFactory.logger(AbstractScriptComponentFunction::class.java)!! fun AbstractScriptComponentFunction.restconfClientService(selector: String): BlueprintWebClientService { - return BlueprintDependencyService.restClientService(selector) + return BluePrintDependencyService.restClientService(selector) } fun AbstractScriptComponentFunction.restconfClientService(jsonNode: JsonNode): BlueprintWebClientService { - return BlueprintDependencyService.restClientService(jsonNode) + return BluePrintDependencyService.restClientService(jsonNode) } /** @@ -85,14 +85,14 @@ suspend fun AbstractScriptComponentFunction.restconfMountDevice( webClientService.exchangeResource(RestconfRequestType.PUT.name, mountUrl, payload as String, headers) if (mountResult.status !in RestconfConstants.HTTP_SUCCESS_RANGE) { - throw BlueprintProcessorException("Failed to mount device with url($mountUrl) ") + throw BluePrintProcessorException("Failed to mount device with url($mountUrl) ") } /** Check device has mounted */ val mountCheckExecutionBlock: suspend (Int) -> String = { val result = webClientService.exchangeResource(RestconfRequestType.GET.name, mountVerifyUrl, "") if (!result.body.contains(expectedMountResult)) { - throw BlueprintRetryException("Wait for device with url($mountUrl) to mount") + throw BluePrintRetryException("Wait for device with url($mountUrl) to mount") } log.info("NF was mounted successfully on ODL") result.body @@ -151,7 +151,7 @@ suspend fun AbstractScriptComponentFunction.genericPutPatchPostRequest( RestconfRequestType.PUT -> log.info("sending PUT request, url: $requestUrl") RestconfRequestType.PATCH -> log.info("sending PATCH request, url: $requestUrl") RestconfRequestType.POST -> log.info("sending POST request, url: $requestUrl") - else -> throw BlueprintProcessorException("Illegal request type, only POST, PUT or PATCH allowed.") + else -> throw BluePrintProcessorException("Illegal request type, only POST, PUT or PATCH allowed.") } return webClientService.exchangeResource(requestType.name, requestUrl, payload as String, headers) } @@ -168,7 +168,7 @@ suspend fun AbstractScriptComponentFunction.getRequest( { tryCount: Int -> val result = genericGetOrDeleteRequest(webClientService, requestUrl, RestconfRequestType.GET) if (result.status !in RestconfConstants.HTTP_SUCCESS_RANGE && tryCount < retryTimes - 1) { - throw BlueprintRetryException("Failed to read url($requestUrl) to mount") + throw BluePrintRetryException("Failed to read url($requestUrl) to mount") } log.info("NF was mounted successfully on ODL") result @@ -198,7 +198,7 @@ suspend fun AbstractScriptComponentFunction.genericGetOrDeleteRequest( when (requestType) { RestconfRequestType.GET -> log.info("sending GET request, url: $requestUrl") RestconfRequestType.DELETE -> log.info("sending DELETE request, url: $requestUrl") - else -> throw BlueprintProcessorException("Illegal request type, only GET and DELETE allowed.") + else -> throw BluePrintProcessorException("Illegal request type, only GET and DELETE allowed.") } return webClientService.exchangeResource(requestType.name, requestUrl, "") } diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt index 653b4c56a..47cf34fad 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt @@ -28,11 +28,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.context.ApplicationContext import kotlin.test.assertNotNull @@ -59,25 +59,25 @@ class ComponentRestconfExecutorTest { payload = JacksonUtils.jsonNode("{}") as ObjectNode } - val blueprintContext = mockk<BlueprintContext>() + val blueprintContext = mockk<BluePrintContext>() every { blueprintContext.nodeTemplateOperationImplementation( any(), any(), any() ) } returns Implementation() - val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234") + val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234") every { bluePrintRuntime.bluePrintContext() } returns blueprintContext componentScriptExecutor.bluePrintRuntimeService = bluePrintRuntime componentScriptExecutor.stepName = "sample-step" val operationInputs = hashMapOf<String, JsonNode>() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "activate-restconf".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "activate-restconf".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_TYPE] = - BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive() + BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive() operationInputs[ComponentScriptExecutor.INPUT_SCRIPT_CLASS_REFERENCE] = "internal.scripts.TestRestconfConfigure".asJsonPrimitive() diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt index 122fe5543..9cd6f57a4 100644 --- a/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt +++ b/ms/blueprintsprocessor/functions/restful-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/restful/executor/RestfulCMComponentFunction.kt @@ -22,10 +22,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.restful.executor.nrmfunction.RestfulNRMServiceClient import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory @@ -33,14 +33,14 @@ abstract class RestfulCMComponentFunction : AbstractScriptComponentFunction() { private val log = LoggerFactory.getLogger(RestfulCMComponentFunction::class.java) override suspend fun processNB(executionRequest: ExecutionServiceInput) { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - throw BlueprintException("Not Implemented required") + throw BluePrintException("Not Implemented required") } - open fun bluePrintRestLibPropertyService(): BlueprintRestLibPropertyService = + open fun bluePrintRestLibPropertyService(): BluePrintRestLibPropertyService = functionDependencyInstanceAsType(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY) fun restClientService(clientInfo: JsonNode): BlueprintWebClientService { diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/ComponentRestfulExecutorTest.kt b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/ComponentRestfulExecutorTest.kt index 989170213..ad70ac021 100644 --- a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/ComponentRestfulExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/ComponentRestfulExecutorTest.kt @@ -27,11 +27,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.context.ApplicationContext @@ -58,24 +58,24 @@ class ComponentRestfulExecutorTest { payload = JacksonUtils.jsonNode("{}") as ObjectNode } - val blueprintContext = mockk<BlueprintContext>() + val blueprintContext = mockk<BluePrintContext>() every { blueprintContext.nodeTemplateOperationImplementation( any(), any(), any() ) } returns Implementation() - val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234") + val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234") every { bluePrintRuntime.bluePrintContext() } returns blueprintContext componentRestfulExecutor.bluePrintRuntimeService = bluePrintRuntime componentRestfulExecutor.stepName = "sample-step" val operationInputs = hashMapOf<String, JsonNode>() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "config-deploy-process".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() - operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() - operationInputs["script-type"] = BlueprintConstants.SCRIPT_INTERNAL.asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "config-deploy-process".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] = "interfaceName".asJsonPrimitive() + operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "operationName".asJsonPrimitive() + operationInputs["script-type"] = BluePrintConstants.SCRIPT_INTERNAL.asJsonPrimitive() operationInputs["script-class-reference"] = "internal.scripts.TestRestfulConfigure".asJsonPrimitive() val stepInputData = StepData().apply { diff --git a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt index 6f57439c3..6f76c9b40 100644 --- a/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt +++ b/ms/blueprintsprocessor/functions/restful-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/restful/executor/nrmfunction/RestfulNRMServiceClientTest.kt @@ -20,8 +20,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.rest.BlueprintRestLibConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BluePrintRestLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration @@ -44,7 +44,7 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class]) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) -@ContextConfiguration(classes = [BlueprintRestLibConfiguration::class, NrmTestController::class]) +@ContextConfiguration(classes = [BluePrintRestLibConfiguration::class, NrmTestController::class]) @TestPropertySource( properties = [ "blueprintsprocessor.restclient.nrm.type=basic-auth", @@ -59,7 +59,7 @@ class RestfulNRMServiceClientTest { @Autowired lateinit var restfulNRMServiceClient: RestfulNRMServiceClient - lateinit var bluePrintRestLibPropertyService: BlueprintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService @Test fun testCreateMOI() { |