diff options
author | KAPIL SINGAL <ks220y@att.com> | 2021-01-22 11:49:51 -0500 |
---|---|---|
committer | Singal, Kapil (ks220y) <ks220y@att.com> | 2021-01-22 12:08:19 -0500 |
commit | adcd4f2bc695840e9ecbc05003bc52c675f22fec (patch) | |
tree | 5db58ce9b6b3e86977ca3c697ce3e8998523eb61 /ms/blueprintsprocessor/modules/commons | |
parent | dc8252f3cfa1ddd0c1c8c70513c16c738d840822 (diff) |
Renaming Files having BluePrint to have Blueprint
Replacing BluePrint with Blueprint throughout
Issue-ID: CCSDK-3098
Signed-off-by: KAPIL SINGAL <ks220y@att.com>
Change-Id: Ibee8bad07ae7d9287073db2d4f2f2cd730fa8b96
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons')
93 files changed, 616 insertions, 616 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibConfiguration.kt index d4b3f807b..f11832beb 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibConfiguration.kt @@ -16,11 +16,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db -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.db.primary.BluePrintDBLibPropertyService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +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.db.primary.BlueprintDBLibPropertyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -30,12 +30,12 @@ import javax.sql.DataSource @Configuration @Import( - BluePrintPropertyConfiguration::class, - BluePrintPropertiesService::class, - BluePrintCoreConfiguration::class + BlueprintPropertyConfiguration::class, + BlueprintPropertiesService::class, + BlueprintCoreConfiguration::class ) @EnableConfigurationProperties -open class BluePrintDBLibConfiguration(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintDBLibConfiguration(private var bluePrintPropertiesService: BlueprintPropertiesService) { @Bean("primary-database-properties") open fun getPrimaryProperties(): PrimaryDataSourceProperties { @@ -54,10 +54,10 @@ open class BluePrintDBLibConfiguration(private var bluePrintPropertiesService: B /** * Exposed Dependency Service by this SSH Lib Module */ -fun BluePrintDependencyService.dbLibPropertyService(): BluePrintDBLibPropertyService = - instance(BluePrintDBLibPropertyService::class) +fun BlueprintDependencyService.dbLibPropertyService(): BlueprintDBLibPropertyService = + instance(BlueprintDBLibPropertyService::class) -fun BluePrintDependencyService.primaryDBLibGenericService(): BluePrintDBLibGenericService = +fun BlueprintDependencyService.primaryDBLibGenericService(): BlueprintDBLibGenericService = instance(PrimaryDBLibGenericService::class) class DBLibConstants { diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibData.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibData.kt index 7023106eb..7023106eb 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibGenericService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibGenericService.kt index aeb87fd66..6c382377d 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibGenericService.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintDBLibGenericService.kt @@ -18,7 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate -interface BluePrintDBLibGenericService { +interface BlueprintDBLibGenericService { fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate @@ -28,7 +28,7 @@ interface BluePrintDBLibGenericService { } abstract class AbstractDBLibGenericService(private val namedParameterJdbcTemplate: NamedParameterJdbcTemplate) : - BluePrintDBLibGenericService { + BlueprintDBLibGenericService { override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate { return namedParameterJdbcTemplate diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSL.kt index 34dd0a417..fd51da152 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db 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.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,25 +30,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Types DSL for Database Producer */ fun ServiceTemplateBuilder.relationshipTypeConnectsToDb() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToDb() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToDb() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToDb(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToDb(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through Database." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -66,25 +66,25 @@ fun TopologyTemplateBuilder.relationshipTemplateDb( class DbRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB, description ) { fun mariaDb(block: DbMariaDataSourcePropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.mariaDbProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.mariaDbProperties(block)) } fun mySqlDb(block: DbMySqlDataSourcePropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.mySqlDbProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.mySqlDbProperties(block)) } } -fun BluePrintTypes.mariaDbProperties(block: DbMariaDataSourcePropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.mariaDbProperties(block: DbMariaDataSourcePropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = DbMariaDataSourcePropertiesAssignmentBuilder().apply(block).build() assignments[DBDataSourceProperties::type.name] = DBLibConstants.MARIA_DB.asJsonPrimitive() return assignments.asJsonNode() } -fun BluePrintTypes.mySqlDbProperties(block: DbMySqlDataSourcePropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.mySqlDbProperties(block: DbMySqlDataSourcePropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = DbMySqlDataSourcePropertiesAssignmentBuilder().apply(block).build() assignments[DBDataSourceProperties::type.name] = DBLibConstants.MYSQL_DB.asJsonPrimitive() return assignments.asJsonNode() diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BlueprintDBLibPropertyService.kt index 79f5c09bc..b272a9708 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BlueprintDBLibPropertyService.kt @@ -17,25 +17,25 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.db.DBDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.DBLibConstants.Companion.MARIA_DB import org.onap.ccsdk.cds.blueprintsprocessor.db.DBLibConstants.Companion.MYSQL_DB import org.onap.ccsdk.cds.blueprintsprocessor.db.DBLibConstants.Companion.PROCESSOR_DB import org.onap.ccsdk.cds.blueprintsprocessor.db.MariaDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.MySqlDataSourceProperties -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.springframework.stereotype.Service @Service -class BluePrintDBLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +class BlueprintDBLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { - fun JdbcTemplate(jsonNode: JsonNode): BluePrintDBLibGenericService = + fun JdbcTemplate(jsonNode: JsonNode): BlueprintDBLibGenericService = blueprintDBDataSourceService(dBDataSourceProperties(jsonNode)) - fun JdbcTemplate(selector: String): BluePrintDBLibGenericService = + fun JdbcTemplate(selector: String): BlueprintDBLibGenericService = blueprintDBDataSourceService(dBDataSourceProperties("blueprintsprocessor.db.$selector")) private fun dBDataSourceProperties(jsonNode: JsonNode): DBDataSourceProperties = @@ -43,7 +43,7 @@ class BluePrintDBLibPropertyService(private var bluePrintPropertiesService: Blue MYSQL_DB -> JacksonUtils.readValue(jsonNode, MySqlDataSourceProperties::class.java) MARIA_DB -> JacksonUtils.readValue(jsonNode, MariaDataSourceProperties::class.java) else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "DB type ($type) is not supported. Valid types: $MARIA_DB, $MYSQL_DB" ) } @@ -55,18 +55,18 @@ class BluePrintDBLibPropertyService(private var bluePrintPropertiesService: Blue MARIA_DB, PROCESSOR_DB -> mariaDBConnectionProperties(prefix) MYSQL_DB -> mySqlDBConnectionProperties(prefix) else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "DB type ($it) is not supported. Valid types: $MARIA_DB, $MYSQL_DB, $PROCESSOR_DB" ) } } } - private fun blueprintDBDataSourceService(dBConnetionProperties: DBDataSourceProperties): BluePrintDBLibGenericService = + private fun blueprintDBDataSourceService(dBConnetionProperties: DBDataSourceProperties): BlueprintDBLibGenericService = when (dBConnetionProperties) { is MariaDataSourceProperties -> MariaDatabaseConfiguration(dBConnetionProperties) is MySqlDataSourceProperties -> MySqlDatabaseConfiguration(dBConnetionProperties) - else -> throw BluePrintProcessorException( + else -> throw BlueprintProcessorException( "Failed to create db configuration for ${dBConnetionProperties.url}" ) } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt index 82895257a..6132190c2 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt @@ -16,14 +16,14 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary -import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.db.MariaDataSourceProperties import org.slf4j.LoggerFactory import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate import org.springframework.jdbc.datasource.DriverManagerDataSource import javax.sql.DataSource -class MariaDatabaseConfiguration(private val mariaDataSourceProperties: MariaDataSourceProperties) : BluePrintDBLibGenericService { +class MariaDatabaseConfiguration(private val mariaDataSourceProperties: MariaDataSourceProperties) : BlueprintDBLibGenericService { val log = LoggerFactory.getLogger(MariaDatabaseConfiguration::class.java)!! diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MySqlDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MySqlDatabaseConfiguration.kt index 0761b72d2..ea13dfb83 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MySqlDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MySqlDatabaseConfiguration.kt @@ -16,14 +16,14 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary -import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.db.MySqlDataSourceProperties import org.slf4j.LoggerFactory import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate import org.springframework.jdbc.datasource.DriverManagerDataSource import javax.sql.DataSource -class MySqlDatabaseConfiguration(private val mySqlDataSourceProperties: MySqlDataSourceProperties) : BluePrintDBLibGenericService { +class MySqlDatabaseConfiguration(private val mySqlDataSourceProperties: MySqlDataSourceProperties) : BlueprintDBLibGenericService { override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate { return mySqlNamedParameterJdbcTemplate(mySqlDataSource()) diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintCatalogServiceImpl.kt index 9d1826395..fe6da176b 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintCatalogServiceImpl.kt @@ -18,16 +18,16 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.service -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException -import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.deCompress -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidatorService import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.slf4j.LoggerFactory import java.io.File import java.nio.file.Path @@ -35,9 +35,9 @@ import javax.persistence.MappedSuperclass @MappedSuperclass abstract class BlueprintCatalogServiceImpl( - private val bluePrintLoadConfiguration: BluePrintLoadConfiguration, - private val blueprintValidator: BluePrintValidatorService -) : BluePrintCatalogService { + private val bluePrintLoadConfiguration: BlueprintLoadConfiguration, + private val blueprintValidator: BlueprintValidatorService +) : BlueprintCatalogService { private val log = LoggerFactory.getLogger(BlueprintCatalogServiceImpl::class.java)!! @@ -51,8 +51,8 @@ abstract class BlueprintCatalogServiceImpl( workingDir = blueprintFile.absolutePath archiveFile = normalizedFile(bluePrintLoadConfiguration.blueprintArchivePath, processingId, "cba.zip") - if (!BluePrintArchiveUtils.compress(blueprintFile, archiveFile)) { - throw BluePrintException("Fail to compress blueprint") + if (!BlueprintArchiveUtils.compress(blueprintFile, archiveFile)) { + throw BlueprintException("Fail to compress blueprint") } } else { // Compressed File @@ -63,16 +63,16 @@ abstract class BlueprintCatalogServiceImpl( blueprintFile.deCompress(workingDir) } - var valid = BluePrintConstants.FLAG_N + var valid = BlueprintConstants.FLAG_N if (validate) { - blueprintValidator.validateBluePrints(workingDir!!) - valid = BluePrintConstants.FLAG_Y + blueprintValidator.validateBlueprints(workingDir!!) + valid = BlueprintConstants.FLAG_Y } - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(processingId, workingDir!!) + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(processingId, workingDir!!) val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = processingId - metadata[BluePrintConstants.PROPERTY_BLUEPRINT_VALID] = valid + metadata[BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = processingId + metadata[BlueprintConstants.PROPERTY_BLUEPRINT_VALID] = valid save(metadata, archiveFile) @@ -83,7 +83,7 @@ abstract class BlueprintCatalogServiceImpl( name, version, extract ) - ?: throw BluePrintException("Could not find blueprint $name:$version from database") + ?: throw BlueprintException("Could not find blueprint $name:$version from database") override suspend fun deleteFromDatabase(name: String, version: String) = delete(name, version) diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt index 6637c62ec..10a526365 100755 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt @@ -23,21 +23,21 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.cluster.optionalClusterServic import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelContent import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelRepository -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.common.ApplicationConstants -import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode import org.onap.ccsdk.cds.controllerblueprints.core.deCompress import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidatorService import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName import org.onap.ccsdk.cds.controllerblueprints.core.reCreateNBDirs -import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils +import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintCompileCache +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintFileUtils import org.slf4j.LoggerFactory import org.springframework.dao.DataIntegrityViolationException import org.springframework.stereotype.Service @@ -51,8 +51,8 @@ import java.util.UUID */ @Service("blueprintsProcessorCatalogService") class BlueprintProcessorCatalogServiceImpl( - bluePrintRuntimeValidatorService: BluePrintValidatorService, - private val bluePrintLoadConfiguration: BluePrintLoadConfiguration, + bluePrintRuntimeValidatorService: BlueprintValidatorService, + private val bluePrintLoadConfiguration: BlueprintLoadConfiguration, private val blueprintModelRepository: BlueprintModelRepository ) : BlueprintCatalogServiceImpl(bluePrintLoadConfiguration, bluePrintRuntimeValidatorService) { @@ -61,7 +61,7 @@ class BlueprintProcessorCatalogServiceImpl( override suspend fun delete(name: String, version: String) { // Clean blueprint script cache - val cacheKey = BluePrintFileUtils + val cacheKey = BlueprintFileUtils .compileCacheKey(normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath, name, version)) cleanClassLoader(cacheKey) log.info("removed cba file name($name), version($version) from cache") @@ -100,11 +100,11 @@ class BlueprintProcessorCatalogServiceImpl( } check(deployFile.exists() && deployFile.list().isNotEmpty()) { - throw BluePrintProcessorException("file check failed") + throw BlueprintProcessorException("file check failed") } } catch (e: Exception) { deleteNBDir(deployFile.absolutePath) - throw BluePrintProcessorException( + throw BlueprintProcessorException( "failed to get get cba file name($name), version($version) from db" + " : ${e.message}" ) @@ -121,11 +121,11 @@ class BlueprintProcessorCatalogServiceImpl( } override suspend fun save(metadata: MutableMap<String, String>, archiveFile: File) { - val artifactName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] - val artifactVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] + val artifactName = metadata[BlueprintConstants.METADATA_TEMPLATE_NAME] + val artifactVersion = metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION] check(archiveFile.isFile && !archiveFile.isDirectory) { - throw BluePrintException("Not a valid Archive file(${archiveFile.absolutePath})") + throw BlueprintException("Not a valid Archive file(${archiveFile.absolutePath})") } blueprintModelRepository.findByArtifactNameAndArtifactVersion(artifactName!!, artifactVersion!!)?.let { @@ -134,7 +134,7 @@ class BlueprintProcessorCatalogServiceImpl( val deployFile = normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath, artifactName, artifactVersion) - val cacheKey = BluePrintFileUtils.compileCacheKey(deployFile) + val cacheKey = BlueprintFileUtils.compileCacheKey(deployFile) cleanClassLoader(cacheKey) deleteNBDir(deployFile).let { @@ -144,20 +144,20 @@ class BlueprintProcessorCatalogServiceImpl( } val blueprintModel = BlueprintModel() - blueprintModel.id = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] + blueprintModel.id = metadata[BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] blueprintModel.artifactType = ApplicationConstants.ASDC_ARTIFACT_TYPE_SDNC_MODEL - blueprintModel.published = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_VALID] - ?: BluePrintConstants.FLAG_N + blueprintModel.published = metadata[BlueprintConstants.PROPERTY_BLUEPRINT_VALID] + ?: BlueprintConstants.FLAG_N blueprintModel.artifactName = artifactName blueprintModel.artifactVersion = artifactVersion - blueprintModel.updatedBy = metadata[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]!! - blueprintModel.tags = metadata[BluePrintConstants.METADATA_TEMPLATE_TAGS]!! + blueprintModel.updatedBy = metadata[BlueprintConstants.METADATA_TEMPLATE_AUTHOR]!! + blueprintModel.tags = metadata[BlueprintConstants.METADATA_TEMPLATE_TAGS]!! val description = - if (null != metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION] else "" + if (null != metadata[BlueprintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BlueprintConstants.METADATA_TEMPLATE_DESCRIPTION] else "" blueprintModel.artifactDescription = description val blueprintModelContent = BlueprintModelContent() - blueprintModelContent.id = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] + blueprintModelContent.id = metadata[BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] blueprintModelContent.contentType = "CBA_ZIP" blueprintModelContent.name = "$artifactName:$artifactVersion" blueprintModelContent.description = "$artifactName:$artifactVersion CBA Zip Content" @@ -169,7 +169,7 @@ class BlueprintProcessorCatalogServiceImpl( try { blueprintModelRepository.saveAndFlush(blueprintModel) } catch (ex: DataIntegrityViolationException) { - throw BluePrintException( + throw BlueprintException( ErrorCode.CONFLICT_ADDING_RESOURCE.value, "The blueprint entry " + "is already exist in database: ${ex.message}", @@ -179,9 +179,9 @@ class BlueprintProcessorCatalogServiceImpl( } private suspend fun cleanClassLoader(cacheKey: String) { - val clusterService = BluePrintDependencyService.optionalClusterService() + val clusterService = BlueprintDependencyService.optionalClusterService() if (null == clusterService) - BluePrintCompileCache.cleanClassLoader(cacheKey) + BlueprintCompileCache.cleanClassLoader(cacheKey) else { log.info("Sending ClusterMessage: Clean Classloader Cache") clusterService.sendMessage(BlueprintClusterTopic.BLUEPRINT_CLEAN_COMPILER_CACHE, cacheKey) diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt index b7b1f78cf..4084e156c 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImplTest.kt @@ -20,16 +20,16 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintCoreConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.mock.MockBlueprintProcessorCatalogServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.service.BlueprintCatalogServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.service.BlueprintProcessorCatalogServiceImpl -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.compress import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile -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.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.context.annotation.ComponentScan @@ -46,7 +46,7 @@ import kotlin.test.assertTrue @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor"]) @ContextConfiguration( classes = [ - BlueprintProcessorCatalogServiceImpl::class, BluePrintCoreConfiguration::class, + BlueprintProcessorCatalogServiceImpl::class, BlueprintCoreConfiguration::class, MockBlueprintProcessorCatalogServiceImpl::class ] ) @@ -57,9 +57,9 @@ class BlueprintProcessorCatalogServiceImplTest { lateinit var blueprintsProcessorCatalogService: BlueprintCatalogServiceImpl @Autowired - lateinit var blueprintCoreConfiguration: BluePrintCoreConfiguration + lateinit var blueprintCoreConfiguration: BlueprintCoreConfiguration - private lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + private lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> private val blueprintId = "1234" @@ -72,7 +72,7 @@ class BlueprintProcessorCatalogServiceImplTest { normalizedFile("./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") .compress(normalizedFile("./target/blueprints/generated-cba.zip")) - bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime( + bluePrintRuntimeService = BlueprintMetadataUtils.bluePrintRuntime( blueprintId, "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -103,7 +103,7 @@ class BlueprintProcessorCatalogServiceImplTest { val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId + metadata[BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId blueprintsProcessorCatalogService.save(metadata, file) } @@ -115,7 +115,7 @@ class BlueprintProcessorCatalogServiceImplTest { val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val metadata = bluePrintRuntimeService.bluePrintContext().metadata!! - metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId + metadata[BlueprintConstants.PROPERTY_BLUEPRINT_PROCESS_ID] = blueprintId blueprintsProcessorCatalogService.save(metadata, file) blueprintsProcessorCatalogService.get("baseconfiguration", "1.0.0", true) diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt index dd84e5b02..d182651af 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -68,12 +68,12 @@ class DatabasePropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_DB}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/TestDatabaseConfiguration.kt index d8192acfa..38a8ef427 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/TestDatabaseConfiguration.kt @@ -27,7 +27,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BluePrintDBLibConfiguration::class) +@Import(BlueprintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.db.primary"], entityManagerFactoryRef = "primaryEntityManager", diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt index 248181f16..6135f5bbd 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/mock/MockBlueprintProcessorCatalogServiceImpl.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db.mock import io.mockk.coEvery import io.mockk.mockk -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +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 @@ -26,10 +26,10 @@ import org.springframework.context.annotation.Configuration 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/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/AafAuthDmaapClientService.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/AafAuthDmaapClientService.kt index dfe95733f..587e020a4 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/AafAuthDmaapClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/AafAuthDmaapClientService.kt @@ -30,7 +30,7 @@ import com.att.nsa.mr.client.impl.MRSimplerBatchPublisher class AafAuthDmaapClientService( private val clientProps: AafAuthDmaapClientProperties ) : - BluePrintDmaapClientService { + BlueprintDmaapClientService { /** * The constructed DMAAP client. diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapClientService.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapClientService.kt index 82c3f3a80..c275e7e8b 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapClientService.kt @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit * properties provided. This abstraction also provides a mechanism to send * messages with the given partition in a session and closing the same. */ -interface BluePrintDmaapClientService { +interface BlueprintDmaapClientService { /** * Static variable for logging. @@ -39,7 +39,7 @@ interface BluePrintDmaapClientService { companion object { var log = LoggerFactory.getLogger( - BluePrintDmaapClientService::class.java + BlueprintDmaapClientService::class.java )!! } diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapLibConfiguration.kt index 20d9afdef..c64c33231 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapLibConfiguration.kt @@ -31,7 +31,7 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -open class BluePrintDmaapLibConfiguration +open class BlueprintDmaapLibConfiguration /** * Util constants required for DMAAP library to use. diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapLibPropertyService.kt index e5c9d432f..7bc9d605f 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BluePrintDmaapLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/BlueprintDmaapLibPropertyService.kt @@ -21,11 +21,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.dmaap import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.DmaapLibConstants.Companion.SERVICE_BLUEPRINT_DMAAP_LIB_PROPERTY import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.DmaapLibConstants.Companion.TYPE_HTTP_AAF_AUTH import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.DmaapLibConstants.Companion.TYPE_HTTP_NO_AUTH -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.beans.factory.annotation.Autowired @@ -46,7 +46,7 @@ import java.util.Properties @Service(SERVICE_BLUEPRINT_DMAAP_LIB_PROPERTY) @Configuration @PropertySources(PropertySource("classpath:event.properties")) -open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintDmaapLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { /** * Static variable for logging. @@ -54,7 +54,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi companion object { var log = LoggerFactory.getLogger( - BluePrintDmaapLibPropertyService::class.java + BlueprintDmaapLibPropertyService::class.java )!! } @@ -70,7 +70,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi * node. */ fun blueprintDmaapClientService(jsonNode: JsonNode): - BluePrintDmaapClientService { + BlueprintDmaapClientService { val dmaapProps = dmaapClientProperties(jsonNode) return blueprintDmaapClientService(dmaapProps) } @@ -80,7 +80,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi * selector string. */ fun blueprintDmaapClientService(selector: String): - BluePrintDmaapClientService { + BlueprintDmaapClientService { val prefix = "blueprintsprocessor.dmaapclient.$selector" val dmaapProps = dmaapClientProperties(prefix) return blueprintDmaapClientService(dmaapProps) @@ -112,7 +112,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi } else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "DMAAP adaptor($type) is " + "not supported" ) @@ -147,7 +147,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi } else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "DMAAP adaptor($type) is " + "not supported" ) @@ -160,7 +160,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi * Returns DMAAP client service according to the type of client properties. */ private fun blueprintDmaapClientService(clientProps: DmaapClientProperties): - BluePrintDmaapClientService { + BlueprintDmaapClientService { when (clientProps) { is HttpNoAuthDmaapClientProperties -> { return HttpNoAuthDmaapClientService(clientProps) @@ -171,7 +171,7 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi } else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "Unable to get the DMAAP " + "client" ) diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/HttpNoAuthDmaapClientService.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/HttpNoAuthDmaapClientService.kt index d4adfcaac..4f9f89ae2 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/HttpNoAuthDmaapClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/dmaap/HttpNoAuthDmaapClientService.kt @@ -31,7 +31,7 @@ class HttpNoAuthDmaapClientService( private val clientProps: HttpNoAuthDmaapClientProperties ) : - BluePrintDmaapClientService { + BlueprintDmaapClientService { /** * The constructed DMAAP client. diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt index e6043caae..c44f6a4a3 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt @@ -23,10 +23,10 @@ package org.ccsdk.apps.blueprintprocessor.dmaap import com.fasterxml.jackson.databind.ObjectMapper 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.dmaap.BluePrintDmaapLibConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.BluePrintDmaapLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.BlueprintDmaapLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.dmaap.BlueprintDmaapLibPropertyService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration @@ -51,8 +51,8 @@ import kotlin.test.assertNotNull @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ContextConfiguration( classes = [ - BluePrintDmaapLibConfiguration::class, TestController::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintDmaapLibConfiguration::class, TestController::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -69,7 +69,7 @@ import kotlin.test.assertNotNull class TestDmaapEventPublisher { @Autowired - lateinit var dmaapService: BluePrintDmaapLibPropertyService + lateinit var dmaapService: BlueprintDmaapLibPropertyService /** * Tests the event properties being set properly and sent as request. diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcExtensions.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcExtensions.kt index 97b462a3c..97b462a3c 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcExtensions.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcExtensions.kt diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcLibConfiguration.kt index e94400d9b..806e4c6f2 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcLibConfiguration.kt @@ -18,27 +18,27 @@ package org.onap.ccsdk.cds.blueprintsprocessor.grpc import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcClientService -import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcLibPropertyService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcClientService +import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcLibPropertyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @Configuration @ComponentScan -open class BluePrintGrpcLibConfiguration +open class BlueprintGrpcLibConfiguration /** * Exposed Dependency Service by this GRPC Lib Module */ -fun BluePrintDependencyService.grpcLibPropertyService(): BluePrintGrpcLibPropertyService = +fun BlueprintDependencyService.grpcLibPropertyService(): BlueprintGrpcLibPropertyService = instance(GRPCLibConstants.SERVICE_BLUEPRINT_GRPC_LIB_PROPERTY) -fun BluePrintDependencyService.grpcClientService(selector: String): BluePrintGrpcClientService { +fun BlueprintDependencyService.grpcClientService(selector: String): BlueprintGrpcClientService { return grpcLibPropertyService().blueprintGrpcClientService(selector) } -fun BluePrintDependencyService.grpcClientService(jsonNode: JsonNode): BluePrintGrpcClientService { +fun BlueprintDependencyService.grpcClientService(jsonNode: JsonNode): BlueprintGrpcClientService { return grpcLibPropertyService().blueprintGrpcClientService(jsonNode) } diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcLibData.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcLibData.kt index ebb9a5b32..ebb9a5b32 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BluePrintGrpcLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/BlueprintGrpcLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSL.kt index 8063e8909..853f74930 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.grpc 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.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,48 +30,48 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Types DSL for GRPC Server Producer */ fun ServiceTemplateBuilder.relationshipTypeConnectsToGrpcServer() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToGrpcServer() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToGrpcServer() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToGrpcServer(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToGrpcServer(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through GRPC Server." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } fun ServiceTemplateBuilder.relationshipTypeConnectsToGrpcClient() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToGrpcClient() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToGrpcClient() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToGrpcClient(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToGrpcClient(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through GRPC Client." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -89,25 +89,25 @@ fun TopologyTemplateBuilder.relationshipTemplateGrpcServer( class GrpcServerRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER, description ) { fun tokenAuth(block: GrpcServerTokenAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tokenAuthGrpcServerProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tokenAuthGrpcServerProperties(block)) } fun tlsAuth(block: GrpcServerTLSAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tlsAuthGrpcServerProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tlsAuthGrpcServerProperties(block)) } } -fun BluePrintTypes.tokenAuthGrpcServerProperties(block: GrpcServerTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tokenAuthGrpcServerProperties(block: GrpcServerTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = GrpcServerTokenAuthPropertiesAssignmentBuilder().apply(block).build() assignments[GrpcServerProperties::type.name] = GRPCLibConstants.TYPE_TOKEN_AUTH.asJsonPrimitive() return assignments.asJsonNode() } -fun BluePrintTypes.tlsAuthGrpcServerProperties(block: GrpcServerTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tlsAuthGrpcServerProperties(block: GrpcServerTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = GrpcServerTLSAuthPropertiesAssignmentBuilder().apply(block).build() assignments[GrpcServerProperties::type.name] = GRPCLibConstants.TYPE_TLS_AUTH.asJsonPrimitive() return assignments.asJsonNode() @@ -158,35 +158,35 @@ fun TopologyTemplateBuilder.relationshipTemplateGrpcClient( class GrpcClientRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT, description ) { fun basicAuth(block: GrpcClientBasicAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.basicAuthGrpcClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.basicAuthGrpcClientProperties(block)) } fun tokenAuth(block: GrpcClientTokenAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tokenAuthGrpcClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tokenAuthGrpcClientProperties(block)) } fun tlsAuth(block: GrpcClientTLSAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tlsAuthGrpcClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tlsAuthGrpcClientProperties(block)) } } -fun BluePrintTypes.basicAuthGrpcClientProperties(block: GrpcClientBasicAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.basicAuthGrpcClientProperties(block: GrpcClientBasicAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = GrpcClientBasicAuthPropertiesAssignmentBuilder().apply(block).build() assignments[GrpcClientProperties::type.name] = GRPCLibConstants.TYPE_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonNode() } -fun BluePrintTypes.tokenAuthGrpcClientProperties(block: GrpcClientTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tokenAuthGrpcClientProperties(block: GrpcClientTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = GrpcClientTokenAuthPropertiesAssignmentBuilder().apply(block).build() assignments[GrpcClientProperties::type.name] = GRPCLibConstants.TYPE_TOKEN_AUTH.asJsonPrimitive() return assignments.asJsonNode() } -fun BluePrintTypes.tlsAuthGrpcClientProperties(block: GrpcClientTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tlsAuthGrpcClientProperties(block: GrpcClientTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = GrpcClientTLSAuthPropertiesAssignmentBuilder().apply(block).build() assignments[GrpcClientProperties::type.name] = GRPCLibConstants.TYPE_TLS_AUTH.asJsonPrimitive() return assignments.asJsonNode() diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/interceptor/GrpcServerLoggingInterceptor.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/interceptor/GrpcServerLoggingInterceptor.kt index aaa4d5f26..7465ba044 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/interceptor/GrpcServerLoggingInterceptor.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/interceptor/GrpcServerLoggingInterceptor.kt @@ -23,11 +23,11 @@ import io.grpc.ServerCall import io.grpc.ServerCallHandler import io.grpc.ServerInterceptor import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.GrpcLoggerService -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.management.api.BluePrintDownloadInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintRemoveInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintUploadInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintDownloadInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintRemoveInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintUploadInput import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput import org.slf4j.MDC @@ -62,22 +62,22 @@ class GrpcServerLoggingInterceptor : ServerInterceptor { when (message) { is ExecutionServiceInput -> { val commonHeader = message.commonHeader - ?: throw BluePrintProcessorException("missing common header in request") + ?: throw BlueprintProcessorException("missing common header in request") loggingService.grpcRequesting(call, commonHeader, next) } - is BluePrintUploadInput -> { + is BlueprintUploadInput -> { val commonHeader = message.commonHeader - ?: throw BluePrintProcessorException("missing common header in request") + ?: throw BlueprintProcessorException("missing common header in request") loggingService.grpcRequesting(call, commonHeader, next) } - is BluePrintDownloadInput -> { + is BlueprintDownloadInput -> { val commonHeader = message.commonHeader - ?: throw BluePrintProcessorException("missing common header in request") + ?: throw BlueprintProcessorException("missing common header in request") loggingService.grpcRequesting(call, commonHeader, next) } - is BluePrintRemoveInput -> { + is BlueprintRemoveInput -> { val commonHeader = message.commonHeader - ?: throw BluePrintProcessorException("missing common header in request") + ?: throw BlueprintProcessorException("missing common header in request") loggingService.grpcRequesting(call, commonHeader, next) } else -> { diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BasicAuthGrpcClientService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BasicAuthGrpcClientService.kt index f7be8c66d..72453f596 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BasicAuthGrpcClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BasicAuthGrpcClientService.kt @@ -22,7 +22,7 @@ import io.grpc.netty.NettyChannelBuilder import org.onap.ccsdk.cds.blueprintsprocessor.grpc.BasicAuthGrpcClientProperties open class BasicAuthGrpcClientService(private val basicAuthGrpcClientProperties: BasicAuthGrpcClientProperties) : - BluePrintGrpcClientService { + BlueprintGrpcClientService { override suspend fun channel(): ManagedChannel { val managedChannel = NettyChannelBuilder diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcLibPropertyService.kt index a102ee6da..9b95edfc3 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcLibPropertyService.kt @@ -18,7 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.grpc.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.grpc.BasicAuthGrpcClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.GRPCLibConstants import org.onap.ccsdk.cds.blueprintsprocessor.grpc.GrpcClientProperties @@ -27,20 +27,20 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcServerProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcServerProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.stereotype.Service @Service(GRPCLibConstants.SERVICE_BLUEPRINT_GRPC_LIB_PROPERTY) -open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintGrpcLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { - fun blueprintGrpcServerService(jsonNode: JsonNode): BluePrintGrpcServerService { + fun blueprintGrpcServerService(jsonNode: JsonNode): BlueprintGrpcServerService { val grpcServerProperties = grpcServerProperties(jsonNode) return blueprintGrpcServerService(grpcServerProperties) } - fun blueprintGrpcServerService(selector: String): BluePrintGrpcServerService { + fun blueprintGrpcServerService(selector: String): BlueprintGrpcServerService { val prefix = "${GRPCLibConstants.PROPERTY_GRPC_SERVER_PREFIX}$selector" val grpcServerProperties = grpcServerProperties(prefix) return blueprintGrpcServerService(grpcServerProperties) @@ -56,7 +56,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic JacksonUtils.readValue(jsonNode, TLSAuthGrpcServerProperties::class.java)!! } else -> { - throw BluePrintProcessorException("Grpc type($type) not supported") + throw BlueprintProcessorException("Grpc type($type) not supported") } } } @@ -73,7 +73,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic tlsAuthGrpcServerProperties(prefix) } else -> { - throw BluePrintProcessorException("Grpc type($type) not supported") + throw BlueprintProcessorException("Grpc type($type) not supported") } } } @@ -87,25 +87,25 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic } private fun blueprintGrpcServerService(grpcServerProperties: GrpcServerProperties): - BluePrintGrpcServerService { + BlueprintGrpcServerService { when (grpcServerProperties) { is TLSAuthGrpcServerProperties -> { return TLSAuthGrpcServerService(grpcServerProperties) } else -> { - throw BluePrintProcessorException("couldn't get grpc client service for properties $grpcServerProperties") + throw BlueprintProcessorException("couldn't get grpc client service for properties $grpcServerProperties") } } } /** GRPC Client Lib Property Service */ - fun blueprintGrpcClientService(jsonNode: JsonNode): BluePrintGrpcClientService { + fun blueprintGrpcClientService(jsonNode: JsonNode): BlueprintGrpcClientService { val restClientProperties = grpcClientProperties(jsonNode) return blueprintGrpcClientService(restClientProperties) } - fun blueprintGrpcClientService(selector: String): BluePrintGrpcClientService { + fun blueprintGrpcClientService(selector: String): BlueprintGrpcClientService { val prefix = "${GRPCLibConstants.PROPERTY_GRPC_CLIENT_PREFIX}$selector" val restClientProperties = grpcClientProperties(prefix) return blueprintGrpcClientService(restClientProperties) @@ -113,7 +113,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic fun grpcClientProperties(jsonNode: JsonNode): GrpcClientProperties { val type = jsonNode.get("type").returnNullIfMissing()?.textValue() - ?: BluePrintProcessorException("missing type property") + ?: BlueprintProcessorException("missing type property") return when (type) { GRPCLibConstants.TYPE_TOKEN_AUTH -> { JacksonUtils.readValue(jsonNode, TokenAuthGrpcClientProperties::class.java)!! @@ -125,7 +125,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic JacksonUtils.readValue(jsonNode, BasicAuthGrpcClientProperties::class.java)!! } else -> { - throw BluePrintProcessorException("Grpc type($type) not supported") + throw BlueprintProcessorException("Grpc type($type) not supported") } } } @@ -145,13 +145,13 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic basicAuthGrpcClientProperties(prefix) } else -> { - throw BluePrintProcessorException("Grpc type($type) not supported") + throw BlueprintProcessorException("Grpc type($type) not supported") } } } fun blueprintGrpcClientService(grpcClientProperties: GrpcClientProperties): - BluePrintGrpcClientService { + BlueprintGrpcClientService { return when (grpcClientProperties) { is TokenAuthGrpcClientProperties -> { TokenAuthGrpcClientService(grpcClientProperties) @@ -163,7 +163,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesServic BasicAuthGrpcClientService(grpcClientProperties) } else -> { - throw BluePrintProcessorException("couldn't get grpc service for type(${grpcClientProperties.type})") + throw BlueprintProcessorException("couldn't get grpc service for type(${grpcClientProperties.type})") } } } diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcService.kt index d2db14a53..a9485b3c3 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcService.kt @@ -20,12 +20,12 @@ package org.onap.ccsdk.cds.blueprintsprocessor.grpc.service import io.grpc.ManagedChannel import io.grpc.netty.NettyServerBuilder -interface BluePrintGrpcServerService { +interface BlueprintGrpcServerService { fun serverBuilder(): NettyServerBuilder } -interface BluePrintGrpcClientService { +interface BlueprintGrpcClientService { suspend fun channel(): ManagedChannel } diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/GrpcLoggerService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/GrpcLoggerService.kt index 732f4fecf..a2be05d4d 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/GrpcLoggerService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/GrpcLoggerService.kt @@ -23,11 +23,11 @@ import io.grpc.ServerCallHandler import org.onap.ccsdk.cds.blueprintsprocessor.grpc.getStringKey import org.onap.ccsdk.cds.blueprintsprocessor.grpc.putStringKeyValue import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_INVOCATION_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_PARTNER_NAME -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_REQUEST_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_INVOCATION_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_PARTNER_NAME +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_REQUEST_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.defaultToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.defaultToUUID import org.onap.ccsdk.cds.controllerblueprints.core.logger @@ -75,7 +75,7 @@ class GrpcLoggerService { val localhost = InetAddress.getLocalHost() val clientSocketAddress = call.attributes.get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR) as? InetSocketAddress - ?: throw BluePrintProcessorException("failed to get client address") + ?: throw BlueprintProcessorException("failed to get client address") val serviceName = call.methodDescriptor.fullMethodName MDC.put("InvokeTimestamp", ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT)) @@ -94,7 +94,7 @@ class GrpcLoggerService { fun grpcInvoking(requestHeader: Metadata) { requestHeader.putStringKeyValue(ONAP_REQUEST_ID, MDC.get("InvocationID").defaultToUUID()) requestHeader.putStringKeyValue(ONAP_INVOCATION_ID, UUID.randomUUID().toString()) - requestHeader.putStringKeyValue(ONAP_PARTNER_NAME, BluePrintConstants.APP_NAME) + requestHeader.putStringKeyValue(ONAP_PARTNER_NAME, BlueprintConstants.APP_NAME) } /** Used when server returns response */ diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcClientService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcClientService.kt index 44df5fbe5..a8374d6e7 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcClientService.kt @@ -26,7 +26,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.interceptor.GrpcClientLogging import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile class TLSAuthGrpcClientService(private val tlsAuthGrpcClientProperties: TLSAuthGrpcClientProperties) : - BluePrintGrpcClientService { + BlueprintGrpcClientService { override suspend fun channel(): ManagedChannel { diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcServerService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcServerService.kt index 915ea1730..c5f8df425 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcServerService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TLSAuthGrpcServerService.kt @@ -25,7 +25,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcServerProperties import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile class TLSAuthGrpcServerService(private val tlsAuthGrpcServerProperties: TLSAuthGrpcServerProperties) : - BluePrintGrpcServerService { + BlueprintGrpcServerService { override fun serverBuilder(): NettyServerBuilder { return NettyServerBuilder diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TokenAuthGrpcClientService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TokenAuthGrpcClientService.kt index 4c991df1f..b14e1d6ad 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TokenAuthGrpcClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/TokenAuthGrpcClientService.kt @@ -30,7 +30,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.interceptor.GrpcClientLoggingInterceptor class TokenAuthGrpcClientService(private val tokenAuthGrpcClientProperties: TokenAuthGrpcClientProperties) : - BluePrintGrpcClientService { + BlueprintGrpcClientService { override suspend fun channel(): ManagedChannel { val target = diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSLTest.kt index 3de857fa5..1e7000e37 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/GrpcPropertiesDSLTest.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.grpc import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -60,12 +60,12 @@ class GrpcPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_SERVER}" ) } @@ -115,12 +115,12 @@ class GrpcPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_GRPC_CLIENT}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcLibPropertyServiceTest.kt index 30722c8e3..40e245ade 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcLibPropertyServiceTest.kt @@ -22,10 +22,10 @@ import com.fasterxml.jackson.databind.ObjectMapper import org.junit.Assert 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.grpc.BasicAuthGrpcClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.grpc.BluePrintGrpcLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.grpc.BlueprintGrpcLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcServerProperties import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties @@ -41,8 +41,8 @@ import kotlin.test.assertTrue @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BluePrintGrpcLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintGrpcLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -74,10 +74,10 @@ import kotlin.test.assertTrue "blueprintsprocessor.grpcclient.tls-sample.clientPrivateKey=client.key" ] ) -class BluePrintGrpcLibPropertyServiceTest { +class BlueprintGrpcLibPropertyServiceTest { @Autowired - lateinit var bluePrintGrpcLibPropertyService: BluePrintGrpcLibPropertyService + lateinit var bluePrintGrpcLibPropertyService: BlueprintGrpcLibPropertyService /** * Tests the GRPC client properties with selector for basic auth. diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcServerTest.kt index 026fe5af5..130175e64 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BlueprintGrpcServerTest.kt @@ -28,13 +28,13 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcServerProperties import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput import java.util.UUID import kotlin.test.Test import kotlin.test.assertNotNull -class BluePrintGrpcServerTest { +class BlueprintGrpcServerTest { private val tlsAuthGrpcServerProperties = TLSAuthGrpcServerProperties().apply { port = 50052 @@ -69,7 +69,7 @@ class BluePrintGrpcServerTest { val grpcChannel = tlsAuthGrpcClientService.channel() /** Get Send and Receive Channel for bidirectional process method*/ val (reqChannel, resChannel) = clientCallBidiStreaming( - BluePrintProcessingServiceGrpc.getProcessMethod(), + BlueprintProcessingServiceGrpc.getProcessMethod(), grpcChannel ) launch { diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBlueprintProcessingServer.kt index 78fa27d3a..5426d7327 100644 --- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt +++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBlueprintProcessingServer.kt @@ -23,11 +23,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.interceptor.GrpcServerLogging import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType import org.onap.ccsdk.cds.controllerblueprints.common.api.Status import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput -val log = logger(MockTLSBluePrintProcessingServer::class) +val log = logger(MockTLSBlueprintProcessingServer::class) /** For Integration testing stat this server, Set the working path to run this method */ fun main() { @@ -40,7 +40,7 @@ fun main() { } val server = TLSAuthGrpcServerService(tlsAuthGrpcServerProperties).serverBuilder() .intercept(GrpcServerLoggingInterceptor()) - .addService(MockTLSBluePrintProcessingServer()) + .addService(MockTLSBlueprintProcessingServer()) .build() server.start() log.info("GRPC Serve started(${server.isShutdown}) on port(${server.port})...") @@ -50,7 +50,7 @@ fun main() { } } -class MockTLSBluePrintProcessingServer : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() { +class MockTLSBlueprintProcessingServer : BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase() { override fun process(responseObserver: StreamObserver<ExecutionServiceOutput>): StreamObserver<ExecutionServiceInput> { diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageExtensions.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageExtensions.kt index 509689eca..509689eca 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageExtensions.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageExtensions.kt diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageLibConfiguration.kt index 659295a6b..88931d13f 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageLibConfiguration.kt @@ -18,10 +18,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.message import com.fasterxml.jackson.databind.JsonNode -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.BlueprintMessageProducerService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @@ -29,29 +29,29 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -open class BluePrintMessageLibConfiguration +open class BlueprintMessageLibConfiguration /** * Exposed Dependency Service by this Message Lib Module */ -fun BluePrintDependencyService.messageLibPropertyService(): BluePrintMessageLibPropertyService = +fun BlueprintDependencyService.messageLibPropertyService(): BlueprintMessageLibPropertyService = instance(MessageLibConstants.SERVICE_BLUEPRINT_MESSAGE_LIB_PROPERTY) /** Extension functions for message producer service **/ -fun BluePrintDependencyService.messageProducerService(selector: String): BlueprintMessageProducerService { +fun BlueprintDependencyService.messageProducerService(selector: String): BlueprintMessageProducerService { return messageLibPropertyService().blueprintMessageProducerService(selector) } -fun BluePrintDependencyService.messageProducerService(jsonNode: JsonNode): BlueprintMessageProducerService { +fun BlueprintDependencyService.messageProducerService(jsonNode: JsonNode): BlueprintMessageProducerService { return messageLibPropertyService().blueprintMessageProducerService(jsonNode) } /** Extension functions for message consumer service **/ -fun BluePrintDependencyService.messageConsumerService(selector: String): BlueprintMessageConsumerService { +fun BlueprintDependencyService.messageConsumerService(selector: String): BlueprintMessageConsumerService { return messageLibPropertyService().blueprintMessageConsumerService(selector) } -fun BluePrintDependencyService.messageConsumerService(jsonNode: JsonNode): BlueprintMessageConsumerService { +fun BlueprintDependencyService.messageConsumerService(jsonNode: JsonNode): BlueprintMessageConsumerService { return messageLibPropertyService().blueprintMessageConsumerService(jsonNode) } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageLibData.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageLibData.kt index 67dba1f19..67dba1f19 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BluePrintMessageLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/BlueprintMessageLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSL.kt index 8b31de9b9..527374f02 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.message 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.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,48 +30,48 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Types DSL for Message Producer */ fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageProducer() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageProducer() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToMessageProducer() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToMessageProducer(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToMessageProducer(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through message producer." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageConsumer() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageConsumer() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToMessageConsumer() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToMessageConsumer(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToMessageConsumer(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship type connects to message consumer." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -90,46 +90,46 @@ fun TopologyTemplateBuilder.relationshipTemplateMessageProducer( class MessageProducerRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, description ) { fun kafkaBasicAuth(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaBasicAuthMessageProducerProperties(block) ) } fun kafkaSslAuth(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaSslAuthMessageProducerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaSslAuthMessageProducerProperties(block) ) } fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaScramSslAuthMessageProducerProperties(block) ) } } -fun BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaBasicAuthMessageProducerProperties(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaBasicAuthMessageProducerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaSslAuthMessageProducerProperties(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaSslAuthMessageProducerProperties(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaSslAuthMessageProducerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaScramSslAuthMessageProducerProperties(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaScramSslAuthMessageProducerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive() @@ -245,88 +245,88 @@ fun TopologyTemplateBuilder.relationshipTemplateMessageConsumer( class MessageConsumerRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, description ) { fun kafkaBasicAuth(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaBasicAuthMessageConsumerProperties(block) ) } fun kafkaSslAuth(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaSslAuthMessageConsumerProperties(block) ) } fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaScramSslAuthMessageConsumerProperties(block) ) } fun kafkaStreamsBasicAuth(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaStreamsBasicAuthConsumerProperties(block) ) } fun kafkaStreamsSslAuth(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaStreamsSslAuthConsumerProperties(block) ) } fun kafkaStreamsScramSslAuth(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block) + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintTypes.kafkaStreamsScramSslAuthConsumerProperties(block) ) } } -fun BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaBasicAuthMessageConsumerProperties(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaBasicAuthMessageConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaSslAuthMessageConsumerProperties(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaSslAuthMessageConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaScramSslAuthMessageConsumerProperties(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaScramSslAuthMessageConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaStreamsBasicAuthConsumerProperties(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaStreamsBasicAuthConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaStreamsSslAuthConsumerProperties(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaStreamsSslAuthConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.kafkaStreamsScramSslAuthConsumerProperties(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build() assignments[KafkaStreamsScramSslAuthConsumerProperties::type.name] = MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH.asJsonPrimitive() diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/AbstractKafkaTopologyComponents.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/AbstractKafkaTopologyComponents.kt index 72a70893a..23eca18a3 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/AbstractKafkaTopologyComponents.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/AbstractKafkaTopologyComponents.kt @@ -24,9 +24,9 @@ import org.apache.kafka.streams.processor.Punctuator import org.onap.ccsdk.cds.controllerblueprints.core.logger /** CDS Kafka Stream Processor abstract class to implement */ -abstract class AbstractBluePrintMessageProcessor<K, V> : Processor<K, V> { +abstract class AbstractBlueprintMessageProcessor<K, V> : Processor<K, V> { - private val log = logger(AbstractBluePrintMessageProcessor::class) + private val log = logger(AbstractBlueprintMessageProcessor::class) lateinit var processorContext: ProcessorContext @@ -51,7 +51,7 @@ abstract class AbstractBluePrintMessageProcessor<K, V> : Processor<K, V> { } /** CDS Kafka Stream Punctuator abstract class to implement */ -abstract class AbstractBluePrintMessagePunctuator : Punctuator { +abstract class AbstractBlueprintMessagePunctuator : Punctuator { lateinit var processorContext: ProcessorContext diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/KafkaJDBCStores.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/KafkaJDBCStores.kt index 86ccd74a2..ecf5870ab 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/KafkaJDBCStores.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/kafka/KafkaJDBCStores.kt @@ -21,10 +21,10 @@ import org.apache.kafka.streams.processor.ProcessorContext import org.apache.kafka.streams.processor.StateStore import org.apache.kafka.streams.state.StoreBuilder import org.apache.kafka.streams.state.StoreSupplier -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.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import java.util.* @@ -32,7 +32,7 @@ class KafkaJDBCKeyStoreSupplier(private val name: String) : StoreSupplier<KafkaJ override fun get(): KafkaJDBCStore { // Get the DBLibGenericService Instance - val bluePrintDBLibGenericService = BluePrintDependencyService.primaryDBLibGenericService() + val bluePrintDBLibGenericService = BlueprintDependencyService.primaryDBLibGenericService() return KafkaJDBCStoreImpl(name, bluePrintDBLibGenericService) } @@ -98,7 +98,7 @@ interface KafkaJDBCStore : StateStore { class KafkaJDBCStoreImpl(private val name: String, - private val bluePrintDBLibGenericService: BluePrintDBLibGenericService) + private val bluePrintDBLibGenericService: BlueprintDBLibGenericService) : KafkaJDBCStore { private val log = logger(KafkaJDBCStoreImpl::class) diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerService.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerService.kt index b39d89bfd..887a7a7b8 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerService.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerService.kt @@ -23,7 +23,7 @@ import org.apache.kafka.clients.consumer.ConsumerRecord import org.apache.kafka.clients.consumer.ConsumerRecords import org.apache.kafka.streams.Topology import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException /** Consumer Function Interfaces */ interface ConsumerFunction @@ -47,7 +47,7 @@ interface BlueprintMessageConsumerService { /** Consume with [additionalConfig], so that we can execute dynamic function [consumerFunction] */ suspend fun consume(additionalConfig: Map<String, Any>?, consumerFunction: ConsumerFunction) { - throw BluePrintProcessorException("Not Implemented") + throw BlueprintProcessorException("Not Implemented") } /** Consume the [topics] with [additionalConfig], so that we can execute dynamic function [consumerFunction] */ @@ -56,7 +56,7 @@ interface BlueprintMessageConsumerService { additionalConfig: Map<String, Any>?, consumerFunction: ConsumerFunction ) { - throw BluePrintProcessorException("Not Implemented") + throw BlueprintProcessorException("Not Implemented") } /** close the channel, consumer and other resources */ diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BluePrintMessageLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageLibPropertyService.kt index 456bfbdd9..9e0c537cf 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BluePrintMessageLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageLibPropertyService.kt @@ -18,7 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.message.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaBasicAuthMessageConsumerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaBasicAuthMessageProducerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaScramSslAuthMessageConsumerProperties @@ -31,12 +31,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaStreamsSslAuthConsume import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageLibConstants import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageProducerProperties -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.springframework.stereotype.Service @Service(MessageLibConstants.SERVICE_BLUEPRINT_MESSAGE_LIB_PROPERTY) -open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintMessageLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { fun blueprintMessageProducerService(jsonNode: JsonNode): BlueprintMessageProducerService { val messageClientProperties = messageProducerProperties(jsonNode) @@ -68,7 +68,7 @@ open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesSer ) } else -> { - throw BluePrintProcessorException("Message adaptor($type) is not supported") + throw BlueprintProcessorException("Message adaptor($type) is not supported") } } } @@ -86,7 +86,7 @@ open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesSer JacksonUtils.readValue(jsonNode, KafkaScramSslAuthMessageProducerProperties::class.java)!! } else -> { - throw BluePrintProcessorException("Message adaptor($type) is not supported") + throw BlueprintProcessorException("Message adaptor($type) is not supported") } } } @@ -143,7 +143,7 @@ open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesSer ) } else -> { - throw BluePrintProcessorException("Message adaptor($type) is not supported") + throw BlueprintProcessorException("Message adaptor($type) is not supported") } } } @@ -172,7 +172,7 @@ open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesSer JacksonUtils.readValue(jsonNode, KafkaStreamsScramSslAuthConsumerProperties::class.java)!! } else -> { - throw BluePrintProcessorException("Message adaptor($type) is not supported") + throw BlueprintProcessorException("Message adaptor($type) is not supported") } } } @@ -214,7 +214,7 @@ open class BluePrintMessageLibPropertyService(private var bluePrintPropertiesSer ) } else -> { - throw BluePrintProcessorException("couldn't get message client service for ${messageConsumerProperties.type}") + throw BlueprintProcessorException("couldn't get message client service for ${messageConsumerProperties.type}") } } } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerService.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerService.kt index 4340e4815..beaa995df 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerService.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerService.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.channels.Channel import org.apache.kafka.clients.consumer.ConsumerRecord import org.apache.kafka.streams.KafkaStreams import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties -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 java.util.Properties @@ -41,11 +41,11 @@ open class KafkaStreamsConsumerService(private val messageConsumerProperties: Me } override suspend fun subscribe(additionalConfig: Map<String, Any>?): Channel<ConsumerRecord<String, ByteArray>> { - throw BluePrintProcessorException("not implemented") + throw BlueprintProcessorException("not implemented") } override suspend fun subscribe(topics: List<String>, additionalConfig: Map<String, Any>?): Channel<ConsumerRecord<String, ByteArray>> { - throw BluePrintProcessorException("not implemented") + throw BlueprintProcessorException("not implemented") } override suspend fun consume(additionalConfig: Map<String, Any>?, consumerFunction: ConsumerFunction) { diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerService.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerService.kt index 90b850017..7e5f35d15 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerService.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerService.kt @@ -21,7 +21,7 @@ import org.apache.kafka.common.header.Headers import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.cds.blueprintsprocessor.message.addHeader import org.onap.ccsdk.cds.blueprintsprocessor.message.toMap -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.defaultToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.defaultToUUID import org.onap.ccsdk.cds.controllerblueprints.core.logger @@ -46,9 +46,9 @@ class MessageLoggerService { fun messageConsuming(consumerRecord: ConsumerRecord<*, *>) { val headers = consumerRecord.headers().toMap() - val requestID = headers[BluePrintConstants.ONAP_REQUEST_ID].defaultToUUID() - val invocationID = headers[BluePrintConstants.ONAP_INVOCATION_ID].defaultToUUID() - val partnerName = headers[BluePrintConstants.ONAP_PARTNER_NAME] ?: "UNKNOWN" + val requestID = headers[BlueprintConstants.ONAP_REQUEST_ID].defaultToUUID() + val invocationID = headers[BlueprintConstants.ONAP_INVOCATION_ID].defaultToUUID() + val partnerName = headers[BlueprintConstants.ONAP_PARTNER_NAME] ?: "UNKNOWN" messageConsuming(requestID, invocationID, partnerName, consumerRecord) } @@ -83,9 +83,9 @@ class MessageLoggerService { */ fun messageProducing(requestHeader: Headers) { val localhost = InetAddress.getLocalHost() - requestHeader.addHeader(BluePrintConstants.ONAP_REQUEST_ID, MDC.get("InvocationID").defaultToUUID()) - requestHeader.addHeader(BluePrintConstants.ONAP_INVOCATION_ID, UUID.randomUUID().toString()) - requestHeader.addHeader(BluePrintConstants.ONAP_PARTNER_NAME, BluePrintConstants.APP_NAME) + requestHeader.addHeader(BlueprintConstants.ONAP_REQUEST_ID, MDC.get("InvocationID").defaultToUUID()) + requestHeader.addHeader(BlueprintConstants.ONAP_INVOCATION_ID, UUID.randomUUID().toString()) + requestHeader.addHeader(BlueprintConstants.ONAP_PARTNER_NAME, BlueprintConstants.APP_NAME) requestHeader.addHeader("ClientIPAddress", localhost.hostAddress) } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSLTest.kt index b68678baf..8130016a8 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/MessagePropertiesDSLTest.kt @@ -18,7 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.message import org.apache.kafka.streams.StreamsConfig import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -67,12 +67,12 @@ class MessagePropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER}" ) } @@ -138,12 +138,12 @@ class MessagePropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerServiceTest.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerServiceTest.kt index a69f9f51a..f240f76c0 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageConsumerServiceTest.kt @@ -40,9 +40,9 @@ import org.apache.kafka.common.serialization.ByteArrayDeserializer import org.apache.kafka.common.serialization.StringDeserializer 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.message.BluePrintMessageLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.message.BlueprintMessageLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageLibConstants import org.onap.ccsdk.cds.controllerblueprints.core.logger @@ -60,8 +60,8 @@ import kotlin.test.assertTrue @DirtiesContext @ContextConfiguration( classes = [ - BluePrintMessageLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintMessageLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -98,7 +98,7 @@ open class BlueprintMessageConsumerServiceTest { val log = logger(BlueprintMessageConsumerServiceTest::class) @Autowired - lateinit var bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService + lateinit var bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService @Test fun testKafkaBasicAuthConsumerService() { diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageProducerServiceTest.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageProducerServiceTest.kt index f88caa173..2293ceec3 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageProducerServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/BlueprintMessageProducerServiceTest.kt @@ -32,9 +32,9 @@ import org.apache.kafka.common.security.scram.ScramLoginModule import org.apache.kafka.common.serialization.ByteArraySerializer import org.apache.kafka.common.serialization.StringSerializer 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.message.BluePrintMessageLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.message.BlueprintMessageLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageLibConstants import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.annotation.DirtiesContext @@ -50,8 +50,8 @@ import kotlin.test.assertTrue @DirtiesContext @ContextConfiguration( classes = [ - BluePrintMessageLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintMessageLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -72,7 +72,7 @@ import kotlin.test.assertTrue open class BlueprintMessageProducerServiceTest { @Autowired - lateinit var bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService + lateinit var bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService @Test fun testKafkaScramSslAuthProducerService() { @@ -87,11 +87,11 @@ open class BlueprintMessageProducerServiceTest { every { mockKafkaTemplate.send(any(), any()) } returns responseMock - val spyBluePrintMessageProducerService = spyk(blueprintMessageProducerService, recordPrivateCalls = true) + val spyBlueprintMessageProducerService = spyk(blueprintMessageProducerService, recordPrivateCalls = true) - every { spyBluePrintMessageProducerService.messageTemplate(any()) } returns mockKafkaTemplate + every { spyBlueprintMessageProducerService.messageTemplate(any()) } returns mockKafkaTemplate - val response = spyBluePrintMessageProducerService.sendMessage("mykey", "Testing message") + val response = spyBlueprintMessageProducerService.sendMessage("mykey", "Testing message") assertTrue(response, "failed to get command response") } } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerServiceTest.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerServiceTest.kt index f488a4c74..70968ef0c 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/KafkaStreamsConsumerServiceTest.kt @@ -26,9 +26,9 @@ import org.apache.kafka.streams.processor.ProcessorSupplier import org.apache.kafka.streams.state.Stores 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.message.BluePrintMessageLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.message.BlueprintMessageLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.message.KafkaStreamsBasicAuthConsumerProperties import org.onap.ccsdk.cds.blueprintsprocessor.message.MessageConsumerProperties import org.springframework.beans.factory.annotation.Autowired @@ -42,8 +42,8 @@ import kotlin.test.assertNotNull @DirtiesContext @ContextConfiguration( classes = [ - BluePrintMessageLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintMessageLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -72,7 +72,7 @@ import kotlin.test.assertNotNull class KafkaStreamsConsumerServiceTest { @Autowired - lateinit var bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService + lateinit var bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService @Test fun testProperties() { diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerServiceTest.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerServiceTest.kt index 3dce3344f..dc36ac675 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MessageLoggerServiceTest.kt @@ -23,7 +23,7 @@ import org.apache.kafka.common.header.internals.RecordHeaders import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.cds.blueprintsprocessor.message.toMap -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.slf4j.MDC import kotlin.test.assertEquals @@ -51,7 +51,7 @@ class MessageLoggerServiceTest { val mockHeaders = RecordHeaders() messageLoggerService.messageProducing(mockHeaders) val map = mockHeaders.toMap() - assertEquals("1234-12", map[BluePrintConstants.ONAP_REQUEST_ID]) + assertEquals("1234-12", map[BlueprintConstants.ONAP_REQUEST_ID]) messageLoggerService.messageConsumingExisting() } diff --git a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MockKafkaTopologyComponents.kt b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MockKafkaTopologyComponents.kt index aa38b6e5c..97a81f1cd 100644 --- a/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MockKafkaTopologyComponents.kt +++ b/ms/blueprintsprocessor/modules/commons/message-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/message/service/MockKafkaTopologyComponents.kt @@ -22,7 +22,7 @@ import org.apache.kafka.common.serialization.Serializer import org.apache.kafka.streams.processor.Processor import org.apache.kafka.streams.processor.ProcessorContext import org.apache.kafka.streams.state.KeyValueStore -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.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -48,7 +48,7 @@ open class PriorityMessageSerde : Serde<PriorityMessage> { return object : Deserializer<PriorityMessage> { override fun deserialize(topic: String, data: ByteArray): PriorityMessage { return JacksonUtils.readValue(String(data), PriorityMessage::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/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsExtensions.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsExtensions.kt index a585c972b..a585c972b 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsExtensions.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsExtensions.kt diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsLibConfiguration.kt index a47dd8918..c83906c3f 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsLibConfiguration.kt @@ -16,23 +16,23 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsLibPropertyService -import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BluePrintNatsService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.nats.service.BlueprintNatsService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @Configuration @ComponentScan -open class BluePrintNatsLibConfiguration +open class BlueprintNatsLibConfiguration /** * Exposed Dependency Service by this NATS Lib Module */ -fun BluePrintDependencyService.natsLibPropertyService(): BluePrintNatsLibPropertyService = +fun BlueprintDependencyService.natsLibPropertyService(): BlueprintNatsLibPropertyService = instance(NatsLibConstants.SERVICE_BLUEPRINT_NATS_LIB_PROPERTY) -fun BluePrintDependencyService.controllerNatsService(): BluePrintNatsService { +fun BlueprintDependencyService.controllerNatsService(): BlueprintNatsService { return natsLibPropertyService().bluePrintNatsService(NatsLibConstants.DEFULT_NATS_SELECTOR) } diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsLibData.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsLibData.kt index a989dcf1e..a989dcf1e 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BluePrintNatsLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/BlueprintNatsLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSL.kt index 4c5471796..9e771a6e5 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats 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.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,25 +30,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Types DSL for NATS Producer */ fun ServiceTemplateBuilder.relationshipTypeConnectsToNats() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToNats() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToNats() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToNats(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToNats(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through NATS Client." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -66,25 +66,25 @@ fun TopologyTemplateBuilder.relationshipTemplateNats( class NatsRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS, description ) { fun tokenAuth(block: NatsTokenAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tokenAuthNatsProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tokenAuthNatsProperties(block)) } fun tlsAuth(block: NatsTLSAuthPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tlsAuthNatsProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tlsAuthNatsProperties(block)) } } -fun BluePrintTypes.tokenAuthNatsProperties(block: NatsTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tokenAuthNatsProperties(block: NatsTokenAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = NatsTokenAuthPropertiesAssignmentBuilder().apply(block).build() assignments[NatsConnectionProperties::type.name] = NatsLibConstants.TYPE_TOKEN_AUTH.asJsonPrimitive() return assignments.asJsonNode() } -fun BluePrintTypes.tlsAuthNatsProperties(block: NatsTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tlsAuthNatsProperties(block: NatsTLSAuthPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = NatsTLSAuthPropertiesAssignmentBuilder().apply(block).build() assignments[NatsConnectionProperties::type.name] = NatsLibConstants.TYPE_TLS_AUTH.asJsonPrimitive() return assignments.asJsonNode() diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsLibPropertyService.kt index 1ac44bc94..457bf8703 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsLibPropertyService.kt @@ -17,24 +17,24 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsConnectionProperties import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsLibConstants import org.onap.ccsdk.cds.blueprintsprocessor.nats.TLSAuthNatsConnectionProperties import org.onap.ccsdk.cds.blueprintsprocessor.nats.TokenAuthNatsConnectionProperties -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.springframework.stereotype.Service @Service(NatsLibConstants.SERVICE_BLUEPRINT_NATS_LIB_PROPERTY) -open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintNatsLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { - fun bluePrintNatsService(jsonNode: JsonNode): BluePrintNatsService { + fun bluePrintNatsService(jsonNode: JsonNode): BlueprintNatsService { val natsConnectionProperties = natsConnectionProperties(jsonNode) return bluePrintNatsService(natsConnectionProperties) } - fun bluePrintNatsService(selector: String): BluePrintNatsService { + fun bluePrintNatsService(selector: String): BlueprintNatsService { val prefix = "${NatsLibConstants.PROPERTY_NATS_PREFIX}$selector" val natsConnectionProperties = natsConnectionProperties(prefix) return bluePrintNatsService(natsConnectionProperties) @@ -50,7 +50,7 @@ open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesServic JacksonUtils.readValue(jsonNode, TLSAuthNatsConnectionProperties::class.java)!! } else -> { - throw BluePrintProcessorException("NATS type($type) not supported") + throw BlueprintProcessorException("NATS type($type) not supported") } } } @@ -65,7 +65,7 @@ open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesServic tlsAuthNatsConnectionProperties(prefix) } else -> { - throw BluePrintProcessorException("NATS type($type) not supported") + throw BlueprintProcessorException("NATS type($type) not supported") } } } @@ -79,7 +79,7 @@ open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesServic } fun bluePrintNatsService(natsConnectionProperties: NatsConnectionProperties): - BluePrintNatsService { + BlueprintNatsService { return when (natsConnectionProperties) { is TokenAuthNatsConnectionProperties -> { TokenAuthNatsService(natsConnectionProperties) @@ -88,7 +88,7 @@ open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesServic TLSAuthNatsService(natsConnectionProperties) } else -> { - throw BluePrintProcessorException("couldn't get NATS service for properties $natsConnectionProperties") + throw BlueprintProcessorException("couldn't get NATS service for properties $natsConnectionProperties") } } } diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsService.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsService.kt index 9548fe78d..67de95133 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsService.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsService.kt @@ -25,7 +25,7 @@ import io.nats.streaming.Subscription import io.nats.streaming.SubscriptionOptions import java.time.Duration -interface BluePrintNatsService { +interface BlueprintNatsService { /** Create and Return the NATS streaming connection */ suspend fun connection(): StreamingConnection diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TLSAuthNatsService.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TLSAuthNatsService.kt index 00a972eff..1bde8e534 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TLSAuthNatsService.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TLSAuthNatsService.kt @@ -25,7 +25,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.splitCommaAsList import javax.net.ssl.SSLContext open class TLSAuthNatsService(private val natsConnectionProperties: TLSAuthNatsConnectionProperties) : - BluePrintNatsService { + BlueprintNatsService { lateinit var streamingConnection: StreamingConnection diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TokenAuthNatsService.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TokenAuthNatsService.kt index 7c24b70d0..9d4aacfbd 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TokenAuthNatsService.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/TokenAuthNatsService.kt @@ -25,7 +25,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.splitCommaAsList open class TokenAuthNatsService(private val natsConnectionProperties: TokenAuthNatsConnectionProperties) : - BluePrintNatsService { + BlueprintNatsService { private val log = logger(TokenAuthNatsService::class) diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/utils/NatsClusterUtils.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/utils/NatsClusterUtils.kt index a7726a14b..a155a076d 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/utils/NatsClusterUtils.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/utils/NatsClusterUtils.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats.utils import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsLibConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils object NatsClusterUtils { @@ -32,7 +32,7 @@ object NatsClusterUtils { } fun currentApplicationSubject(subject: String): String { - return "${BluePrintConstants.APP_NAME}.$subject" + return "${BlueprintConstants.APP_NAME}.$subject" } fun currentNodeDurable(subject: String): String { @@ -40,6 +40,6 @@ object NatsClusterUtils { } fun applicationLoadBalanceGroup(): String { - return "${BluePrintConstants.APP_NAME}" + return "${BlueprintConstants.APP_NAME}" } } diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSLTest.kt index a95b900fe..fa70f0738 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/NatsPropertiesDSLTest.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.getInput import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate @@ -59,12 +59,12 @@ class NatsPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_NATS}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsExtensionsTest.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsExtensionsTest.kt index ec120dc18..816b6c809 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsExtensionsTest.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsExtensionsTest.kt @@ -27,7 +27,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType import java.nio.charset.Charset import kotlin.test.assertEquals -class BluePrintNatsExtensionsTest { +class BlueprintNatsExtensionsTest { @Test fun testMessageStrConversion() { diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsLibPropertyServiceTest.kt index 9a332d589..5ef4a72c6 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsLibPropertyServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsLibPropertyServiceTest.kt @@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.nats.service 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.nats.BluePrintNatsLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.nats.BlueprintNatsLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsLibConstants import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -31,8 +31,8 @@ import kotlin.test.assertTrue @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BluePrintNatsLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintNatsLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -43,10 +43,10 @@ import kotlin.test.assertTrue "blueprintsprocessor.nats.cds-controller.token=tokenAuth" ] ) -class BluePrintNatsLibPropertyServiceTest { +class BlueprintNatsLibPropertyServiceTest { @Autowired - lateinit var bluePrintNatsLibPropertyService: BluePrintNatsLibPropertyService + lateinit var bluePrintNatsLibPropertyService: BlueprintNatsLibPropertyService @Test fun testNatsProperties() { diff --git a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsServiceTest.kt b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsServiceTest.kt index 721828ac9..8e7ee63f1 100644 --- a/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BluePrintNatsServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/nats-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/nats/service/BlueprintNatsServiceTest.kt @@ -31,7 +31,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.nats.utils.SubscriptionOptionsUtil import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType import kotlin.test.assertNotNull -class BluePrintNatsServiceTest { +class BlueprintNatsServiceTest { @Test fun testTokenAuthNatService() { @@ -42,18 +42,18 @@ class BluePrintNatsServiceTest { } """.trimIndent() - val bluePrintNatsLibPropertyService = BluePrintNatsLibPropertyService(mockk()) + val bluePrintNatsLibPropertyService = BlueprintNatsLibPropertyService(mockk()) - val spkBluePrintNatsLibPropertyService = spyk(bluePrintNatsLibPropertyService) + val spkBlueprintNatsLibPropertyService = spyk(bluePrintNatsLibPropertyService) every { - spkBluePrintNatsLibPropertyService + spkBlueprintNatsLibPropertyService .bluePrintNatsService(any<NatsConnectionProperties>()) } returns TokenAuthNatsService( mockk() ) val bluePrintNatsService = - spkBluePrintNatsLibPropertyService.bluePrintNatsService(configuration.jsonAsJsonType()) + spkBlueprintNatsLibPropertyService.bluePrintNatsService(configuration.jsonAsJsonType()) assertNotNull(bluePrintNatsService, "failed to get NATS Service") } @@ -65,18 +65,18 @@ class BluePrintNatsServiceTest { } """.trimIndent() - val bluePrintNatsLibPropertyService = BluePrintNatsLibPropertyService(mockk()) + val bluePrintNatsLibPropertyService = BlueprintNatsLibPropertyService(mockk()) - val spkBluePrintNatsLibPropertyService = spyk(bluePrintNatsLibPropertyService) + val spkBlueprintNatsLibPropertyService = spyk(bluePrintNatsLibPropertyService) every { - spkBluePrintNatsLibPropertyService + spkBlueprintNatsLibPropertyService .bluePrintNatsService(any<NatsConnectionProperties>()) } returns TLSAuthNatsService( mockk() ) val bluePrintNatsService = - spkBluePrintNatsLibPropertyService.bluePrintNatsService(configuration.jsonAsJsonType()) + spkBlueprintNatsLibPropertyService.bluePrintNatsService(configuration.jsonAsJsonType()) assertNotNull(bluePrintNatsService, "failed to get NATS Service") } @@ -114,7 +114,7 @@ class BluePrintNatsServiceTest { } } - private fun testMultiPublish(natsService: BluePrintNatsService) { + private fun testMultiPublish(natsService: BlueprintNatsService) { runBlocking { /** Multiple Publish Message Test **/ val messageHandler1 = @@ -131,7 +131,7 @@ class BluePrintNatsServiceTest { } } - private fun testLoadBalance(natsService: BluePrintNatsService) { + private fun testLoadBalance(natsService: BlueprintNatsService) { runBlocking { /** Load balance Publish Message Test **/ val lbMessageHandler1 = @@ -150,7 +150,7 @@ class BluePrintNatsServiceTest { } } - private fun testLimitSubscription(natsService: BluePrintNatsService) { + private fun testLimitSubscription(natsService: BlueprintNatsService) { runBlocking { /** Load balance Publish Message Test **/ val lbMessageHandler1 = @@ -185,7 +185,7 @@ class BluePrintNatsServiceTest { } } - private fun testRequestReply(natsService: BluePrintNatsService) { + private fun testRequestReply(natsService: BlueprintNatsService) { runBlocking { val lbMessageHandler1 = io.nats.client.MessageHandler { message -> println("LB RR Request Handler 1: ${String(message.data)} will reply to(${message.replyTo})") @@ -217,7 +217,7 @@ class BluePrintNatsServiceTest { } } - private fun testMultiRequestReply(natsService: BluePrintNatsService) { + private fun testMultiRequestReply(natsService: BlueprintNatsService) { runBlocking { /** Request Reply **/ val lbMessageHandler1 = io.nats.client.MessageHandler { message -> diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BlueprintCoreConfiguration.kt index 2a4d05dcb..782a7b033 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BlueprintCoreConfiguration.kt @@ -17,10 +17,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration 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.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.bind.Bindable @@ -33,7 +33,7 @@ import org.springframework.core.env.Environment import org.springframework.stereotype.Service @Configuration -open class BluePrintCoreConfiguration(private val bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintCoreConfiguration(private val bluePrintPropertiesService: BlueprintPropertiesService) { companion object { @@ -41,14 +41,14 @@ open class BluePrintCoreConfiguration(private val bluePrintPropertiesService: Bl } @Bean - open fun bluePrintLoadConfiguration(): BluePrintLoadConfiguration { + open fun bluePrintLoadConfiguration(): BlueprintLoadConfiguration { return bluePrintPropertiesService - .propertyBeanType(PREFIX_BLUEPRINT_PROCESSOR, BluePrintLoadConfiguration::class.java) + .propertyBeanType(PREFIX_BLUEPRINT_PROCESSOR, BlueprintLoadConfiguration::class.java) } } @Configuration -open class BluePrintPropertyConfiguration { +open class BlueprintPropertyConfiguration { @Autowired lateinit var environment: Environment @@ -60,9 +60,9 @@ open class BluePrintPropertyConfiguration { } @Service -open class BluePrintPropertiesService(private var bluePrintPropertyConfig: BluePrintPropertyConfiguration) { +open class BlueprintPropertiesService(private var bluePrintPropertyConfig: BlueprintPropertyConfiguration) { - private val log = logger(BluePrintPropertiesService::class) + private val log = logger(BlueprintPropertiesService::class) fun <T> propertyBeanType(prefix: String, type: Class<T>): T { return try { @@ -70,7 +70,7 @@ open class BluePrintPropertiesService(private var bluePrintPropertyConfig: BlueP } catch (e: NoSuchElementException) { val errMsg = "Error: missing property \"$prefix\"... Check the application.properties file." log.error(errMsg) - throw BluePrintProcessorException(e, errMsg) + throw BlueprintProcessorException(e, errMsg) } } } @@ -82,7 +82,7 @@ open class BlueprintDependencyConfiguration : ApplicationContextAware { private val log = LoggerFactory.getLogger(BlueprintDependencyConfiguration::class.java)!! override fun setApplicationContext(applicationContext: ApplicationContext) { - BluePrintDependencyService.inject(applicationContext) + BlueprintDependencyService.inject(applicationContext) log.info("Dependency Management module created...") } } diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt index 61997061b..924aed898 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt @@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode import io.swagger.annotations.ApiModelProperty import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import java.util.Date import java.util.UUID @@ -154,7 +154,7 @@ open class Status { var errorMessage: String? = null @get:ApiModelProperty(required = true, value = "Message providing request status") - var message: String = BluePrintConstants.STATUS_SUCCESS + var message: String = BlueprintConstants.STATUS_SUCCESS } open class StepData { diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BluePrintClusterExtensions.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BlueprintClusterExtensions.kt index 0a58857f7..f0504555f 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BluePrintClusterExtensions.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BlueprintClusterExtensions.kt @@ -20,30 +20,30 @@ import com.hazelcast.cluster.Member import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.newSingleThreadContext import kotlinx.coroutines.withContext -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterMember -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService /** * Exposed Dependency Service by this Hazelcast Lib Module */ -fun BluePrintDependencyService.clusterService(): BluePrintClusterService = +fun BlueprintDependencyService.clusterService(): BlueprintClusterService = instance(HazelcastClusterService::class) /** Optional Cluster Service, returns only if Cluster is enabled */ -fun BluePrintDependencyService.optionalClusterService(): BluePrintClusterService? { - return if (BluePrintConstants.CLUSTER_ENABLED) { - BluePrintDependencyService.clusterService() +fun BlueprintDependencyService.optionalClusterService(): BlueprintClusterService? { + return if (BlueprintConstants.CLUSTER_ENABLED) { + BlueprintDependencyService.clusterService() } else null } /** Extension to convert Hazelcast Member to Blueprints Cluster Member */ fun Member.toClusterMember(): ClusterMember { - val memberName: String = this.getAttribute(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID) ?: this.uuid.toString() + val memberName: String = this.getAttribute(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID) ?: this.uuid.toString() return ClusterMember( id = this.uuid.toString(), name = memberName, @@ -69,7 +69,7 @@ suspend fun <R> ClusterLock.executeWithLock(acquireLockTimeout: Long, block: sus lock.unLock() } } else - throw BluePrintException("Failed to acquire lock within timeout") + throw BlueprintException("Failed to acquire lock within timeout") } } } diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterService.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterService.kt index fb9056776..613fc4a58 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterService.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterService.kt @@ -33,15 +33,15 @@ import com.hazelcast.scheduledexecutor.IScheduledExecutorService import com.hazelcast.topic.Message import com.hazelcast.topic.MessageListener import kotlinx.coroutines.delay -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterMessage -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessage +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessageListener import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterInfo import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterJoinedEvent import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterMember -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.logger import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils @@ -53,7 +53,7 @@ import java.util.UUID import java.util.concurrent.TimeUnit @Service -open class HazelcastClusterService(private val applicationEventPublisher: ApplicationEventPublisher) : BluePrintClusterService { +open class HazelcastClusterService(private val applicationEventPublisher: ApplicationEventPublisher) : BlueprintClusterService { private val log = logger(HazelcastClusterService::class) lateinit var hazelcast: HazelcastInstance @@ -78,12 +78,12 @@ open class HazelcastClusterService(private val applicationEventPublisher: Applic } is ClusterInfo -> { - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_ID, configuration.id) - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID, configuration.nodeId) + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_ID, configuration.id) + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID, configuration.nodeId) val memberAttributeConfig = MemberAttributeConfig() memberAttributeConfig.setAttribute( - BluePrintConstants.PROPERTY_CLUSTER_NODE_ID, + BlueprintConstants.PROPERTY_CLUSTER_NODE_ID, configuration.nodeId ) @@ -122,7 +122,7 @@ open class HazelcastClusterService(private val applicationEventPublisher: Applic } } else -> { - throw BluePrintProcessorException("couldn't understand the cluster configuration") + throw BlueprintProcessorException("couldn't understand the cluster configuration") } } @@ -179,7 +179,7 @@ open class HazelcastClusterService(private val applicationEventPublisher: Applic return ClusterLockImpl(hazelcast, name) } - /** Return interface may change and it will be included in BluePrintClusterService */ + /** Return interface may change and it will be included in BlueprintClusterService */ @UseExperimental suspend fun clusterScheduler(name: String): IScheduledExecutorService { check(::hazelcast.isInitialized) { "failed to start and join cluster" } @@ -225,7 +225,7 @@ open class HazelcastClusterService(private val applicationEventPublisher: Applic check(::hazelcast.isInitialized) { "failed to start and join cluster" } val applicationMembers: MutableMap<String, Member> = hashMapOf() hazelcast.cluster.members.map { member -> - val memberName: String = member.getAttribute(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID) + val memberName: String = member.getAttribute(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID) if (memberName.startsWith(appName, true)) { applicationMembers[memberName] = member } @@ -300,7 +300,7 @@ open class ClusterLockImpl(private val hazelcast: HazelcastInstance, private val class HazelcastMessageListenerAdapter<E>(val listener: BlueprintClusterMessageListener<E>) : MessageListener<E> { override fun onMessage(message: Message<E>?) = message?.let { - BluePrintClusterMessage<E>( + BlueprintClusterMessage<E>( BlueprintClusterTopic.valueOf(it.source as String), it.messageObject, it.publishTime, diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/factory/ComponentNodeFactory.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/factory/ComponentNodeFactory.kt index 2f925dc5b..46ab25e23 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/factory/ComponentNodeFactory.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/factory/ComponentNodeFactory.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core.factory -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.slf4j.LoggerFactory import org.springframework.context.ApplicationContext import org.springframework.context.ApplicationContextAware @@ -29,16 +29,16 @@ import org.springframework.context.ApplicationContextAware */ interface ComponentNode { - @Throws(BluePrintProcessorException::class) + @Throws(BlueprintProcessorException::class) fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) - @Throws(BluePrintProcessorException::class) + @Throws(BlueprintProcessorException::class) fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) - @Throws(BluePrintProcessorException::class) + @Throws(BlueprintProcessorException::class) fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) - @Throws(BluePrintProcessorException::class) + @Throws(BlueprintProcessorException::class) fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) } diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/listeners/BlueprintCompilerCacheMessageListener.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/listeners/BlueprintCompilerCacheMessageListener.kt index 3833379c9..64b4f0ac5 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/listeners/BlueprintCompilerCacheMessageListener.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/listeners/BlueprintCompilerCacheMessageListener.kt @@ -17,19 +17,19 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core.listeners import org.onap.ccsdk.cds.blueprintsprocessor.core.cluster.BlueprintClusterTopic -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterMessage -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessage +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessageListener import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterJoinedEvent import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache +import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintCompileCache import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.context.event.EventListener import org.springframework.stereotype.Component @Component @ConditionalOnProperty("CLUSTER_ENABLED", havingValue = "true") -open class BlueprintCompilerCacheMessageListener(private val clusterService: BluePrintClusterService) : BlueprintClusterMessageListener<String> { +open class BlueprintCompilerCacheMessageListener(private val clusterService: BlueprintClusterService) : BlueprintClusterMessageListener<String> { private val log = logger(BlueprintCompilerCacheMessageListener::class) @EventListener(ClusterJoinedEvent::class) @@ -38,10 +38,10 @@ open class BlueprintCompilerCacheMessageListener(private val clusterService: Blu clusterService.addBlueprintClusterMessageListener(BlueprintClusterTopic.BLUEPRINT_CLEAN_COMPILER_CACHE, this) } - override fun onMessage(message: BluePrintClusterMessage<String>?) { + override fun onMessage(message: BlueprintClusterMessage<String>?) { message?.let { log.info("Received ClusterMessage - Cleaning compile cache for blueprint (${it.payload})") - BluePrintCompileCache.cleanClassLoader(it.payload) + BlueprintCompileCache.cleanClassLoader(it.payload) } } } diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/service/BluePrintClusterService.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/service/BlueprintClusterService.kt index f7ba6f25f..900ae927b 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/service/BluePrintClusterService.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/service/BlueprintClusterService.kt @@ -22,7 +22,7 @@ import java.time.Duration import java.util.Properties import java.util.UUID -interface BluePrintClusterService { +interface BlueprintClusterService { /** Start the cluster with [clusterInfo], By default clustering service is disabled. * Application module has to start cluster */ @@ -95,10 +95,10 @@ interface ClusterLock { fun close() } -class BluePrintClusterMessage<E>(val topic: BlueprintClusterTopic, val payload: E, publishTime: Long, clusterMember: ClusterMember) +class BlueprintClusterMessage<E>(val topic: BlueprintClusterTopic, val payload: E, publishTime: Long, clusterMember: ClusterMember) interface BlueprintClusterMessageListener<E> { - fun onMessage(message: BluePrintClusterMessage<E>?) + fun onMessage(message: BlueprintClusterMessage<E>?) } class ClusterJoinedEvent(source: Any) : ApplicationEvent(source) diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/PayloadUtils.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/PayloadUtils.kt index 72e5654d4..4ac59802b 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/PayloadUtils.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/PayloadUtils.kt @@ -17,11 +17,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core.utils import com.fasterxml.jackson.databind.JsonNode -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.asJsonString import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing -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 object PayloadUtils { @@ -38,11 +38,11 @@ object PayloadUtils { fun getResponseDataFromPayload(workflowName: String, responsePayload: JsonNode): JsonNode { return responsePayload.get("$workflowName-response").returnNullIfMissing() - ?: throw BluePrintProcessorException("failed to get property($workflowName-response)") + ?: throw BlueprintProcessorException("failed to get property($workflowName-response)") } fun prepareInputsFromWorkflowPayload( - bluePrintRuntimeService: BluePrintRuntimeService<*>, + bluePrintRuntimeService: BlueprintRuntimeService<*>, payload: JsonNode, workflowName: String ) { @@ -51,7 +51,7 @@ object PayloadUtils { } fun prepareDynamicInputsFromWorkflowPayload( - bluePrintRuntimeService: BluePrintRuntimeService<*>, + bluePrintRuntimeService: BlueprintRuntimeService<*>, payload: JsonNode, workflowName: String ) { @@ -61,12 +61,12 @@ object PayloadUtils { } fun prepareDynamicInputsFromComponentPayload( - bluePrintRuntimeService: BluePrintRuntimeService<*>, + bluePrintRuntimeService: BlueprintRuntimeService<*>, payload: JsonNode ) { payload.fields().forEach { property -> - val path = StringBuilder(BluePrintConstants.PATH_INPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(property.key).toString() + val path = StringBuilder(BlueprintConstants.PATH_INPUTS) + .append(BlueprintConstants.PATH_DIVIDER).append(property.key).toString() bluePrintRuntimeService.put(path, property.value) } } diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintPropertiesTest.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BlueprintPropertiesTest.kt index c27285020..fa2e4d41a 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintPropertiesTest.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BlueprintPropertiesTest.kt @@ -17,4 +17,4 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core // TODO -open class BluePrintPropertiesTest +open class BlueprintPropertiesTest diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BluePrintClusterExtensionsTest.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BlueprintClusterExtensionsTest.kt index 95394e7a9..ead24b58d 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BluePrintClusterExtensionsTest.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/BlueprintClusterExtensionsTest.kt @@ -23,10 +23,10 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException import kotlin.test.assertEquals -class BluePrintClusterExtensionsTest { +class BlueprintClusterExtensionsTest { private lateinit var clusterLockMock: ClusterLock @@ -64,7 +64,7 @@ class BluePrintClusterExtensionsTest { } } - @Test(expected = BluePrintException::class) + @Test(expected = BlueprintException::class) fun `executeWithLock - should throw exception when lock was not acquired within timeout`() { runBlocking { every { runBlocking { clusterLockMock.tryLock(eq(0L)) } } returns false diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterServiceTest.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterServiceTest.kt index ded017940..91ad657a2 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazelcastClusterServiceTest.kt @@ -33,11 +33,11 @@ import kotlinx.coroutines.withContext import org.junit.After import org.junit.Before import org.junit.Test -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterMessage -import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessage +import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterMessageListener import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterInfo -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.logger import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile @@ -61,8 +61,8 @@ class HazelcastClusterServiceTest { @Test fun testClientFileSystemYamlConfig() { - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_ID, "test-cluster") - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID, "node-1234") + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_ID, "test-cluster") + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID, "node-1234") System.setProperty( "hazelcast.client.config", normalizedFile("./src/test/resources/hazelcast/hazelcast-client.yaml").absolutePath @@ -75,8 +75,8 @@ class HazelcastClusterServiceTest { @Test fun testServerFileSystemYamlConfig() { - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_ID, "test-cluster") - System.setProperty(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID, "node-1234") + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_ID, "test-cluster") + System.setProperty(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID, "node-1234") val configFile = normalizedFile("./src/test/resources/hazelcast/hazelcast.yaml") val config = FileSystemYamlConfig(configFile) assertNotNull(config) @@ -105,7 +105,7 @@ class HazelcastClusterServiceTest { } } - private suspend fun testMessageReceived(bluePrintClusterServices: List<BluePrintClusterService>) { + private suspend fun testMessageReceived(bluePrintClusterServices: List<BlueprintClusterService>) { val sender = bluePrintClusterServices[0] as HazelcastClusterService val receiver = bluePrintClusterServices[1] as HazelcastClusterService val messageSent = "hello world" @@ -113,7 +113,7 @@ class HazelcastClusterServiceTest { val uuid = receiver.addBlueprintClusterMessageListener( BlueprintClusterTopic.BLUEPRINT_CLEAN_COMPILER_CACHE, object : BlueprintClusterMessageListener<String> { - override fun onMessage(message: BluePrintClusterMessage<String>?) { + override fun onMessage(message: BlueprintClusterMessage<String>?) { log.info("Message received - ${message?.payload}") isMessageReceived = messageSent == message?.payload } @@ -132,7 +132,7 @@ class HazelcastClusterServiceTest { private suspend fun createCluster( ids: List<Int>, joinAsClient: Boolean? = false - ): List<BluePrintClusterService> { + ): List<BlueprintClusterService> { return withContext(Dispatchers.Default) { val deferred = ids.map { id -> @@ -164,7 +164,7 @@ class HazelcastClusterServiceTest { } } - private suspend fun testDistributedStore(bluePrintClusterServices: List<BluePrintClusterService>) { + private suspend fun testDistributedStore(bluePrintClusterServices: List<BlueprintClusterService>) { /** Test Distributed store creation */ repeat(2) { storeId -> val store = bluePrintClusterServices[0].clusterMapStore<JsonNode>( @@ -187,7 +187,7 @@ class HazelcastClusterServiceTest { } } - private suspend fun testDistributedLock(bluePrintClusterServices: List<BluePrintClusterService>) { + private suspend fun testDistributedLock(bluePrintClusterServices: List<BlueprintClusterService>) { val lockName = "sample-lock" withContext(Dispatchers.IO) { val deferred = async { @@ -218,7 +218,7 @@ class HazelcastClusterServiceTest { } private suspend fun executeLock( - bluePrintClusterService: BluePrintClusterService, + bluePrintClusterService: BlueprintClusterService, lockId: String, lockName: String ) { @@ -237,7 +237,7 @@ class HazelcastClusterServiceTest { distributedLock.close() } - private suspend fun executeScheduler(bluePrintClusterService: BluePrintClusterService) { + private suspend fun executeScheduler(bluePrintClusterService: BlueprintClusterService) { log.info("initialising ...") val hazelcastClusterService = bluePrintClusterService as HazelcastClusterService @@ -251,7 +251,7 @@ class HazelcastClusterServiceTest { // scheduler.scheduleOnAllMembersAtFixedRate(SampleSchedulerTask(), 0, 5, TimeUnit.SECONDS) } - private suspend fun printReachableMembers(bluePrintClusterServices: List<BluePrintClusterService>) { + private suspend fun printReachableMembers(bluePrintClusterServices: List<BlueprintClusterService>) { bluePrintClusterServices.forEach { bluePrintClusterService -> val hazelcastClusterService = bluePrintClusterService as HazelcastClusterService val hazelcast = hazelcastClusterService.hazelcast diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/BluePrintMappingsTest.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/BlueprintMappingsTest.kt index e8bdbf9ef..1549c9cdf 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/BluePrintMappingsTest.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/utils/BlueprintMappingsTest.kt @@ -13,7 +13,7 @@ import org.springframework.test.context.junit4.SpringRunner import java.text.SimpleDateFormat @RunWith(SpringRunner::class) -class BluePrintMappingsTest { +class BlueprintMappingsTest { val formatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") val dateString = "2019-01-16T18:25:43.511Z" diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibConfiguration.kt index 6e9e4b554..701fd172f 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibConfiguration.kt @@ -19,9 +19,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest import com.fasterxml.jackson.databind.JsonNode -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.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @@ -29,19 +29,19 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -open class BluePrintRestLibConfiguration +open class BlueprintRestLibConfiguration /** * Exposed Dependency Service by this Rest Lib Module */ -fun BluePrintDependencyService.restLibPropertyService(): BluePrintRestLibPropertyService = +fun BlueprintDependencyService.restLibPropertyService(): BlueprintRestLibPropertyService = instance(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY) -fun BluePrintDependencyService.restClientService(selector: String): BlueprintWebClientService { +fun BlueprintDependencyService.restClientService(selector: String): BlueprintWebClientService { return restLibPropertyService().blueprintWebClientService(selector) } -fun BluePrintDependencyService.restClientService(jsonNode: JsonNode): BlueprintWebClientService { +fun BlueprintDependencyService.restClientService(jsonNode: JsonNode): BlueprintWebClientService { return restLibPropertyService().blueprintWebClientService(jsonNode) } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibData.kt index a227cf24e..a227cf24e 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt index ca1046dde..45b9e3827 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest 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.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,25 +30,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Type DSL for Rest */ fun ServiceTemplateBuilder.relationshipTypeConnectsToRestClient() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToRestClient() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToRestClient() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToRestClient(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToRestClient(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through" ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -66,35 +66,35 @@ fun TopologyTemplateBuilder.relationshipTemplateRestClient( open class RestClientRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, description ) { fun basicAuth(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.basicAuthRestClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.basicAuthRestClientProperties(block)) } fun tokenAuth(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tokenAuthRestClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tokenAuthRestClientProperties(block)) } fun sslAuth(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.sslRestClientProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.sslRestClientProperties(block)) } } -fun BluePrintTypes.basicAuthRestClientProperties(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.basicAuthRestClientProperties(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = BasicAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.tokenAuthRestClientProperties(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.tokenAuthRestClientProperties(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = TokenAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_TOKEN_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BluePrintTypes.sslRestClientProperties(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.sslRestClientProperties(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = SslAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_SSL_NO_AUTH.asJsonPrimitive() return assignments.asJsonType() diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyService.kt index a2c68ec68..d28bd77db 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyService.kt @@ -19,7 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.PolicyManagerRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties @@ -28,12 +28,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLBasicAuthRestClientPropert import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLTokenAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.TokenAuthRestClientProperties -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.springframework.stereotype.Service @Service(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY) -open class BluePrintRestLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { +open class BlueprintRestLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { private var preInterceptor: PreInterceptor? = null private var postInterceptor: PostInterceptor? = null @@ -88,7 +88,7 @@ open class BluePrintRestLibPropertyService(private var bluePrintPropertiesServic policyManagerRestClientProperties(prefix) } else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "Rest adaptor($type) is" + " not supported" ) @@ -120,7 +120,7 @@ open class BluePrintRestLibPropertyService(private var bluePrintPropertiesServic JacksonUtils.readValue(jsonNode, SSLRestClientProperties::class.java)!! } else -> { - throw BluePrintProcessorException( + throw BlueprintProcessorException( "Rest adaptor($type) is not supported" ) } @@ -141,7 +141,7 @@ open class BluePrintRestLibPropertyService(private var bluePrintPropertiesServic return BasicAuthRestClientService(restClientProperties) } else -> { - throw BluePrintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}") + throw BlueprintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}") } } } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt index 945d29850..43dbcbeb2 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt @@ -36,9 +36,9 @@ import org.apache.http.message.BasicHeader import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants import org.onap.ccsdk.cds.blueprintsprocessor.rest.utils.WebClientUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintIOUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintRetryException +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintIOUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod @@ -59,7 +59,7 @@ interface BlueprintWebClientService { .build() } - /** High performance non blocking Retry function, If execution block [block] throws BluePrintRetryException + /** High performance non blocking Retry function, If execution block [block] throws BlueprintRetryException * exception then this will perform wait and retrigger accoring to times [times] with delay [delay] */ suspend fun <T> retry( @@ -69,11 +69,11 @@ interface BlueprintWebClientService { block: suspend (Int) -> T ): T { val exceptionBlock = { e: Exception -> - if (e !is BluePrintRetryException) { + if (e !is BlueprintRetryException) { throw e } } - return BluePrintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock) + return BlueprintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock) } fun exchangeResource(methodType: String, path: String, request: String): WebClientResponse<String> { @@ -98,7 +98,7 @@ interface BlueprintWebClientService { HttpMethod.POST -> post(path, request, convertedHeaders, String::class.java) HttpMethod.PUT -> put(path, request, convertedHeaders, String::class.java) HttpMethod.PATCH -> patch(path, request, convertedHeaders, String::class.java) - else -> throw BluePrintProcessorException( + else -> throw BlueprintProcessorException( "Unsupported methodType($methodType) attempted on path($path)" ) } @@ -270,7 +270,7 @@ interface BlueprintWebClientService { HttpMethod.DELETE -> deleteNB(path, convertedHeaders, responseType) HttpMethod.PUT -> putNB(path, request, convertedHeaders, responseType) HttpMethod.PATCH -> patchNB(path, request, convertedHeaders, responseType) - else -> throw BluePrintProcessorException("Unsupported methodType($methodType)") + else -> throw BlueprintProcessorException("Unsupported methodType($methodType)") } } @@ -323,7 +323,7 @@ interface BlueprintWebClientService { " User-supplied \"additionalHeaders\" cannot contain AUTHORIZATION header with" + " auth-type \"${RestLibConstants.TYPE_BASIC_AUTH}\"" WebClientUtils.log.error(errMsg) - throw BluePrintProcessorException(errMsg) + throw BlueprintProcessorException(errMsg) } else { customHeaders.putAll(it) } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt index 611c0855d..8c7ba6573 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt @@ -29,12 +29,12 @@ import kotlinx.coroutines.reactor.ReactorContext import kotlinx.coroutines.reactor.asCoroutineContext import kotlinx.coroutines.withContext import org.apache.http.message.BasicHeader -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_INVOCATION_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_ORIGINATOR_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_PARTNER_NAME -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_REQUEST_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_SUBREQUEST_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_INVOCATION_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_ORIGINATOR_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_PARTNER_NAME +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_REQUEST_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_SUBREQUEST_ID import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext import org.onap.ccsdk.cds.controllerblueprints.core.defaultToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.defaultToUUID @@ -65,7 +65,7 @@ class RestLoggerService { fun httpInvoking(headers: Array<BasicHeader>) { headers.plusElement(BasicHeader(ONAP_REQUEST_ID, MDC.get("InvocationID").defaultToUUID())) headers.plusElement(BasicHeader(ONAP_INVOCATION_ID, UUID.randomUUID().toString())) - headers.plusElement(BasicHeader(ONAP_PARTNER_NAME, BluePrintConstants.APP_NAME)) + headers.plusElement(BasicHeader(ONAP_PARTNER_NAME, BlueprintConstants.APP_NAME)) } } @@ -98,7 +98,7 @@ class RestLoggerService { resHeaders[ONAP_SUBREQUEST_ID] = MDC.get("SubRequestID") resHeaders[ONAP_ORIGINATOR_ID] = MDC.get("OriginatorID") resHeaders[ONAP_INVOCATION_ID] = MDC.get("InvocationID") - resHeaders[ONAP_PARTNER_NAME] = BluePrintConstants.APP_NAME + resHeaders[ONAP_PARTNER_NAME] = BlueprintConstants.APP_NAME } catch (e: Exception) { log.warn("couldn't set response headers", e) } finally { diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyServiceTest.kt index f45d1cd69..117fbbd25 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyServiceTest.kt @@ -23,13 +23,13 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper 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.rest.BluePrintRestLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BlueprintRestLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLBasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLTokenAuthRestClientProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.springframework.beans.factory.annotation.Autowired import org.springframework.http.HttpHeaders import org.springframework.http.MediaType @@ -43,8 +43,8 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BluePrintRestLibConfiguration::class, BluePrintPropertyConfiguration::class, - BluePrintPropertiesService::class + BlueprintRestLibConfiguration::class, BlueprintPropertyConfiguration::class, + BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -75,10 +75,10 @@ import kotlin.test.assertNotNull "blueprintsprocessor.restclient.ssl.sslKeyPassword=changeit" ] ) -class BluePrintRestLibPropertyServiceTest { +class BlueprintRestLibPropertyServiceTest { @Autowired - lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: BlueprintRestLibPropertyService @Test fun testRestClientProperties() { @@ -287,7 +287,7 @@ class BluePrintRestLibPropertyServiceTest { additionalHeadersChangedContentTypeToAPPLICATION_XML(endPointWithHeadersJson) } - // called from within "assertFailsWith(exceptionClass = BluePrintProcessorException::class) {" + // called from within "assertFailsWith(exceptionClass = BlueprintProcessorException::class) {" private fun attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson: String) { val parsedObj: JsonNode = defaultMapper.readTree(endPointWithHeadersJson) val bpWebClientService = @@ -297,12 +297,12 @@ class BluePrintRestLibPropertyServiceTest { @Test fun `BasicAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = basicAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = basicAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -336,12 +336,12 @@ class BluePrintRestLibPropertyServiceTest { @Test fun `TokenAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslTokenAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslTokenAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -376,12 +376,12 @@ class BluePrintRestLibPropertyServiceTest { @Test fun `SSLBasicAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslBasicAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslBasicAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -416,18 +416,18 @@ class BluePrintRestLibPropertyServiceTest { @Test fun `SSLNoAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslNoAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BluePrintProcessorException::class) { + assertFailsWith(exceptionClass = BlueprintProcessorException::class) { val endPointWithHeadersJson = sslNoAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } } - companion object BluePrintRestLibPropertyServiceTest { + companion object BlueprintRestLibPropertyServiceTest { val defaultMapper = ObjectMapper() val expectedTokenAuthDefaultHeaders = mapOf<String, String>( diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt index f06f827ad..6b083aaad 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt @@ -19,7 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.rest.relationshipTemplateRestClient import org.onap.ccsdk.cds.blueprintsprocessor.rest.relationshipTypeConnectsToRestClient -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -73,12 +73,12 @@ class RestClientPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt index 030996685..e14e035a9 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -27,9 +27,9 @@ import org.junit.After import org.junit.Before 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.rest.BluePrintRestLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BlueprintRestLibConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration @@ -66,9 +66,9 @@ import kotlin.test.assertNotNull @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ContextConfiguration( classes = [ - BluePrintRestLibConfiguration::class, SampleController::class, + BlueprintRestLibConfiguration::class, SampleController::class, SecurityConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -96,7 +96,7 @@ import kotlin.test.assertNotNull class RestClientServiceTest { @Autowired - lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: BlueprintRestLibPropertyService @Autowired lateinit var httpHandler: HttpHandler diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibConfiguration.kt index dc10722cc..7b471870b 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibConfiguration.kt @@ -17,9 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.ssh import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BluePrintSshLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BlueprintSshLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BlueprintSshClientService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @@ -27,18 +27,18 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -open class BluePrintSshLibConfiguration +open class BlueprintSshLibConfiguration /** * Exposed Dependency Service by this SSH Lib Module */ -fun BluePrintDependencyService.sshLibPropertyService(): BluePrintSshLibPropertyService = +fun BlueprintDependencyService.sshLibPropertyService(): BlueprintSshLibPropertyService = instance(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY) -fun BluePrintDependencyService.sshClientService(selector: String): BlueprintSshClientService = +fun BlueprintDependencyService.sshClientService(selector: String): BlueprintSshClientService = sshLibPropertyService().blueprintSshClientService(selector) -fun BluePrintDependencyService.sshClientService(jsonNode: JsonNode): BlueprintSshClientService = +fun BlueprintDependencyService.sshClientService(jsonNode: JsonNode): BlueprintSshClientService = sshLibPropertyService().blueprintSshClientService(jsonNode) class SshLibConstants { diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibData.kt index 295021f21..295021f21 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt index a7702d4fb..256924c5f 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt @@ -19,8 +19,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.ssh 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.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -32,25 +32,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Types DSL for Message Producer */ fun ServiceTemplateBuilder.relationshipTypeConnectsToSshClient() { - val relationshipType = BluePrintTypes.relationshipTypeConnectsToSshClient() + val relationshipType = BlueprintTypes.relationshipTypeConnectsToSshClient() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BluePrintTypes.relationshipTypeConnectsToSshClient(): RelationshipType { +fun BlueprintTypes.relationshipTypeConnectsToSshClient(): RelationshipType { return relationshipType( - id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, - version = BluePrintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through SSH Client." ) { property( - BluePrintConstants.PROPERTY_CONNECTION_CONFIG, - BluePrintConstants.DATA_TYPE_MAP, + BlueprintConstants.PROPERTY_CONNECTION_CONFIG, + BlueprintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -68,15 +68,15 @@ fun TopologyTemplateBuilder.relationshipTemplateSshClient( open class SshRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, description + BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, description ) { fun basicAuth(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit) { - property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.basicAuthSshProperties(block)) + property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.basicAuthSshProperties(block)) } } -fun BluePrintTypes.basicAuthSshProperties(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BlueprintTypes.basicAuthSshProperties(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val sshProperties = BasicAuthSshClientPropertiesAssignmentBuilder().apply(block).build() sshProperties[SshClientProperties::type.name] = SshLibConstants.TYPE_BASIC_AUTH.asJsonPrimitive() return sshProperties.asJsonType() diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt index 6ee73c238..46756e63a 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt @@ -25,7 +25,7 @@ import org.apache.sshd.client.channel.ClientChannelEvent import org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier import org.apache.sshd.client.session.ClientSession import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BasicAuthSshClientProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.slf4j.LoggerFactory import java.io.ByteArrayOutputStream import java.io.IOException @@ -76,7 +76,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B channel!!.err = ByteArrayOutputStream() channel!!.open() } catch (e: Exception) { - throw BluePrintProcessorException("Failed to start Shell channel: ${e.message}") + throw BlueprintProcessorException("Failed to start Shell channel: ${e.message}") } } @@ -97,7 +97,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B } } } catch (e: Exception) { - throw BluePrintProcessorException("Failed to execute commands, below the error message : ${e.message}") + throw BlueprintProcessorException("Failed to execute commands, below the error message : ${e.message}") } return response } @@ -111,7 +111,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B teeOutput!!.flush() deviceOutput = waitForPrompt(timeOut) } catch (e: IOException) { - throw BluePrintProcessorException("Exception during command execution: ${e.message}", e) + throw BlueprintProcessorException("Exception during command execution: ${e.message}", e) } if (detectFailure(deviceOutput)) { @@ -130,7 +130,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B Collections.unmodifiableSet(EnumSet.of(ClientChannelEvent.CLOSED)), timeOut ) if (channel!!.out.toString().indexOfAny(arrayListOf("$", ">", "#")) <= 0 && waitMask.contains(ClientChannelEvent.TIMEOUT)) { - throw BluePrintProcessorException("Timeout: Failed to retrieve commands result in $timeOut ms") + throw BlueprintProcessorException("Timeout: Failed to retrieve commands result in $timeOut ms") } val outputResult = channel!!.out.toString() channel!!.out.flush() diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyService.kt index 90a1746e8..4803d5f52 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyService.kt @@ -17,16 +17,16 @@ package org.onap.ccsdk.cds.blueprintsprocessor.ssh.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BasicAuthSshClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshLibConstants -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.springframework.stereotype.Service @Service(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY) -open class BluePrintSshLibPropertyService(private var bluePrintProperties: BluePrintPropertiesService) { +open class BlueprintSshLibPropertyService(private var bluePrintProperties: BlueprintPropertiesService) { fun blueprintSshClientService(jsonNode: JsonNode): BlueprintSshClientService { val restClientProperties = sshClientProperties(jsonNode) @@ -46,14 +46,14 @@ open class BluePrintSshLibPropertyService(private var bluePrintProperties: BlueP basicAuthSshClientProperties(prefix) } else -> { - throw BluePrintProcessorException("SSH adaptor($type) is not supported") + throw BlueprintProcessorException("SSH adaptor($type) is not supported") } } } fun sshClientProperties(jsonNode: JsonNode): SshClientProperties { val type = jsonNode.get("type")?.textValue() - ?: throw BluePrintProcessorException("missing type field in ssh client properties") + ?: throw BlueprintProcessorException("missing type field in ssh client properties") return when (type) { SshLibConstants.TYPE_BASIC_AUTH -> { JacksonUtils.readValue( @@ -62,7 +62,7 @@ open class BluePrintSshLibPropertyService(private var bluePrintProperties: BlueP )!! } else -> { - throw BluePrintProcessorException("SSH adaptor($type) is not supported") + throw BlueprintProcessorException("SSH adaptor($type) is not supported") } } } @@ -74,7 +74,7 @@ open class BluePrintSshLibPropertyService(private var bluePrintProperties: BlueP return BasicAuthSshClientService(sshClientProperties) } else -> { - throw BluePrintProcessorException("couldn't get SSH client service for") + throw BlueprintProcessorException("couldn't get SSH client service for") } } } diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSLTest.kt index 85891b1b5..510dc7de8 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSLTest.kt @@ -17,7 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.ssh import org.junit.Test -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -53,12 +53,12 @@ class SshPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT], - "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT}" + relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT], + "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshClientServiceTest.kt index 1cf0de52b..1c9d8d14b 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshClientServiceTest.kt @@ -28,9 +28,9 @@ import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider import org.apache.sshd.server.session.ServerSession import org.apache.sshd.server.shell.ProcessShellCommandFactory 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.ssh.BluePrintSshLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BlueprintSshLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.echoShell.EchoShellFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -47,8 +47,8 @@ import kotlin.test.assertTrue @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BluePrintSshLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintSshLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -64,9 +64,9 @@ import kotlin.test.assertTrue class BlueprintSshClientServiceTest { @Autowired - lateinit var bluePrintSshLibPropertyService: BluePrintSshLibPropertyService + lateinit var bluePrintSshLibPropertyService: BlueprintSshLibPropertyService - lateinit var bluePrintSshLibPropertyServiceMock: BluePrintSshLibPropertyService + lateinit var bluePrintSshLibPropertyServiceMock: BlueprintSshLibPropertyService private lateinit var sshServer: SshServer diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyServiceTest.kt index 43a997ae9..88c734aa4 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyServiceTest.kt @@ -18,10 +18,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.ssh.service 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.ssh.BasicAuthSshClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BluePrintSshLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BlueprintSshLibConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource @@ -32,8 +32,8 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BluePrintSshLibConfiguration::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class + BlueprintSshLibConfiguration::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class ] ) @TestPropertySource( @@ -46,10 +46,10 @@ import kotlin.test.assertNotNull "blueprintsprocessor.sshclient.sample.username=dummy" ] ) -class BluePrintSshLibPropertyServiceTest { +class BlueprintSshLibPropertyServiceTest { @Autowired - lateinit var bluePrintSshLibPropertyService: BluePrintSshLibPropertyService + lateinit var bluePrintSshLibPropertyService: BlueprintSshLibPropertyService @Test fun testRestClientProperties() { |