diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds')
66 files changed, 704 insertions, 704 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt index 1a2fb6187..2fde05504 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt @@ -19,8 +19,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.configs.api 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.controllerblueprints.core.interfaces.BlueprintCatalogService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest @@ -35,7 +35,7 @@ import org.springframework.web.reactive.function.BodyInserters @RunWith(SpringRunner::class) @WebFluxTest @ContextConfiguration( - classes = [BlueprintCoreConfiguration::class, BlueprintCatalogService::class, ErrorCatalogTestConfiguration::class] + classes = [BluePrintCoreConfiguration::class, BluePrintCatalogService::class, ErrorCatalogTestConfiguration::class] ) @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"]) @TestPropertySource(locations = ["classpath:application-test.properties"]) diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/TestDatabaseConfiguration.kt index 9567ebc88..ee4c0a544 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.configs.api -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution", diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt index 97e43ec89..54f8dbc9d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintManagementGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt @@ -22,21 +22,21 @@ import com.google.protobuf.ByteString import com.google.protobuf.util.JsonFormat import io.grpc.stub.StreamObserver import kotlinx.coroutines.runBlocking -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BlueprintModelHandler +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BluePrintModelHandler import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader 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.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.emptyTONull import org.onap.ccsdk.cds.controllerblueprints.core.utils.currentTimestamp -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintBootstrapInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintDownloadInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementOutput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementServiceGrpc -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.BluePrintBootstrapInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintDownloadInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementOutput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementServiceGrpc +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.DownloadAction import org.onap.ccsdk.cds.controllerblueprints.management.api.FileChunk import org.onap.ccsdk.cds.controllerblueprints.management.api.RemoveAction @@ -51,18 +51,18 @@ import org.springframework.stereotype.Service // TODO("Convert to coroutines handler") @Service -open class BlueprintManagementGRPCHandler( - private val bluePrintModelHandler: BlueprintModelHandler, +open class BluePrintManagementGRPCHandler( + private val bluePrintModelHandler: BluePrintModelHandler, private val errorCatalogService: ErrorCatalogService ) : - BlueprintManagementServiceGrpc.BlueprintManagementServiceImplBase() { + BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase() { - private val log = LoggerFactory.getLogger(BlueprintManagementGRPCHandler::class.java) + private val log = LoggerFactory.getLogger(BluePrintManagementGRPCHandler::class.java) @PreAuthorize("hasRole('USER')") override fun uploadBlueprint( - request: BlueprintUploadInput, - responseObserver: StreamObserver<BlueprintManagementOutput> + request: BluePrintUploadInput, + responseObserver: StreamObserver<BluePrintManagementOutput> ) { runBlocking { @@ -91,7 +91,7 @@ open class BlueprintManagementGRPCHandler( failStatus( request.commonHeader, "Upload action($uploadAction) not implemented", - BlueprintProcessorException("Not Implemented") + BluePrintProcessorException("Not Implemented") ) ) } @@ -104,7 +104,7 @@ open class BlueprintManagementGRPCHandler( failStatus( request.commonHeader, "Upload action($uploadAction) not implemented", - BlueprintProcessorException("Not implemented") + BluePrintProcessorException("Not implemented") ) ) } @@ -124,8 +124,8 @@ open class BlueprintManagementGRPCHandler( @PreAuthorize("hasRole('USER')") override fun downloadBlueprint( - request: BlueprintDownloadInput, - responseObserver: StreamObserver<BlueprintManagementOutput> + request: BluePrintDownloadInput, + responseObserver: StreamObserver<BluePrintManagementOutput> ) { runBlocking { val blueprintName = request.actionIdentifiers.blueprintName @@ -148,7 +148,7 @@ open class BlueprintManagementGRPCHandler( failStatus( request.commonHeader, "Search action($searchAction) not implemented", - BlueprintProcessorException("Not implemented") + BluePrintProcessorException("Not implemented") ) ) } @@ -168,9 +168,9 @@ open class BlueprintManagementGRPCHandler( @PreAuthorize("hasRole('USER')") override fun removeBlueprint( - request: BlueprintRemoveInput, + request: BluePrintRemoveInput, responseObserver: - StreamObserver<BlueprintManagementOutput> + StreamObserver<BluePrintManagementOutput> ) { runBlocking { @@ -195,7 +195,7 @@ open class BlueprintManagementGRPCHandler( failStatus( request.commonHeader, "Remove action($removeAction) not implemented", - BlueprintProcessorException("Not implemented") + BluePrintProcessorException("Not implemented") ) ) } @@ -214,8 +214,8 @@ open class BlueprintManagementGRPCHandler( } override fun bootstrapBlueprint( - request: BlueprintBootstrapInput, - responseObserver: StreamObserver<BlueprintManagementOutput> + request: BluePrintBootstrapInput, + responseObserver: StreamObserver<BluePrintManagementOutput> ) { runBlocking { try { @@ -241,33 +241,33 @@ open class BlueprintManagementGRPCHandler( } } - private fun outputWithFileBytes(header: CommonHeader, byteArray: ByteArray): BlueprintManagementOutput = - BlueprintManagementOutput.newBuilder() + private fun outputWithFileBytes(header: CommonHeader, byteArray: ByteArray): BluePrintManagementOutput = + BluePrintManagementOutput.newBuilder() .setCommonHeader(header) .setFileChunk(FileChunk.newBuilder().setChunk(ByteString.copyFrom(byteArray))) .setStatus( Status.newBuilder() .setTimestamp(currentTimestamp()) .setEventType(EventType.EVENT_COMPONENT_EXECUTED) - .setMessage(BlueprintConstants.STATUS_SUCCESS) + .setMessage(BluePrintConstants.STATUS_SUCCESS) .setCode(200) .build() ) .build() - private fun successStatus(header: CommonHeader, propertyContent: String? = null): BlueprintManagementOutput { + private fun successStatus(header: CommonHeader, propertyContent: String? = null): BluePrintManagementOutput { // Populate Response Payload - val propertiesBuilder = BlueprintManagementOutput.newBuilder().propertiesBuilder + val propertiesBuilder = BluePrintManagementOutput.newBuilder().propertiesBuilder propertyContent?.let { JsonFormat.parser().merge(propertyContent, propertiesBuilder) } - return BlueprintManagementOutput.newBuilder() + return BluePrintManagementOutput.newBuilder() .setCommonHeader(header) .setProperties(propertiesBuilder.build()) .setStatus( Status.newBuilder() .setTimestamp(currentTimestamp()) - .setMessage(BlueprintConstants.STATUS_SUCCESS) + .setMessage(BluePrintConstants.STATUS_SUCCESS) .setEventType(EventType.EVENT_COMPONENT_EXECUTED) .setCode(200) .build() @@ -275,19 +275,19 @@ open class BlueprintManagementGRPCHandler( .build() } - private fun failStatus(header: CommonHeader, message: String, e: Exception): BlueprintManagementOutput { + private fun failStatus(header: CommonHeader, message: String, e: Exception): BluePrintManagementOutput { log.error(message, e) - return if (e is BlueprintProcessorException) onErrorCatalog(header, message, e) else onError(header, message, e) + return if (e is BluePrintProcessorException) onErrorCatalog(header, message, e) else onError(header, message, e) } - private fun onError(header: CommonHeader, message: String, error: Exception): BlueprintManagementOutput { + private fun onError(header: CommonHeader, message: String, error: Exception): BluePrintManagementOutput { val code = GrpcErrorCodes.code(ErrorCatalogCodes.GENERIC_FAILURE) - return BlueprintManagementOutput.newBuilder() + return BluePrintManagementOutput.newBuilder() .setCommonHeader(header) .setStatus( Status.newBuilder() .setTimestamp(currentTimestamp()) - .setMessage(BlueprintConstants.STATUS_FAILURE) + .setMessage(BluePrintConstants.STATUS_FAILURE) .setEventType(EventType.EVENT_COMPONENT_FAILURE) .setErrorMessage("Error : $message \n Details: ${error.errorMessageOrDefault()}") .setCode(code) @@ -296,20 +296,20 @@ open class BlueprintManagementGRPCHandler( .build() } - private fun onErrorCatalog(header: CommonHeader, message: String, error: BlueprintProcessorException): - BlueprintManagementOutput { + private fun onErrorCatalog(header: CommonHeader, message: String, error: BluePrintProcessorException): + BluePrintManagementOutput { val err = if (error.protocol == "") { error.grpc(ErrorCatalogCodes.GENERIC_FAILURE) } else { error.convertToGrpc() } val errorPayload = errorCatalogService.errorPayload(err.addErrorPayloadMessage(message)) - return BlueprintManagementOutput.newBuilder() + return BluePrintManagementOutput.newBuilder() .setCommonHeader(header) .setStatus( Status.newBuilder() .setTimestamp(currentTimestamp()) - .setMessage(BlueprintConstants.STATUS_FAILURE) + .setMessage(BluePrintConstants.STATUS_FAILURE) .setEventType(EventType.EVENT_COMPONENT_FAILURE) .setErrorMessage("Error : ${errorPayload.message}") .setCode(errorPayload.code) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt index f19824d47..66d4b0e16 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt @@ -25,10 +25,10 @@ import io.swagger.annotations.ApiResponse import io.swagger.annotations.ApiResponses import org.jetbrains.annotations.NotNull import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelSearch -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BlueprintModelHandler +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BluePrintModelHandler import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintSortByOption import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.mdcWebCoroutineScope -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonString import org.springframework.core.io.Resource import org.springframework.data.domain.Page @@ -62,7 +62,7 @@ import org.springframework.web.bind.annotation.RestController value = "Blueprint Model Catalog", description = "Manages all blueprint models which are available in CDS" ) -open class BlueprintModelController(private val bluePrintModelHandler: BlueprintModelHandler) { +open class BlueprintModelController(private val bluePrintModelHandler: BluePrintModelHandler) { @PostMapping( path = arrayOf("/bootstrap"), produces = arrayOf(MediaType.APPLICATION_JSON_VALUE), @@ -79,7 +79,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 500, message = "Internal Server Error") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun bootstrap( @ApiParam(required = true, value = "Specifies which elements to load") @@ -100,7 +100,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 500, message = "Internal Server Error") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun saveBlueprint( @ApiParam(name = "file", value = "CBA file to be uploaded (example: cba.zip)", required = true) @@ -162,7 +162,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint @PathVariable(value = "keyword") keyWord: String ): List<BlueprintModelSearch> = mdcWebCoroutineScope { - bluePrintModelHandler.searchBlueprintModelsByKeyWord(keyWord) + bluePrintModelHandler.searchBluePrintModelsByKeyWord(keyWord) } @GetMapping("/paged/meta-data/{keyword}", produces = [MediaType.APPLICATION_JSON_VALUE]) @@ -186,7 +186,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint offset, limit, Sort.Direction.fromString(sortType), sort.columnName ) - return this.bluePrintModelHandler.searchBlueprintModelsByKeyWordPaged(keyWord, pageRequest) + return this.bluePrintModelHandler.searchBluePrintModelsByKeyWordPaged(keyWord, pageRequest) } @DeleteMapping("/{id}") @@ -198,7 +198,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 200, message = "OK"), ApiResponse(code = 404, message = "RESOURCE_NOT_FOUND") ) - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun deleteBlueprint( @ApiParam(value = "ID of the blueprint model to delete", required = true, example = "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4") @@ -218,7 +218,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 404, message = "Not Found") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun getBlueprintByNameAndVersion( @ApiParam(value = "Name of the blueprint model", required = true, example = "pnf_netconf") @PathVariable(value = "name") name: String, @@ -242,7 +242,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 404, message = "Not Found") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun downloadBlueprintByNameAndVersion( @ApiParam(value = "Name of the blueprint model", required = true, example = "pnf_netconf") @PathVariable(value = "name") name: String, @@ -262,7 +262,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 404, message = "Not Found") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun getBlueprintModel( @ApiParam(value = "ID of the blueprint model to search for", required = true, example = "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4") @@ -281,9 +281,9 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 404, message = "Not Found") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") - suspend fun downloadBlueprint( + suspend fun downloadBluePrint( @ApiParam(value = "ID of the blueprint model to download", required = true, example = "67ec1f96-ab55-4b81-aff9-23ee0ed1d7a4") @PathVariable(value = "id") id: String ): ResponseEntity<Resource> = @@ -304,7 +304,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint "The enrichment process will complete the package by providing all the definition of types used." ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun enrichBlueprint( @ApiParam(name = "file", value = "CBA zip file to be uploaded (example: cba_unenriched.zip)", required = true) @@ -330,7 +330,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint ApiResponse(code = 503, message = "Service Unavailable") ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun enrichAndPubishlueprint( @ApiParam(name = "file", value = "Unenriched CBA zip file to be uploaded (example: cba_unenriched.zip)", required = true) @@ -346,7 +346,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint response = BlueprintModelSearch::class ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun publishBlueprint( @ApiParam(name = "file", value = "Enriched CBA zip file to be uploaded (example: cba_enriched.zip)", required = true) @@ -405,7 +405,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint "Inputs, outputs and data types of workflow is returned." ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun workflowSpec( @ApiParam(required = true, value = "Blueprint and workflow identification") @@ -428,7 +428,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: Blueprint notes = "Get all available workflows of a Blueprint identified by its name and version." ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun getWorkflowList( @ApiParam(value = "Name of the blueprint model", example = "pnf_netconf", required = true) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/DesignerApiData.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/DesignerApiData.kt index 5406b7792..741a9115c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/DesignerApiData.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/DesignerApiData.kt @@ -20,9 +20,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api import io.swagger.annotations.ApiModel import io.swagger.annotations.ApiModelProperty import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ResourceDictionary -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.DATA_TYPE_JSON -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.DEFAULT_VERSION_NUMBER -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.TOSCA_SPEC +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.DATA_TYPE_JSON +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.DEFAULT_VERSION_NUMBER +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.TOSCA_SPEC import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt index eb9a98091..3689f735e 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt @@ -22,7 +22,7 @@ import io.swagger.annotations.ApiOperation import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ModelTypeHandler import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.mdcWebCoroutineScope -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.springframework.http.MediaType import org.springframework.web.bind.annotation.DeleteMapping import org.springframework.web.bind.annotation.GetMapping @@ -86,7 +86,7 @@ open class ModelTypeController(private val modelTypeHandler: ModelTypeHandler) { response = ModelType::class ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun saveModelType(@RequestBody modelType: ModelType): ModelType = mdcWebCoroutineScope { modelTypeHandler.saveModel(modelType) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt index 62997cc1b..8d69ccdde 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt @@ -22,7 +22,7 @@ import io.swagger.annotations.ApiParam import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ResourceDictionary import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ResourceDictionaryHandler import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.mdcWebCoroutineScope -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceSourceMapping import org.springframework.http.MediaType @@ -50,7 +50,7 @@ open class ResourceDictionaryController(private val resourceDictionaryHandler: R response = ResourceDictionary::class ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun getResourceDictionaryByName( @ApiParam(value = "Name of the resource", required = true, example = "\"hostname\"") @PathVariable(value = "name") name: String @@ -69,7 +69,7 @@ open class ResourceDictionaryController(private val resourceDictionaryHandler: R response = ResourceDictionary::class ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun saveResourceDictionary( @ApiParam(value = "Resource dictionary to store", required = true) @RequestBody dataDictionary: ResourceDictionary @@ -90,7 +90,7 @@ open class ResourceDictionaryController(private val resourceDictionaryHandler: R response = ResourceDefinition::class ) @ResponseBody - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun saveResourceDictionary( @ApiParam(value = "Resource definition to generate", required = true) @RequestBody resourceDefinition: ResourceDefinition diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintArtifactDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt index a85d71f31..c63c7260d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintArtifactDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt @@ -16,50 +16,50 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintArtifactDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintArtifactDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.stereotype.Service @Service -open class BlueprintArtifactDefinitionEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, +open class BluePrintArtifactDefinitionEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, private val resourceAssignmentEnhancerService: ResourceAssignmentEnhancerService ) : - BlueprintArtifactDefinitionEnhancer { + BluePrintArtifactDefinitionEnhancer { companion object { const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource" } - private val log = logger(BlueprintArtifactDefinitionEnhancerImpl::class) + private val log = logger(BluePrintArtifactDefinitionEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, artifactDefinition: ArtifactDefinition) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, artifactDefinition: ArtifactDefinition) { log.info("enhancing ArtifactDefinition($name)") this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() val artifactTypeName = artifactDefinition.type - ?: throw BlueprintException("artifact type is missing for ArtifactDefinition($name)") + ?: throw BluePrintException("artifact type is missing for ArtifactDefinition($name)") // Populate Artifact Type - BlueprintEnhancerUtils.populateArtifactType(bluePrintContext, bluePrintRepoService, artifactTypeName) + BluePrintEnhancerUtils.populateArtifactType(bluePrintContext, bluePrintRepoService, artifactTypeName) when (artifactTypeName) { ARTIFACT_TYPE_MAPPING_SOURCE -> { @@ -81,10 +81,10 @@ open class BlueprintArtifactDefinitionEnhancerImpl( if (!alreadyEnhanced) { val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(artifactFilePath, ResourceAssignment::class.java) as? MutableList<ResourceAssignment> - ?: throw BlueprintProcessorException("couldn't get ResourceAssignment definitions for the file($artifactFilePath)") + ?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($artifactFilePath)") // Call Resource Assignment Enhancer - resourceAssignmentEnhancerService.enhanceBlueprint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments) + resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments) bluePrintRuntimeService.put(alreadyEnhancedKey, true.asJsonPrimitive()) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintAttributeDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt index cd05c62e1..030fbe8ae 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintAttributeDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt @@ -16,40 +16,40 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.AttributeDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintAttributeDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintAttributeDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -class BlueprintAttributeDefinitionEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +class BluePrintAttributeDefinitionEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintAttributeDefinitionEnhancer { + BluePrintAttributeDefinitionEnhancer { - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, attributeDefinition: AttributeDefinition) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, attributeDefinition: AttributeDefinition) { this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() val propertyType = attributeDefinition.type - if (BlueprintTypes.validPrimitiveTypes().contains(propertyType)) { - } else if (BlueprintTypes.validCollectionTypes().contains(propertyType)) { + if (BluePrintTypes.validPrimitiveTypes().contains(propertyType)) { + } else if (BluePrintTypes.validCollectionTypes().contains(propertyType)) { val entrySchema = attributeDefinition.entrySchema - ?: throw BlueprintException("Entry Schema is missing for collection property($name)") + ?: throw BluePrintException("Entry Schema is missing for collection property($name)") - if (!BlueprintTypes.validPrimitiveTypes().contains(entrySchema.type)) { - BlueprintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, entrySchema.type) + if (!BluePrintTypes.validPrimitiveTypes().contains(entrySchema.type)) { + BluePrintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, entrySchema.type) } } else { - BlueprintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, propertyType) + BluePrintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, propertyType) } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintEnhancerServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImpl.kt index 7603963a1..8240b1de1 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintEnhancerServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImpl.kt @@ -18,16 +18,16 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintFileUtils -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils.ResourceDictionaryUtils import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes import org.onap.ccsdk.cds.error.catalog.core.utils.errorCauseOrDefault @@ -36,28 +36,28 @@ import java.io.IOException import java.util.UUID @Service -open class BlueprintEnhancerServiceImpl( - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, +open class BluePrintEnhancerServiceImpl( + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, private val resourceDefinitionEnhancerService: ResourceDefinitionEnhancerService -) : BlueprintEnhancerService { +) : BluePrintEnhancerService { - private val log = logger(BlueprintEnhancerServiceImpl::class) + private val log = logger(BluePrintEnhancerServiceImpl::class) - override suspend fun enhance(basePath: String, enrichedBasePath: String): BlueprintContext { + override suspend fun enhance(basePath: String, enrichedBasePath: String): BluePrintContext { // Copy the Blueprint Content to Target Location - BlueprintFileUtils.copyBlueprint(basePath, enrichedBasePath) + BluePrintFileUtils.copyBluePrint(basePath, enrichedBasePath) // Enhance the Blueprint return enhance(enrichedBasePath) } - @Throws(BlueprintException::class) - override suspend fun enhance(basePath: String): BlueprintContext { + @Throws(BluePrintException::class) + override suspend fun enhance(basePath: String): BluePrintContext { log.info("Enhancing blueprint($basePath)") - val blueprintRuntimeService = BlueprintMetadataUtils - .getBaseEnhancementBlueprintRuntime(UUID.randomUUID().toString(), basePath) + val blueprintRuntimeService = BluePrintMetadataUtils + .getBaseEnhancementBluePrintRuntime(UUID.randomUUID().toString(), basePath) try { @@ -73,15 +73,15 @@ open class BlueprintEnhancerServiceImpl( ) // Write the Enhanced Blueprint Definitions - BlueprintFileUtils.writeEnhancedBlueprint(blueprintRuntimeService.bluePrintContext()) + BluePrintFileUtils.writeEnhancedBluePrint(blueprintRuntimeService.bluePrintContext()) // Write the Enhanced Blueprint Resource Definitions ResourceDictionaryUtils.writeResourceDefinitionTypes(basePath, resourceDefinitions) - if (blueprintRuntimeService.getBlueprintError().allErrors().isNotEmpty()) { - throw BlueprintException(blueprintRuntimeService.getBlueprintError().allErrors().toString()) + if (blueprintRuntimeService.getBluePrintError().allErrors().isNotEmpty()) { + throw BluePrintException(blueprintRuntimeService.getBluePrintError().allErrors().toString()) } - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Error while enriching the CBA package." throw e.updateErrorMessage( DesignerApiDomains.DESIGNER_API, errorMsg, diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintNodeTemplateEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt index 0dd5ed19a..6ca0b2d14 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintNodeTemplateEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt @@ -17,39 +17,39 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintNodeTemplateEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +open class BluePrintNodeTemplateEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintNodeTemplateEnhancer { + BluePrintNodeTemplateEnhancer { - private val log = logger(BlueprintNodeTemplateEnhancerImpl::class) + private val log = logger(BluePrintNodeTemplateEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, nodeTemplate: NodeTemplate) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, nodeTemplate: NodeTemplate) { log.info("***** Enhancing NodeTemplate($name)") this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() val nodeTypeName = nodeTemplate.type // Get NodeType from Repo and Update Service Template - val nodeType = BlueprintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, nodeTypeName) + val nodeType = BluePrintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, nodeTypeName) // Enrich NodeType bluePrintTypeEnhancerService.enhanceNodeType(bluePrintRuntimeService, nodeTypeName, nodeType) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintNodeTypeEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt index 4011918f7..bb178b1e6 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintNodeTypeEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt @@ -16,42 +16,42 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.InterfaceDefinition import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType import org.onap.ccsdk.cds.controllerblueprints.core.data.OperationDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintNodeTypeEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService -) : BlueprintNodeTypeEnhancer { +open class BluePrintNodeTypeEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService +) : BluePrintNodeTypeEnhancer { - private val log = logger(BlueprintNodeTypeEnhancerImpl::class) + private val log = logger(BluePrintNodeTypeEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, nodeType: NodeType) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, nodeType: NodeType) { this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() val derivedFrom = nodeType.derivedFrom - if (!BlueprintTypes.rootNodeTypes().contains(derivedFrom)) { - val derivedFromNodeType = BlueprintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, name) + if (!BluePrintTypes.rootNodeTypes().contains(derivedFrom)) { + val derivedFromNodeType = BluePrintEnhancerUtils.populateNodeType(bluePrintContext, bluePrintRepoService, name) // Enrich NodeType enhance(bluePrintRuntimeService, derivedFrom, derivedFromNodeType) } @@ -90,7 +90,7 @@ open class BlueprintNodeTypeEnhancerImpl( // Populate Requirement Node requirementDefinition.node?.let { requirementNodeTypeName -> // Get Requirement NodeType from Repo and Update Service Template - val requirementNodeType = BlueprintEnhancerUtils.populateNodeType( + val requirementNodeType = BluePrintEnhancerUtils.populateNodeType( bluePrintContext, bluePrintRepoService, requirementNodeTypeName ) @@ -99,7 +99,7 @@ open class BlueprintNodeTypeEnhancerImpl( // Enhance Relationship Type val relationShipTypeName = requirementDefinition.relationship - ?: throw BlueprintException( + ?: throw BluePrintException( "couldn't get relationship name for the NodeType($nodeTypeName) " + "Requirement($requirementName)" ) @@ -152,6 +152,6 @@ open class BlueprintNodeTypeEnhancerImpl( * Get the Relationship Type from database and add to Blueprint Context */ open fun enrichRelationShipType(relationshipName: String) { - BlueprintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, relationshipName) + BluePrintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, relationshipName) } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintPolicyTypeEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPolicyTypeEnhancerImpl.kt index d58c82f07..212dc440d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintPolicyTypeEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPolicyTypeEnhancerImpl.kt @@ -17,25 +17,25 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer import org.onap.ccsdk.cds.controllerblueprints.core.data.PolicyType -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintPolicyTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintPolicyTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -class BlueprintPolicyTypeEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +class BluePrintPolicyTypeEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintPolicyTypeEnhancer { + BluePrintPolicyTypeEnhancer { - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, type: PolicyType) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, type: PolicyType) { this.bluePrintRuntimeService = bluePrintRuntimeService diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintPropertyDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt index 4ac52bb17..eb7443443 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintPropertyDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt @@ -17,48 +17,48 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintPropertyDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintPropertyDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintPropertyDefinitionEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +open class BluePrintPropertyDefinitionEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintPropertyDefinitionEnhancer { + BluePrintPropertyDefinitionEnhancer { - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, propertyDefinition: PropertyDefinition) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, propertyDefinition: PropertyDefinition) { this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() val propertyType = propertyDefinition.type - if (BlueprintTypes.validPrimitiveTypes().contains(propertyType) || - BlueprintTypes.validComplexTypes().contains(propertyType) + if (BluePrintTypes.validPrimitiveTypes().contains(propertyType) || + BluePrintTypes.validComplexTypes().contains(propertyType) ) { // Do Nothing, - } else if (BlueprintTypes.validCollectionTypes().contains(propertyType)) { + } else if (BluePrintTypes.validCollectionTypes().contains(propertyType)) { val entrySchema = propertyDefinition.entrySchema - ?: throw BlueprintException("Entry Schema is missing for collection property($name)") + ?: throw BluePrintException("Entry Schema is missing for collection property($name)") - if (!BlueprintTypes.validPrimitiveTypes().contains(entrySchema.type)) { - BlueprintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, entrySchema.type) + if (!BluePrintTypes.validPrimitiveTypes().contains(entrySchema.type)) { + BluePrintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, entrySchema.type) } } else { - BlueprintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, propertyType) + BluePrintEnhancerUtils.populateDataTypes(bluePrintContext, bluePrintRepoService, propertyType) } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintRelationshipTemplateEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintRelationshipTemplateEnhancerImpl.kt index cd345a81c..c208f68e5 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintRelationshipTemplateEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintRelationshipTemplateEnhancerImpl.kt @@ -16,33 +16,33 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipTemplate -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRelationshipTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRelationshipTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintRelationshipTemplateEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +open class BluePrintRelationshipTemplateEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintRelationshipTemplateEnhancer { + BluePrintRelationshipTemplateEnhancer { - private val log = logger(BlueprintRelationshipTemplateEnhancerImpl::class) + private val log = logger(BluePrintRelationshipTemplateEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext override fun enhance( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, relationshipTemplate: RelationshipTemplate ) { @@ -53,7 +53,7 @@ open class BlueprintRelationshipTemplateEnhancerImpl( val relationshipTypeName = relationshipTemplate.type // Get RelationshipType from Repo and Update Service Template val relationshipType = - BlueprintEnhancerUtils.populateRelationshipType( + BluePrintEnhancerUtils.populateRelationshipType( bluePrintContext, bluePrintRepoService, relationshipTypeName diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintRelationshipTypeEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintRelationshipTypeEnhancerImpl.kt index 2216cafb6..b0e166090 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintRelationshipTypeEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintRelationshipTypeEnhancerImpl.kt @@ -16,33 +16,33 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRelationshipTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRelationshipTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintRelationshipTypeEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService -) : BlueprintRelationshipTypeEnhancer { +open class BluePrintRelationshipTypeEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService +) : BluePrintRelationshipTypeEnhancer { - private val log = logger(BlueprintRelationshipTypeEnhancerImpl::class) + private val log = logger(BluePrintRelationshipTypeEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext override fun enhance( - bluePrintRuntimeService: BlueprintRuntimeService<*>, + bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, relationshipType: RelationshipType ) { @@ -51,9 +51,9 @@ open class BlueprintRelationshipTypeEnhancerImpl( val derivedFrom = relationshipType.derivedFrom - if (!BlueprintTypes.rootRelationshipTypes().contains(derivedFrom)) { + if (!BluePrintTypes.rootRelationshipTypes().contains(derivedFrom)) { val derivedFromRelationshipType = - BlueprintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, name) + BluePrintEnhancerUtils.populateRelationshipType(bluePrintContext, bluePrintRepoService, name) // Enrich RelationshipType enhance(bluePrintRuntimeService, derivedFrom, derivedFromRelationshipType) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintServiceTemplateEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintServiceTemplateEnhancerImpl.kt index 80855ce4c..9f4a4592a 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintServiceTemplateEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintServiceTemplateEnhancerImpl.kt @@ -17,26 +17,26 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer import org.onap.ccsdk.cds.controllerblueprints.core.data.ServiceTemplate -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintServiceTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintServiceTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintServiceTemplateEnhancerImpl(private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService) : - BlueprintServiceTemplateEnhancer { +open class BluePrintServiceTemplateEnhancerImpl(private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService) : + BluePrintServiceTemplateEnhancer { - private val log = logger(BlueprintServiceTemplateEnhancerImpl::class) + private val log = logger(BluePrintServiceTemplateEnhancerImpl::class) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, type: ServiceTemplate) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, type: ServiceTemplate) { this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintTopologyTemplateEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintTopologyTemplateEnhancerImpl.kt index 768f5abe4..750cd0ff4 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintTopologyTemplateEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintTopologyTemplateEnhancerImpl.kt @@ -17,25 +17,25 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer import org.onap.ccsdk.cds.controllerblueprints.core.data.TopologyTemplate -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTopologyTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTopologyTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintTopologyTemplateEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService +open class BluePrintTopologyTemplateEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService ) : - BlueprintTopologyTemplateEnhancer { + BluePrintTopologyTemplateEnhancer { - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, type: TopologyTemplate) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, type: TopologyTemplate) { this.bluePrintRuntimeService = bluePrintRuntimeService enhanceTopologyTemplateInputs(type) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintTypeEnhancerServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintTypeEnhancerServiceImpl.kt index d3b28596c..c27c206fa 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintTypeEnhancerServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintTypeEnhancerServiceImpl.kt @@ -16,69 +16,69 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintArtifactDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintAttributeDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintNodeTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintPolicyTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintPropertyDefinitionEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRelationshipTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRelationshipTypeEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintServiceTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTopologyTemplateEnhancer -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintArtifactDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintAttributeDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintPolicyTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintPropertyDefinitionEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRelationshipTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRelationshipTypeEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintServiceTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTopologyTemplateEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowEnhancer import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.ApplicationContext import org.springframework.stereotype.Service @Service -open class BlueprintTypeEnhancerServiceImpl : BlueprintTypeEnhancerService { +open class BluePrintTypeEnhancerServiceImpl : BluePrintTypeEnhancerService { @Autowired private lateinit var context: ApplicationContext - override fun getServiceTemplateEnhancers(): List<BlueprintServiceTemplateEnhancer> { - return context.getBeansOfType(BlueprintServiceTemplateEnhancer::class.java).map { it.value } + override fun getServiceTemplateEnhancers(): List<BluePrintServiceTemplateEnhancer> { + return context.getBeansOfType(BluePrintServiceTemplateEnhancer::class.java).map { it.value } } - override fun getTopologyTemplateEnhancers(): List<BlueprintTopologyTemplateEnhancer> { - return context.getBeansOfType(BlueprintTopologyTemplateEnhancer::class.java).map { it.value } + override fun getTopologyTemplateEnhancers(): List<BluePrintTopologyTemplateEnhancer> { + return context.getBeansOfType(BluePrintTopologyTemplateEnhancer::class.java).map { it.value } } - override fun getWorkflowEnhancers(): List<BlueprintWorkflowEnhancer> { - return context.getBeansOfType(BlueprintWorkflowEnhancer::class.java).map { it.value } + override fun getWorkflowEnhancers(): List<BluePrintWorkflowEnhancer> { + return context.getBeansOfType(BluePrintWorkflowEnhancer::class.java).map { it.value } } - override fun getNodeTemplateEnhancers(): List<BlueprintNodeTemplateEnhancer> { - return context.getBeansOfType(BlueprintNodeTemplateEnhancer::class.java).map { it.value } + override fun getNodeTemplateEnhancers(): List<BluePrintNodeTemplateEnhancer> { + return context.getBeansOfType(BluePrintNodeTemplateEnhancer::class.java).map { it.value } } - override fun getNodeTypeEnhancers(): List<BlueprintNodeTypeEnhancer> { - return context.getBeansOfType(BlueprintNodeTypeEnhancer::class.java).map { it.value } + override fun getNodeTypeEnhancers(): List<BluePrintNodeTypeEnhancer> { + return context.getBeansOfType(BluePrintNodeTypeEnhancer::class.java).map { it.value } } - override fun getRelationshipTemplateEnhancers(): List<BlueprintRelationshipTemplateEnhancer> { - return context.getBeansOfType(BlueprintRelationshipTemplateEnhancer::class.java).map { it.value } + override fun getRelationshipTemplateEnhancers(): List<BluePrintRelationshipTemplateEnhancer> { + return context.getBeansOfType(BluePrintRelationshipTemplateEnhancer::class.java).map { it.value } } - override fun getRelationshipTypeEnhancers(): List<BlueprintRelationshipTypeEnhancer> { - return context.getBeansOfType(BlueprintRelationshipTypeEnhancer::class.java).map { it.value } + override fun getRelationshipTypeEnhancers(): List<BluePrintRelationshipTypeEnhancer> { + return context.getBeansOfType(BluePrintRelationshipTypeEnhancer::class.java).map { it.value } } - override fun getArtifactDefinitionEnhancers(): List<BlueprintArtifactDefinitionEnhancer> { - return context.getBeansOfType(BlueprintArtifactDefinitionEnhancer::class.java).map { it.value } + override fun getArtifactDefinitionEnhancers(): List<BluePrintArtifactDefinitionEnhancer> { + return context.getBeansOfType(BluePrintArtifactDefinitionEnhancer::class.java).map { it.value } } - override fun getPolicyTypeEnhancers(): List<BlueprintPolicyTypeEnhancer> { - return context.getBeansOfType(BlueprintPolicyTypeEnhancer::class.java).map { it.value } + override fun getPolicyTypeEnhancers(): List<BluePrintPolicyTypeEnhancer> { + return context.getBeansOfType(BluePrintPolicyTypeEnhancer::class.java).map { it.value } } - override fun getPropertyDefinitionEnhancers(): List<BlueprintPropertyDefinitionEnhancer> { - return context.getBeansOfType(BlueprintPropertyDefinitionEnhancer::class.java).map { it.value } + override fun getPropertyDefinitionEnhancers(): List<BluePrintPropertyDefinitionEnhancer> { + return context.getBeansOfType(BluePrintPropertyDefinitionEnhancer::class.java).map { it.value } } - override fun getAttributeDefinitionEnhancers(): List<BlueprintAttributeDefinitionEnhancer> { - return context.getBeansOfType(BlueprintAttributeDefinitionEnhancer::class.java).map { it.value } + override fun getAttributeDefinitionEnhancers(): List<BluePrintAttributeDefinitionEnhancer> { + return context.getBeansOfType(BluePrintAttributeDefinitionEnhancer::class.java).map { it.value } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintWorkflowEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintWorkflowEnhancerImpl.kt index 8b19af0a7..dd60acac1 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintWorkflowEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintWorkflowEnhancerImpl.kt @@ -17,19 +17,19 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer -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.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowEnhancer +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowEnhancer import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -38,14 +38,14 @@ import org.springframework.stereotype.Service @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintWorkflowEnhancerImpl( - private val bluePrintRepoService: BlueprintRepoService, - private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, +open class BluePrintWorkflowEnhancerImpl( + private val bluePrintRepoService: BluePrintRepoService, + private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, private val resourceAssignmentEnhancerService: ResourceAssignmentEnhancerService ) : - BlueprintWorkflowEnhancer { + BluePrintWorkflowEnhancer { - private val log = logger(BlueprintWorkflowEnhancerImpl::class) + private val log = logger(BluePrintWorkflowEnhancerImpl::class) companion object { @@ -53,12 +53,12 @@ open class BlueprintWorkflowEnhancerImpl( const val PROPERTY_DEPENDENCY_NODE_TEMPLATES = "dependency-node-templates" } - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> - lateinit var bluePrintContext: BlueprintContext + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> + lateinit var bluePrintContext: BluePrintContext private val workflowDataTypes: MutableMap<String, DataType> = hashMapOf() - override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, workflow: Workflow) { + override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, workflow: Workflow) { log.info("##### Enhancing Workflow($name)") this.bluePrintRuntimeService = bluePrintRuntimeService this.bluePrintContext = bluePrintRuntimeService.bluePrintContext() @@ -101,14 +101,14 @@ open class BlueprintWorkflowEnhancerImpl( val derivedFrom = bluePrintContext.nodeTemplateNodeType(firstNodeTemplateName).derivedFrom when { - derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> { + derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> { enhanceStepTargets(name, workflow, firstNodeTemplateName, false) } - derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> { + derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> { enhanceStepTargets(name, workflow, firstNodeTemplateName, true) } else -> { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "couldn't execute workflow($name) step mapped " + "to node template($firstNodeTemplateName) derived from($derivedFrom)" ) @@ -124,7 +124,7 @@ open class BlueprintWorkflowEnhancerImpl( // Get the Dependent Component Node Template Names val dependencyNodeTemplateNodes = dgNodeTemplate.properties?.get(PROPERTY_DEPENDENCY_NODE_TEMPLATES) - ?: throw BlueprintException("couldn't get property($PROPERTY_DEPENDENCY_NODE_TEMPLATES) ") + ?: throw BluePrintException("couldn't get property($PROPERTY_DEPENDENCY_NODE_TEMPLATES) ") dependencyNodeTemplates = JacksonUtils.getListFromJsonNode(dependencyNodeTemplateNodes, String::class.java) @@ -175,7 +175,7 @@ open class BlueprintWorkflowEnhancerImpl( val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(filePath, ResourceAssignment::class.java) as? MutableList<ResourceAssignment> - ?: throw BlueprintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)") + ?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)") val alreadyEnhancedKey = "enhanced-$fileName" val alreadyEnhanced = bluePrintRuntimeService.check(alreadyEnhancedKey) @@ -184,7 +184,7 @@ open class BlueprintWorkflowEnhancerImpl( if (!alreadyEnhanced) { // Call Resource Assignment Enhancer - resourceAssignmentEnhancerService.enhanceBlueprint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments) + resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments) bluePrintRuntimeService.put(alreadyEnhancedKey, true.asJsonPrimitive()) } @@ -215,7 +215,7 @@ open class BlueprintWorkflowEnhancerImpl( dynamicDataType = DataType() dynamicDataType.version = "1.0.0" dynamicDataType.description = "Dynamic DataType definition for workflow($workflowName)." - dynamicDataType.derivedFrom = BlueprintConstants.MODEL_TYPE_DATA_TYPE_DYNAMIC + dynamicDataType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATA_TYPE_DYNAMIC val dataTypeProperties: MutableMap<String, PropertyDefinition> = hashMapOf() dynamicDataType.properties = dataTypeProperties diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt index 4d1995d53..621b046e6 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt @@ -17,11 +17,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service.ResourceDefinitionRepoService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDictionaryConstants @@ -37,10 +37,10 @@ import org.springframework.stereotype.Service */ interface ResourceAssignmentEnhancerService { - @Throws(BlueprintException::class) - fun enhanceBlueprint( - bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, - bluePrintRuntimeService: BlueprintRuntimeService<*>, + @Throws(BluePrintException::class) + fun enhanceBluePrint( + bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, + bluePrintRuntimeService: BluePrintRuntimeService<*>, resourceAssignments: List<ResourceAssignment> ) } @@ -61,9 +61,9 @@ open class ResourceAssignmentEnhancerServiceImpl(private val resourceDefinitionR * Get the defined source instance from the ResourceAssignment, * then get the NodeType of the Sources assigned */ - override fun enhanceBlueprint( - bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, - bluePrintRuntimeService: BlueprintRuntimeService<*>, + override fun enhanceBluePrint( + bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, + bluePrintRuntimeService: BluePrintRuntimeService<*>, resourceAssignments: List<ResourceAssignment> ) { @@ -91,7 +91,7 @@ open class ResourceAssignmentEnhancerServiceImpl(private val resourceDefinitionR val resourceDefinition: ResourceDefinition = getResourceDefinition(dictionaryName) val sourceNodeTemplate = resourceDefinition.sources[dictionarySource] - ?: throw BlueprintException("failed to get assigned dictionarySource($dictionarySource) from resourceDefinition($dictionaryName)") + ?: throw BluePrintException("failed to get assigned dictionarySource($dictionarySource) from resourceDefinition($dictionaryName)") // Enrich as NodeTemplate bluePrintTypeEnhancerService.enhanceNodeTemplate(bluePrintRuntimeService, dictionarySource, sourceNodeTemplate) @@ -110,7 +110,7 @@ open class ResourceAssignmentEnhancerServiceImpl(private val resourceDefinitionR resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_INPUT) || resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_DEFAULT) ) && - BlueprintTypes.validPrimitiveOrCollectionPrimitive(resourceAssignment.property!!) + BluePrintTypes.validPrimitiveOrCollectionPrimitive(resourceAssignment.property!!) ) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt index 08a41f7be..bbec8e685 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt @@ -21,12 +21,12 @@ import kotlinx.coroutines.Deferred import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service.ResourceDefinitionRepoService -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils.ResourceDictionaryUtils @@ -34,10 +34,10 @@ import org.springframework.stereotype.Service interface ResourceDefinitionEnhancerService { - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) fun enhance( - bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, - bluePrintRuntimeService: BlueprintRuntimeService<*> + bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, + bluePrintRuntimeService: BluePrintRuntimeService<*> ): List<ResourceDefinition> } @@ -58,8 +58,8 @@ class ResourceDefinitionEnhancerServiceImpl(private val resourceDefinitionRepoSe // 3. Collect the Resource Definition for Resource Assignment names from database. // 4. Create the Resource Definition under blueprint base path. override fun enhance( - bluePrintTypeEnhancerService: BlueprintTypeEnhancerService, - bluePrintRuntimeService: BlueprintRuntimeService<*> + bluePrintTypeEnhancerService: BluePrintTypeEnhancerService, + bluePrintRuntimeService: BluePrintRuntimeService<*> ): List<ResourceDefinition> { var resourceDefinitions: List<ResourceDefinition> = mutableListOf() @@ -77,7 +77,7 @@ class ResourceDefinitionEnhancerServiceImpl(private val resourceDefinitionRepoSe } // Get all the Mapping files from all node templates. - private fun getAllResourceMappingFiles(blueprintContext: BlueprintContext): List<String>? { + private fun getAllResourceMappingFiles(blueprintContext: BluePrintContext): List<String>? { return blueprintContext.nodeTemplates()?.mapNotNull { nodeTemplateMap -> @@ -91,7 +91,7 @@ class ResourceDefinitionEnhancerServiceImpl(private val resourceDefinitionRepoSe } // Convert file content to ResourceAssignments asynchronously - private fun getResourceDefinition(blueprintContext: BlueprintContext, files: List<String>) = runBlocking { + private fun getResourceDefinition(blueprintContext: BluePrintContext, files: List<String>) = runBlocking { val blueprintBasePath = blueprintContext.rootPath val deferredResourceAssignments = mutableListOf<Deferred<List<ResourceAssignment>>>() for (file in files) { @@ -124,7 +124,7 @@ class ResourceDefinitionEnhancerServiceImpl(private val resourceDefinitionRepoSe } private fun enrichResourceDefinitionSources( - bluePrintContext: BlueprintContext, + bluePrintContext: BluePrintContext, resourceDefinitions: List<ResourceDefinition> ) { val sources = resourceDefinitions @@ -138,7 +138,7 @@ class ResourceDefinitionEnhancerServiceImpl(private val resourceDefinitionRepoSe .flatten().distinct() log.info("Enriching Resource Definition sources Node Template: $sources") sources.forEach { - BlueprintEnhancerUtils.populateNodeType(bluePrintContext, resourceDefinitionRepoService, it) + BluePrintEnhancerUtils.populateNodeType(bluePrintContext, resourceDefinitionRepoService, it) } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BlueprintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt index 42954c16e..7bbaa8c59 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BlueprintModelHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt @@ -30,25 +30,25 @@ import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowData import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowSpecRequest import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowSpecResponse import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.WorkFlowsResponse -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load.BlueprintDatabaseLoadService -import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BlueprintEnhancerUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load.BluePrintDatabaseLoadService +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName -import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintCompileCache -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintFileUtils -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes @@ -77,17 +77,17 @@ import java.util.UUID */ @Service -open class BlueprintModelHandler( - private val bluePrintDatabaseLoadService: BlueprintDatabaseLoadService, - private val blueprintsProcessorCatalogService: BlueprintCatalogService, - private val bluePrintLoadConfiguration: BlueprintLoadConfiguration, +open class BluePrintModelHandler( + private val bluePrintDatabaseLoadService: BluePrintDatabaseLoadService, + private val blueprintsProcessorCatalogService: BluePrintCatalogService, + private val bluePrintLoadConfiguration: BluePrintLoadConfiguration, private val blueprintModelSearchRepository: BlueprintModelSearchRepository, private val blueprintModelRepository: BlueprintModelRepository, private val blueprintModelContentRepository: BlueprintModelContentRepository, - private val bluePrintEnhancerService: BlueprintEnhancerService + private val bluePrintEnhancerService: BluePrintEnhancerService ) { - private val log = logger(BlueprintModelHandler::class) + private val log = logger(BluePrintModelHandler::class) open suspend fun bootstrapBlueprint(bootstrapRequest: BootstrapRequest) { log.info( @@ -102,11 +102,11 @@ open class BlueprintModelHandler( bluePrintDatabaseLoadService.initResourceDictionary() } if (bootstrapRequest.loadCBA) { - bluePrintDatabaseLoadService.initBlueprintCatalog() + bluePrintDatabaseLoadService.initBluePrintCatalog() } } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun prepareWorkFlowSpec(req: WorkFlowSpecRequest): WorkFlowSpecResponse { val basePath = blueprintsProcessorCatalogService.getFromDatabase( @@ -116,7 +116,7 @@ open class BlueprintModelHandler( ) log.info("blueprint base path $basePath") - val blueprintContext = BlueprintMetadataUtils.getBlueprintContext(basePath.toString()) + val blueprintContext = BluePrintMetadataUtils.getBluePrintContext(basePath.toString()) val workFlow = blueprintContext.workflowByName(req.workflowName) val wfRes = WorkFlowSpecResponse() @@ -144,7 +144,7 @@ open class BlueprintModelHandler( return wfRes } - private fun addPropertyInfo(propName: String, prop: PropertyDefinition, ctx: BlueprintContext, res: WorkFlowSpecResponse) { + private fun addPropertyInfo(propName: String, prop: PropertyDefinition, ctx: BluePrintContext, res: WorkFlowSpecResponse) { updatePropertyInfo(propName, prop, ctx, res) addDataType(prop.type, ctx, res) if (prop.entrySchema != null && prop.entrySchema!!.type != null) { @@ -152,7 +152,7 @@ open class BlueprintModelHandler( } } - private fun updatePropertyInfo(name: String, prop: PropertyDefinition, ctx: BlueprintContext, res: WorkFlowSpecResponse) { + private fun updatePropertyInfo(name: String, prop: PropertyDefinition, ctx: BluePrintContext, res: WorkFlowSpecResponse) { if (prop.inputparam == null || prop.inputparam == false) { var workflow = ctx.workflowByName(res.workFlowData.workFlowName) for ((k, v) in workflow.steps!!) { @@ -176,7 +176,7 @@ open class BlueprintModelHandler( } } - private fun addDataType(name: String, ctx: BlueprintContext, res: WorkFlowSpecResponse) { + private fun addDataType(name: String, ctx: BluePrintContext, res: WorkFlowSpecResponse) { var data = ctx.dataTypeByName(name) if (data != null) { res.dataTypes?.put(name, data) @@ -184,7 +184,7 @@ open class BlueprintModelHandler( } } - private fun addParentDataType(data: DataType, ctx: BlueprintContext, res: WorkFlowSpecResponse) { + private fun addParentDataType(data: DataType, ctx: BluePrintContext, res: WorkFlowSpecResponse) { if (data.properties != null) { for ((k, v) in data.properties!!) { addPropertyInfo(k, v, ctx, res) @@ -192,7 +192,7 @@ open class BlueprintModelHandler( } } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun getWorkflowNames(name: String, version: String): WorkFlowsResponse { val basePath = blueprintsProcessorCatalogService.getFromDatabase( name, version @@ -203,7 +203,7 @@ open class BlueprintModelHandler( res.blueprintName = name res.version = version - val blueprintContext = BlueprintMetadataUtils.getBlueprintContext( + val blueprintContext = BluePrintMetadataUtils.getBluePrintContext( basePath.toString() ) if (blueprintContext.workflows() != null) { @@ -235,9 +235,9 @@ open class BlueprintModelHandler( * * @param filePart filePart * @return Mono<BlueprintModelSearch> - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException </BlueprintModelSearch> */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun saveBlueprintModel(filePart: FilePart): BlueprintModelSearch { try { return upload(filePart, false) @@ -265,12 +265,12 @@ open class BlueprintModelHandler( * @param name name * @param version version * @return BlueprintModelSearch - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch? { return blueprintModelSearchRepository.findByArtifactNameAndArtifactVersion(name, version) - /*?: throw BlueprintException( + /*?: throw BluePrintException( ErrorCode.RESOURCE_NOT_FOUND.value, String.format(BLUEPRINT_MODEL_NAME_VERSION_FAILURE_MSG, name, version) )*/ @@ -282,9 +282,9 @@ open class BlueprintModelHandler( * @param name name * @param version version * @return ResponseEntity<Resource> - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException </Resource> */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun downloadBlueprintModelFileByNameAndVersion( name: String, version: String @@ -293,7 +293,7 @@ open class BlueprintModelHandler( val archiveByteArray = download(name, version) val fileName = "${name}_$version.zip" return prepareResourceEntity(fileName, archiveByteArray) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { e.http(ErrorCatalogCodes.RESOURCE_NOT_FOUND) val errorMsg = "Error while downloading the CBA file by Blueprint Name ($name) and Version ($version)." throw e.updateErrorMessage( @@ -307,14 +307,14 @@ open class BlueprintModelHandler( * This is a downloadBlueprintModelFile method to find the target file to download and return a file resource * * @return ResponseEntity<Resource> - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException </Resource> */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun downloadBlueprintModelFile(id: String): ResponseEntity<Resource> { val blueprintModel: BlueprintModel try { blueprintModel = getBlueprintModel(id) - } catch (e: BlueprintException) { + } catch (e: BluePrintException) { throw httpProcessorException( ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API, "Error while downloading the CBA file: couldn't get blueprint modelby ID ($id)", @@ -346,9 +346,9 @@ open class BlueprintModelHandler( * * @param id id * @return BlueprintModel - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun getBlueprintModel(id: String): BlueprintModel { val blueprintModel: BlueprintModel val dbBlueprintModel = blueprintModelRepository.findById(id) @@ -367,9 +367,9 @@ open class BlueprintModelHandler( * @param name name * @param version version * @return BlueprintModel - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun getBlueprintModelByNameAndVersion(name: String, version: String): BlueprintModel { val blueprintModel = blueprintModelRepository .findByArtifactNameAndArtifactVersion(name, version) @@ -386,9 +386,9 @@ open class BlueprintModelHandler( * * @param id id * @return BlueprintModelSearch - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun getBlueprintModelSearch(id: String): BlueprintModelSearch { return blueprintModelSearchRepository.findById(id) ?: throw httpProcessorException( @@ -398,28 +398,28 @@ open class BlueprintModelHandler( } /** - * This is a searchBlueprintModelsByKeyWord method to retrieve specific BlueprintModel in Database + * This is a searchBluePrintModelsByKeyWord method to retrieve specific BlueprintModel in Database * where keyword equals updatedBy or tags or artifcat name or artifcat version or artifact type * @author Shaaban Ebrahim * @param keyWord * * @return List<BlueprintModelSearch> list of the controller blueprint </BlueprintModelSearch> */ - open fun searchBlueprintModelsByKeyWord(keyWord: String): List<BlueprintModelSearch> { + open fun searchBluePrintModelsByKeyWord(keyWord: String): List<BlueprintModelSearch> { return blueprintModelSearchRepository.findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType( keyWord, keyWord, keyWord, keyWord, keyWord ) } /** - * This is a searchBlueprintModelsByKeyWordPagebale method to retrieve specific BlueprintModel in Database + * This is a searchBluePrintModelsByKeyWordPagebale method to retrieve specific BlueprintModel in Database * where keyword equals updatedBy or tags or artifcat name or artifcat version or artifact type and pageable * @author Shaaban Ebrahim * @param keyWord * * @return List<BlueprintModelSearch> list of the controller blueprint </BlueprintModelSearch> */ - open fun searchBlueprintModelsByKeyWordPaged(keyWord: String, pageRequest: PageRequest): Page<BlueprintModelSearch> { + open fun searchBluePrintModelsByKeyWordPaged(keyWord: String, pageRequest: PageRequest): Page<BlueprintModelSearch> { return blueprintModelSearchRepository.findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase( keyWord, keyWord, @@ -434,10 +434,10 @@ open class BlueprintModelHandler( * This is a deleteBlueprintModel method * * @param id id - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ @Transactional - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open fun deleteBlueprintModel(id: String) { val dbBlueprintModel = blueprintModelRepository.findById(id) if (dbBlueprintModel.isPresent) { @@ -463,14 +463,14 @@ open class BlueprintModelHandler( * * @param filePart filePart * @return ResponseEntity<Resource> - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun enrichBlueprint(filePart: FilePart): ResponseEntity<Resource> { try { val enhancedByteArray = enrichBlueprintFileSource(filePart) - return BlueprintEnhancerUtils.prepareResourceEntity("enhanced-cba.zip", enhancedByteArray) - } catch (e: BlueprintProcessorException) { + return BluePrintEnhancerUtils.prepareResourceEntity("enhanced-cba.zip", enhancedByteArray) + } catch (e: BluePrintProcessorException) { e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT) val errorMsg = "Error while enhancing the CBA package." throw e.updateErrorMessage( @@ -491,13 +491,13 @@ open class BlueprintModelHandler( * * @param filePart filePart * @return BlueprintModelSearch - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun publishBlueprint(filePart: FilePart): BlueprintModelSearch { try { return upload(filePart, true) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT) val errorMsg = "Error in Publishing CBA." throw e.updateErrorMessage( @@ -519,14 +519,14 @@ open class BlueprintModelHandler( * * @param filePart filePart * @return BlueprintModelSearch - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun enrichAndPublishBlueprint(filePart: FilePart): BlueprintModelSearch { try { val enhancedByteArray = enrichBlueprintFileSource(filePart) return upload(enhancedByteArray, true) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT) val errorMsg = "Error while enhancing and uploading the CBA package." throw e.updateErrorMessage( @@ -550,8 +550,8 @@ open class BlueprintModelHandler( try { val compressedFile = normalizedFile(blueprintArchive, "cba.zip") when (fileSource) { - is FilePart -> BlueprintEnhancerUtils.filePartAsFile(fileSource, compressedFile) - is ByteArray -> BlueprintEnhancerUtils.byteArrayAsFile(fileSource, compressedFile) + is FilePart -> BluePrintEnhancerUtils.filePartAsFile(fileSource, compressedFile) + is ByteArray -> BluePrintEnhancerUtils.byteArrayAsFile(fileSource, compressedFile) } // Save the Copied file to Database val blueprintId = blueprintsProcessorCatalogService.saveToDatabase(saveId, compressedFile, validate) @@ -561,7 +561,7 @@ open class BlueprintModelHandler( ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API, String.format(BLUEPRINT_MODEL_ID_FAILURE_MSG, blueprintId) ) - } catch (e: BlueprintException) { + } catch (e: BluePrintException) { e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT) val errorMsg = "Error in Upload CBA." throw e.updateErrorMessage( @@ -575,9 +575,9 @@ open class BlueprintModelHandler( ) } finally { // Clean blueprint script cache - val cacheKey = BlueprintFileUtils + val cacheKey = BluePrintFileUtils .compileCacheKey(normalizedPathName(bluePrintLoadConfiguration.blueprintWorkingPath, saveId)) - BlueprintCompileCache.cleanClassLoader(cacheKey) + BluePrintCompileCache.cleanClassLoader(cacheKey) deleteNBDir(blueprintArchive) deleteNBDir(blueprintWorking) } @@ -593,7 +593,7 @@ open class BlueprintModelHandler( ErrorCatalogCodes.RESOURCE_NOT_FOUND, DesignerApiDomains.DESIGNER_API, "Error while downloading the CBA file: couldn't get model content" ) - } catch (e: BlueprintException) { + } catch (e: BluePrintException) { e.http(ErrorCatalogCodes.RESOURCE_NOT_FOUND) val errorMsg = "Fail to get Blueprint Model content." throw e.updateErrorMessage( @@ -612,16 +612,16 @@ open class BlueprintModelHandler( try { when (fileSource) { is FilePart -> - BlueprintEnhancerUtils + BluePrintEnhancerUtils .copyFilePartToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir) is ByteArray -> - BlueprintEnhancerUtils + BluePrintEnhancerUtils .copyByteArrayToEnhanceDir(fileSource, blueprintArchive, blueprintWorkingDir) } // Enhance the Blue Prints bluePrintEnhancerService.enhance(blueprintWorkingDir) - return BlueprintEnhancerUtils.compressEnhanceDirAndReturnByteArray(blueprintWorkingDir, blueprintArchive) - } catch (e: BlueprintException) { + return BluePrintEnhancerUtils.compressEnhanceDirAndReturnByteArray(blueprintWorkingDir, blueprintArchive) + } catch (e: BluePrintException) { e.http(ErrorCatalogCodes.IO_FILE_INTERRUPT) val errorMsg = "Fail Enriching the CBA." throw e.updateErrorMessage(DesignerApiDomains.DESIGNER_API, errorMsg) @@ -631,7 +631,7 @@ open class BlueprintModelHandler( "Error while Enriching the CBA file.", e.errorCauseOrDefault() ) } finally { - BlueprintEnhancerUtils.cleanEnhancer(blueprintArchive, blueprintWorkingDir) + BluePrintEnhancerUtils.cleanEnhancer(blueprintArchive, blueprintWorkingDir) } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt index 864fe7ca9..0d94aab27 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt @@ -21,7 +21,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ModelTypeRepository import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.ModelTypeValidator -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes import org.slf4j.LoggerFactory @@ -68,9 +68,9 @@ open class ModelTypeHandler(private val modelTypeRepository: ModelTypeRepository * * @param modelType modelType * @return ModelType - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) open suspend fun saveModel(modelType: ModelType): ModelType { lateinit var dbModel: ModelType ModelTypeValidator.validateModelType(modelType) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt index e2e726843..3f06a4a98 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt @@ -23,7 +23,7 @@ import org.apache.commons.lang3.StringUtils import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiDomains import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ResourceDictionary import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ResourceDictionaryRepository -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -40,9 +40,9 @@ class ResourceDictionaryHandler(private val resourceDictionaryRepository: Resour * * @param name name * @return DataDictionary - * @throws BlueprintException BlueprintException + * @throws BluePrintException BluePrintException */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun getResourceDictionaryByName(name: String): ResourceDictionary { Preconditions.checkArgument(StringUtils.isNotBlank(name), "Resource dictionary Name Information is missing.") val resourceDictionaryDb = resourceDictionaryRepository.findByName(name) @@ -84,7 +84,7 @@ class ResourceDictionaryHandler(private val resourceDictionaryRepository: Resour * @param resourceDictionary resourceDictionary * @return DataDictionary */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun saveResourceDictionary(resourceDictionary: ResourceDictionary): ResourceDictionary { var resourceDictionary = resourceDictionary @@ -133,7 +133,7 @@ class ResourceDictionaryHandler(private val resourceDictionaryRepository: Resour * @param resourceDefinition ResourceDefinition * @return ResourceDefinition */ - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) suspend fun saveResourceDefinition(resourceDefinition: ResourceDefinition): ResourceDefinition { val resourceDictionary = ResourceDictionary() resourceDictionary.name = resourceDefinition.name diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BlueprintCatalogLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BluePrintCatalogLoadService.kt index bcb1ebbed..8d209449c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BlueprintCatalogLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BluePrintCatalogLoadService.kt @@ -21,22 +21,22 @@ import kotlinx.coroutines.Deferred import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.apache.commons.lang.text.StrBuilder -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.io.File import java.util.UUID @Service -open class BlueprintCatalogLoadService(private val controllerBlueprintsCatalogService: BlueprintCatalogService) { +open class BluePrintCatalogLoadService(private val controllerBlueprintsCatalogService: BluePrintCatalogService) { - private val log = LoggerFactory.getLogger(BlueprintCatalogLoadService::class.java) + private val log = LoggerFactory.getLogger(BluePrintCatalogLoadService::class.java) - open fun loadPathsBlueprintModelCatalog(paths: List<String>) { - paths.forEach { loadPathBlueprintModelCatalog(it) } + open fun loadPathsBluePrintModelCatalog(paths: List<String>) { + paths.forEach { loadPathBluePrintModelCatalog(it) } } - open fun loadPathBlueprintModelCatalog(path: String) { + open fun loadPathBluePrintModelCatalog(path: String) { val files = File(path).listFiles() runBlocking { @@ -45,7 +45,7 @@ open class BlueprintCatalogLoadService(private val controllerBlueprintsCatalogSe for (file in files) { deferredResults += async { - loadBlueprintModelCatalog(errorBuilder, file) + loadBluePrintModelCatalog(errorBuilder, file) } } @@ -59,7 +59,7 @@ open class BlueprintCatalogLoadService(private val controllerBlueprintsCatalogSe } } - open suspend fun loadBlueprintModelCatalog(errorBuilder: StrBuilder, file: File) { + open suspend fun loadBluePrintModelCatalog(errorBuilder: StrBuilder, file: File) { try { controllerBlueprintsCatalogService.saveToDatabase(UUID.randomUUID().toString(), file) } catch (e: Exception) { diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BlueprintDatabaseLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BluePrintDatabaseLoadService.kt index 0534e16a5..02d6ad3c1 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BlueprintDatabaseLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/BluePrintDatabaseLoadService.kt @@ -18,24 +18,24 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load import kotlinx.coroutines.runBlocking -import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @Service -open class BlueprintDatabaseLoadService( - private val bluePrintLoadConfiguration: BlueprintLoadConfiguration, +open class BluePrintDatabaseLoadService( + private val bluePrintLoadConfiguration: BluePrintLoadConfiguration, private val modelTypeLoadService: ModelTypeLoadService, private val resourceDictionaryLoadService: ResourceDictionaryLoadService, - private val bluePrintCatalogLoadService: BlueprintCatalogLoadService + private val bluePrintCatalogLoadService: BluePrintCatalogLoadService ) { - private val log = LoggerFactory.getLogger(BlueprintDatabaseLoadService::class.java) + private val log = LoggerFactory.getLogger(BluePrintDatabaseLoadService::class.java) open fun init() = runBlocking { initModelTypes() initResourceDictionary() - initBlueprintCatalog() + initBluePrintCatalog() } open suspend fun initModelTypes() { @@ -56,12 +56,12 @@ open class BlueprintDatabaseLoadService( } } - open suspend fun initBlueprintCatalog() { - log.info("cba load from paths(${bluePrintLoadConfiguration.loadBlueprintPaths})") + open suspend fun initBluePrintCatalog() { + log.info("cba load from paths(${bluePrintLoadConfiguration.loadBluePrintPaths})") - val paths = bluePrintLoadConfiguration.loadBlueprintPaths?.split(",") + val paths = bluePrintLoadConfiguration.loadBluePrintPaths?.split(",") paths?.let { - bluePrintCatalogLoadService.loadPathsBlueprintModelCatalog(paths) + bluePrintCatalogLoadService.loadPathsBluePrintModelCatalog(paths) } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt index cb7953363..e96daf9f0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt @@ -24,8 +24,8 @@ import org.apache.commons.io.FilenameUtils import org.apache.commons.lang3.text.StrBuilder import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ModelTypeHandler -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.data.ArtifactType import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.EntityType @@ -118,19 +118,19 @@ open class ModelTypeLoadService(private val modelTypeHandler: ModelTypeHandler) val definitionType: String? when (T::class) { DataType::class -> { - definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE } RelationshipType::class -> { - definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE + definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE } ArtifactType::class -> { - definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_ARTIFACT_TYPE + definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_ARTIFACT_TYPE } NodeType::class -> { - definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE + definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE } else -> { - throw BlueprintException("couldn't process model type($classType) definition") + throw BluePrintException("couldn't process model type($classType) definition") } } modelType.definitionType = definitionType diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt index 295e89a9e..15cf3dcb0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt @@ -22,7 +22,7 @@ import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import org.apache.commons.lang3.text.StrBuilder import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ResourceDictionaryHandler -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.readNBText import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -75,7 +75,7 @@ open class ResourceDictionaryLoadService(private val resourceDictionaryHandler: resourceDictionaryHandler.saveResourceDefinition(resourceDefinition) log.trace("Resource dictionary(${file.name}) loaded successfully ") } else { - throw BlueprintException("couldn't get dictionary from content information") + throw BluePrintException("couldn't get dictionary from content information") } } catch (e: Exception) { errorBuilder.appendln("Couldn't load Resource dictionary (${file.name}: ${e.message})") diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BlueprintRepoServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BluePrintRepoServiceImpl.kt index 19f4e61b7..420a9fcd7 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BlueprintRepoServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BluePrintRepoServiceImpl.kt @@ -22,70 +22,70 @@ import com.google.common.base.Preconditions import org.apache.commons.lang3.StringUtils import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ModelTypeRepository import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ResourceDictionaryRepository -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType import org.onap.ccsdk.cds.controllerblueprints.core.data.CapabilityDefinition import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.springframework.stereotype.Service -interface ResourceDefinitionRepoService : BlueprintRepoService { +interface ResourceDefinitionRepoService : BluePrintRepoService { - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) fun getResourceDefinition(resourceDefinitionName: String): ResourceDefinition } @Service -open class BlueprintRepoFileService( +open class BluePrintRepoFileService( private val modelTypeRepository: ModelTypeRepository, private val resourceDictionaryRepository: ResourceDictionaryRepository ) : ResourceDefinitionRepoService { - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getNodeType(nodeTypeName: String): NodeType { return getModelType(nodeTypeName, NodeType::class.java) - ?: throw BlueprintException("couldn't get NodeType($nodeTypeName)") + ?: throw BluePrintException("couldn't get NodeType($nodeTypeName)") } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getDataType(dataTypeName: String): DataType { return getModelType(dataTypeName, DataType::class.java) - ?: throw BlueprintException("couldn't get DataType($dataTypeName)") + ?: throw BluePrintException("couldn't get DataType($dataTypeName)") } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getArtifactType(artifactTypeName: String): ArtifactType { return getModelType(artifactTypeName, ArtifactType::class.java) - ?: throw BlueprintException("couldn't get ArtifactType($artifactTypeName)") + ?: throw BluePrintException("couldn't get ArtifactType($artifactTypeName)") } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getRelationshipType(relationshipTypeName: String): RelationshipType { return getModelType(relationshipTypeName, RelationshipType::class.java) - ?: throw BlueprintException("couldn't get RelationshipType($relationshipTypeName)") + ?: throw BluePrintException("couldn't get RelationshipType($relationshipTypeName)") } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getCapabilityDefinition(capabilityDefinitionName: String): CapabilityDefinition { return getModelType(capabilityDefinitionName, CapabilityDefinition::class.java) - ?: throw BlueprintException("couldn't get CapabilityDefinition($capabilityDefinitionName)") + ?: throw BluePrintException("couldn't get CapabilityDefinition($capabilityDefinitionName)") } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) override fun getResourceDefinition(resourceDefinitionName: String): ResourceDefinition { val dbResourceDictionary = resourceDictionaryRepository.findByName(resourceDefinitionName) return if (dbResourceDictionary != null) { dbResourceDictionary.definition } else { - throw BlueprintException(String.format("failed to get resource dictionary (%s) from repo", resourceDefinitionName)) + throw BluePrintException(String.format("failed to get resource dictionary (%s) from repo", resourceDefinitionName)) } } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) private fun <T> getModelType(modelName: String, valueClass: Class<T>): T? { Preconditions.checkArgument( StringUtils.isNotBlank(modelName), @@ -101,14 +101,14 @@ open class BlueprintRepoFileService( return JacksonUtils.readValue(modelDefinition, valueClass) } - @Throws(BlueprintException::class) + @Throws(BluePrintException::class) private fun getModelDefinition(modelName: String): JsonNode { val modelDefinition: JsonNode val modelTypeDb = modelTypeRepository.findByModelName(modelName) if (modelTypeDb != null) { modelDefinition = modelTypeDb.definition } else { - throw BlueprintException(String.format("failed to get model definition (%s) from repo", modelName)) + throw BluePrintException(String.format("failed to get model definition (%s) from repo", modelName)) } return modelDefinition } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BlueprintEnhancerUtils.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtils.kt index b10b17025..6d72c2741 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BlueprintEnhancerUtils.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtils.kt @@ -19,20 +19,20 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import kotlinx.coroutines.reactive.awaitSingle -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType import org.onap.ccsdk.cds.controllerblueprints.core.deCompress import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService import org.onap.ccsdk.cds.controllerblueprints.core.logger 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.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils import org.springframework.core.io.ByteArrayResource import org.springframework.core.io.Resource import org.springframework.http.HttpHeaders @@ -42,58 +42,58 @@ import org.springframework.http.codec.multipart.FilePart import java.io.File import java.nio.file.Paths -class BlueprintEnhancerUtils { +class BluePrintEnhancerUtils { companion object { - val log = logger(BlueprintEnhancerUtils) + val log = logger(BluePrintEnhancerUtils) fun populateDataTypes( - bluePrintContext: BlueprintContext, - bluePrintRepoService: BlueprintRepoService, + bluePrintContext: BluePrintContext, + bluePrintRepoService: BluePrintRepoService, dataTypeName: String ): DataType { val dataType = bluePrintContext.serviceTemplate.dataTypes?.get(dataTypeName) ?: bluePrintRepoService.getDataType(dataTypeName) - ?: throw BlueprintException("couldn't get DataType($dataTypeName) from repo.") + ?: throw BluePrintException("couldn't get DataType($dataTypeName) from repo.") bluePrintContext.serviceTemplate.dataTypes?.put(dataTypeName, dataType) return dataType } fun populateRelationshipType( - bluePrintContext: BlueprintContext, - bluePrintRepoService: BlueprintRepoService, + bluePrintContext: BluePrintContext, + bluePrintRepoService: BluePrintRepoService, relationshipName: String ): RelationshipType { val relationshipType = bluePrintContext.serviceTemplate.relationshipTypes?.get(relationshipName) ?: bluePrintRepoService.getRelationshipType(relationshipName) - ?: throw BlueprintException("couldn't get RelationshipType($relationshipName) from repo.") + ?: throw BluePrintException("couldn't get RelationshipType($relationshipName) from repo.") bluePrintContext.serviceTemplate.relationshipTypes?.put(relationshipName, relationshipType) return relationshipType } fun populateNodeType( - bluePrintContext: BlueprintContext, - bluePrintRepoService: BlueprintRepoService, + bluePrintContext: BluePrintContext, + bluePrintRepoService: BluePrintRepoService, nodeTypeName: String ): NodeType { val nodeType = bluePrintContext.serviceTemplate.nodeTypes?.get(nodeTypeName) ?: bluePrintRepoService.getNodeType(nodeTypeName) - ?: throw BlueprintException("couldn't get NodeType($nodeTypeName) from repo.") + ?: throw BluePrintException("couldn't get NodeType($nodeTypeName) from repo.") bluePrintContext.serviceTemplate.nodeTypes?.put(nodeTypeName, nodeType) return nodeType } fun populateArtifactType( - bluePrintContext: BlueprintContext, - bluePrintRepoService: BlueprintRepoService, + bluePrintContext: BluePrintContext, + bluePrintRepoService: BluePrintRepoService, artifactTypeName: String ): ArtifactType { val artifactType = bluePrintContext.serviceTemplate.artifactTypes?.get(artifactTypeName) ?: bluePrintRepoService.getArtifactType(artifactTypeName) - ?: throw BlueprintException("couldn't get ArtifactType($artifactTypeName) from repo.") + ?: throw BluePrintException("couldn't get ArtifactType($artifactTypeName) from repo.") bluePrintContext.serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType) return artifactType } @@ -154,7 +154,7 @@ class BlueprintEnhancerUtils { outputFileName: String = "enhanced-cba.zip" ): ByteArray { val compressedFile = normalizedFile(archiveDir, outputFileName) - BlueprintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile) + BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile) return compressedFile.readBytes() } @@ -166,7 +166,7 @@ class BlueprintEnhancerUtils { ): ResponseEntity<Resource> { val compressedFile = normalizedFile(archiveDir, outputFileName) - BlueprintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile) + BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile) return prepareResourceEntity(compressedFile) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt index 78f9e1688..08de136d8 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt @@ -18,9 +18,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType import org.onap.ccsdk.cds.controllerblueprints.core.data.CapabilityDefinition import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType @@ -41,25 +41,25 @@ class ModelTypeValidator { fun validateModelTypeDefinition(definitionType: String, definitionContent: JsonNode): Boolean { when (definitionType) { - BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE -> { + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE -> { JacksonUtils.readValue(definitionContent, DataType::class.java) - ?: throw BlueprintException("Model type definition is not DataType valid content $definitionContent") + ?: throw BluePrintException("Model type definition is not DataType valid content $definitionContent") } - BlueprintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE -> { + BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE -> { JacksonUtils.readValue(definitionContent, NodeType::class.java) - ?: throw BlueprintException("Model type definition is not NodeType valid content $definitionContent") + ?: throw BluePrintException("Model type definition is not NodeType valid content $definitionContent") } - BlueprintConstants.MODEL_DEFINITION_TYPE_ARTIFACT_TYPE -> { + BluePrintConstants.MODEL_DEFINITION_TYPE_ARTIFACT_TYPE -> { JacksonUtils.readValue(definitionContent, ArtifactType::class.java) - ?: throw BlueprintException("Model type definition is not ArtifactType valid content $definitionContent") + ?: throw BluePrintException("Model type definition is not ArtifactType valid content $definitionContent") } - BlueprintConstants.MODEL_DEFINITION_TYPE_CAPABILITY_TYPE -> { + BluePrintConstants.MODEL_DEFINITION_TYPE_CAPABILITY_TYPE -> { JacksonUtils.readValue(definitionContent, CapabilityDefinition::class.java) - ?: throw BlueprintException("Model type definition is not CapabilityDefinition valid content $definitionContent") + ?: throw BluePrintException("Model type definition is not CapabilityDefinition valid content $definitionContent") } - BlueprintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE -> { + BluePrintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE -> { JacksonUtils.readValue(definitionContent, RelationshipType::class.java) - ?: throw BlueprintException("Model type definition is not RelationshipType valid content $definitionContent") + ?: throw BluePrintException("Model type definition is not RelationshipType valid content $definitionContent") } } return true @@ -74,7 +74,7 @@ class ModelTypeValidator { fun validateModelType(modelType: ModelType?): Boolean { checkNotNull(modelType) { "Model Type Information is missing." } - val validRootTypes = BlueprintTypes.validModelTypes() + val validRootTypes = BluePrintTypes.validModelTypes() check(validRootTypes.contains(modelType.definitionType)) { "Not Valid Model Root Type(${modelType.definitionType}), It should be $validRootTypes" diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt index ed60f721a..a2f208367 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintManagementGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt @@ -30,15 +30,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.TokenAuthGrpcClientSe 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.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.management.api.BlueprintBootstrapInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintDownloadInput -import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementServiceGrpc -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.BluePrintBootstrapInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintDownloadInput +import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementServiceGrpc +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.DownloadAction import org.onap.ccsdk.cds.controllerblueprints.management.api.FileChunk import org.onap.ccsdk.cds.controllerblueprints.management.api.RemoveAction @@ -58,13 +58,13 @@ import kotlin.test.assertTrue classes = [DesignerApiTestConfiguration::class, ErrorCatalogTestConfiguration::class] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) -class BlueprintManagementGRPCHandlerTest { +class BluePrintManagementGRPCHandlerTest { @get:Rule val grpcServerRule = GrpcServerRule().directExecutor() @Autowired - lateinit var bluePrintManagementGRPCHandler: BlueprintManagementGRPCHandler + lateinit var bluePrintManagementGRPCHandler: BluePrintManagementGRPCHandler @BeforeTest fun init() { @@ -86,13 +86,13 @@ class BlueprintManagementGRPCHandlerTest { @Test fun testBootstrap() { - val blockingStub = BlueprintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) val id = "123_Bootstrap" val req = createBootstrapInputRequest(id) val bootstrapOutput = blockingStub.bootstrapBlueprint(req) assertEquals(200, bootstrapOutput.status.code) assertTrue( - bootstrapOutput.status.message!!.contentEquals(BlueprintConstants.STATUS_SUCCESS), + bootstrapOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(EventType.EVENT_COMPONENT_EXECUTED, bootstrapOutput.status.eventType) @@ -101,14 +101,14 @@ class BlueprintManagementGRPCHandlerTest { @Test fun `test upload and download blueprint`() { - val blockingStub = BlueprintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) val id = "123_upload" val req = createUploadInputRequest(id, UploadAction.PUBLISH.toString()) val output = blockingStub.uploadBlueprint(req) assertEquals(200, output.status.code) assertTrue( - output.status.message!!.contentEquals(BlueprintConstants.STATUS_SUCCESS), + output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(EventType.EVENT_COMPONENT_EXECUTED, output.status.eventType) @@ -120,7 +120,7 @@ class BlueprintManagementGRPCHandlerTest { val downloadOutput = blockingStub.downloadBlueprint(downloadReq) assertEquals(200, downloadOutput.status.code) assertTrue( - downloadOutput.status.message!!.contentEquals(BlueprintConstants.STATUS_SUCCESS), + downloadOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(EventType.EVENT_COMPONENT_EXECUTED, downloadOutput.status.eventType) @@ -130,14 +130,14 @@ class BlueprintManagementGRPCHandlerTest { @Test fun `test delete blueprint`() { - val blockingStub = BlueprintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) val id = "123_delete" val req = createUploadInputRequest(id, UploadAction.DRAFT.toString()) var output = blockingStub.uploadBlueprint(req) assertEquals(200, output.status.code) assertTrue( - output.status.message!!.contentEquals(BlueprintConstants.STATUS_SUCCESS), + output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS), "failed to get success status" ) assertEquals(id, output.commonHeader.requestId) @@ -160,7 +160,7 @@ class BlueprintManagementGRPCHandlerTest { val basicAuthGrpcClientService = TokenAuthGrpcClientService(tokenAuthGrpcClientProperties) val channel = basicAuthGrpcClientService.channel() - val blockingStub = BlueprintManagementServiceGrpc.newBlockingStub(channel) + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(channel) val bluePrintUploadInput = createUploadInputRequest("12345", UploadAction.DRAFT.toString()) @@ -169,7 +169,7 @@ class BlueprintManagementGRPCHandlerTest { } } - private fun createBootstrapInputRequest(id: String): BlueprintBootstrapInput { + private fun createBootstrapInputRequest(id: String): BluePrintBootstrapInput { val commonHeader = CommonHeader .newBuilder() .setTimestamp("2012-04-23T18:25:43.511Z") @@ -177,7 +177,7 @@ class BlueprintManagementGRPCHandlerTest { .setRequestId(id) .setSubRequestId("1234-56").build() - return BlueprintBootstrapInput.newBuilder() + return BluePrintBootstrapInput.newBuilder() .setCommonHeader(commonHeader) .setLoadModelType(false) .setLoadResourceDictionary(false) @@ -185,7 +185,7 @@ class BlueprintManagementGRPCHandlerTest { .build() } - private fun createUploadInputRequest(id: String, action: String): BlueprintUploadInput { + private fun createUploadInputRequest(id: String, action: String): BluePrintUploadInput { val file = normalizedFile("./target/blueprints/generated-cba.zip") assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") @@ -205,14 +205,14 @@ class BlueprintManagementGRPCHandlerTest { val fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(file.inputStream().readBytes())) .build() - return BlueprintUploadInput.newBuilder() + return BluePrintUploadInput.newBuilder() .setCommonHeader(commonHeader) .setActionIdentifiers(actionIdentifier) .setFileChunk(fileChunk) .build() } - private fun createDownloadInputRequest(id: String, action: String): BlueprintDownloadInput { + private fun createDownloadInputRequest(id: String, action: String): BluePrintDownloadInput { val commonHeader = CommonHeader .newBuilder() .setTimestamp("2012-04-23T18:25:43.511Z") @@ -220,7 +220,7 @@ class BlueprintManagementGRPCHandlerTest { .setRequestId(id) .setSubRequestId("1234-56").build() - return BlueprintDownloadInput.newBuilder() + return BluePrintDownloadInput.newBuilder() .setCommonHeader(commonHeader) .setActionIdentifiers( ActionIdentifiers.newBuilder() @@ -231,7 +231,7 @@ class BlueprintManagementGRPCHandlerTest { .build() } - private fun createRemoveInputRequest(id: String): BlueprintRemoveInput { + private fun createRemoveInputRequest(id: String): BluePrintRemoveInput { val commonHeader = CommonHeader .newBuilder() .setTimestamp("2012-04-23T18:25:43.511Z") @@ -239,7 +239,7 @@ class BlueprintManagementGRPCHandlerTest { .setRequestId(id) .setSubRequestId("1234-56").build() - return BlueprintRemoveInput.newBuilder() + return BluePrintRemoveInput.newBuilder() .setCommonHeader(commonHeader) .setActionIdentifiers( ActionIdentifiers.newBuilder() diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelControllerTest.kt index 92f369b01..a42ac05e7 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelControllerTest.kt @@ -28,7 +28,7 @@ import org.junit.runner.RunWith import org.junit.runners.MethodSorters import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelSearch import org.onap.ccsdk.cds.controllerblueprints.core.compress -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.deleteDir import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile @@ -79,7 +79,7 @@ class BlueprintModelControllerTest { @Autowired lateinit var webTestClient: WebTestClient - private var bluePrintLoadConfiguration: BlueprintLoadConfiguration? = null + private var bluePrintLoadConfiguration: BluePrintLoadConfiguration? = null private val blueprintDir = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" private var zipBlueprintFileName: String? = null @@ -90,7 +90,7 @@ class BlueprintModelControllerTest { fun setUp() { assertNotNull(webTestClient, " Failed to create WebTestClient") - bluePrintLoadConfiguration = BlueprintLoadConfiguration().apply { + bluePrintLoadConfiguration = BluePrintLoadConfiguration().apply { blueprintArchivePath = "./target/blueprints/archive" blueprintWorkingPath = "./target/blueprints/work" blueprintDeployPath = "./target/blueprints/deploy" @@ -113,7 +113,7 @@ class BlueprintModelControllerTest { } @Test - fun test01_saveBlueprint() { + fun test01_saveBluePrint() { bp = runBlocking { val body = MultipartBodyBuilder().apply { part( @@ -146,7 +146,7 @@ class BlueprintModelControllerTest { @Test @Throws(JSONException::class) - fun test02_getBlueprintByNameAndVersion() { + fun test02_getBluePrintByNameAndVersion() { webTestClient( HttpMethod.GET, null, "/api/v1/blueprint-model/by-name/${bp!!.artifactName}/version/${bp!!.artifactVersion}", @@ -172,7 +172,7 @@ class BlueprintModelControllerTest { @Test @Throws(JSONException::class) - fun test05_downloadBlueprint() { + fun test05_downloadBluePrint() { webTestClient( HttpMethod.GET, null, "/api/v1/blueprint-model/download/${bp!!.id}", @@ -237,7 +237,7 @@ class BlueprintModelControllerTest { } @Test - fun test10_deleteBlueprint() { + fun test10_deleteBluePrint() { // webTestClient.delete().uri("/api/v1/blueprint-model/${bp!!.id}") // .header("Authorization", "Basic " + Base64Utils // .encodeToString(("ccsdkapps" + ":" + "ccsdkapps").toByteArray(UTF_8))) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt index bcce13e4c..8226aaad0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt @@ -23,7 +23,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired @@ -56,15 +56,15 @@ class ModelTypeControllerTest { val content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json") var modelType = ModelType() - modelType.definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE - modelType.derivedFrom = BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + modelType.definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + modelType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT modelType.description = "Definition for Sample Datatype " modelType.definition = JacksonUtils.jsonNode(content) modelType.modelName = modelName modelType.version = "1.0.0" modelType.tags = ( - "test-datatype ," + BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + - BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE ) modelType.updatedBy = "xxxxxx@xxx.com" modelType = modelTypeController.saveModelType(modelType) @@ -108,7 +108,7 @@ class ModelTypeControllerTest { Assert.assertNotNull("Failed to get Id for api call getModelByName ", dbModelType!!.modelName) val dbDatatypeModelTypes = - modelTypeController.getModelTypeByDefinitionType(BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE) + modelTypeController.getModelTypeByDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE) Assert.assertNotNull("Failed to find getModelTypeByDefinitionType by tags", dbDatatypeModelTypes) Assert.assertTrue("Failed to find getModelTypeByDefinitionType by count", dbDatatypeModelTypes.isNotEmpty()) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/TestDatabaseConfiguration.kt index 7fcea4dcc..6808a2717 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary", diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintEnhancerServiceImplTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt index 8bdfbbb22..a866dcad3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BlueprintEnhancerServiceImplTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintEnhancerServiceImplTest.kt @@ -25,8 +25,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfig import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load.ModelTypeLoadService import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load.ResourceDictionaryLoadService import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -38,7 +38,7 @@ import org.springframework.test.context.junit4.SpringRunner classes = [DesignerApiTestConfiguration::class] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) -class BlueprintEnhancerServiceImplTest { +class BluePrintEnhancerServiceImplTest { @Autowired lateinit var modelTypeLoadService: ModelTypeLoadService @@ -47,10 +47,10 @@ class BlueprintEnhancerServiceImplTest { lateinit var resourceDictionaryLoadService: ResourceDictionaryLoadService @Autowired - lateinit var bluePrintEnhancerService: BlueprintEnhancerService + lateinit var bluePrintEnhancerService: BluePrintEnhancerService @Autowired - lateinit var bluePrintValidatorService: BlueprintValidatorService + lateinit var bluePrintValidatorService: BluePrintValidatorService @Test @Throws(Exception::class) @@ -100,8 +100,8 @@ class BlueprintEnhancerServiceImplTest { val bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath) Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext) - // Validate the Generated Blueprints - val valid = bluePrintValidatorService.validateBlueprints(targetPath) + // Validate the Generated BluePrints + val valid = bluePrintValidatorService.validateBluePrints(targetPath) Assert.assertTrue("blueprint($basePath) validation failed ", valid) // Enable this to get the enhanced zip file diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt index 3112bfb66..8ee2eb3a2 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt @@ -24,7 +24,7 @@ import org.junit.runner.RunWith import org.junit.runners.MethodSorters import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired @@ -57,15 +57,15 @@ class ModelTypeServiceTest { val content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json") var modelType = ModelType() - modelType.definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE - modelType.derivedFrom = BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + modelType.definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + modelType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT modelType.description = "Definition for Sample Datatype " modelType.definition = JacksonUtils.jsonNode(content) modelType.modelName = modelName modelType.version = "1.0.0" modelType.tags = ( - "test-datatype ," + BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + - BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE ) modelType.updatedBy = "xxxxxx@xxx.com" modelType = modelTypeHandler!!.saveModel(modelType) @@ -110,11 +110,11 @@ class ModelTypeServiceTest { Assert.assertNotNull("Failed to get response for api call getModelByName ", dbModelType) Assert.assertNotNull("Failed to get Id for api call getModelByName ", dbModelType!!.modelName) - val dbDatatypeModelTypes = modelTypeHandler.getModelTypeByDefinitionType(BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE) + val dbDatatypeModelTypes = modelTypeHandler.getModelTypeByDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE) Assert.assertNotNull("Failed to find getModelTypeByDefinitionType by tags", dbDatatypeModelTypes) Assert.assertTrue("Failed to find getModelTypeByDefinitionType by count", dbDatatypeModelTypes.size > 0) - val dbModelTypeByDerivedFroms = modelTypeHandler.getModelTypeByDerivedFrom(BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT) + val dbModelTypeByDerivedFroms = modelTypeHandler.getModelTypeByDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT) Assert.assertNotNull("Failed to find getModelTypeByDerivedFrom by tags", dbModelTypeByDerivedFroms) Assert.assertTrue("Failed to find getModelTypeByDerivedFrom by count", dbModelTypeByDerivedFroms.size > 0) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt index 9bc8c6291..ca85ed22f 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt @@ -23,7 +23,7 @@ import org.junit.runner.RunWith import org.junit.runners.MethodSorters import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired @@ -59,15 +59,15 @@ class ModelTypeReactRepositoryTest { val content = normalizedFile("./src/test/resources/model_type/data_type/datatype-property.json") .readText(Charset.defaultCharset()) val modelType = ModelType() - modelType.definitionType = BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE - modelType.derivedFrom = BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + modelType.definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + modelType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT modelType.description = "Definition for Sample Datatype " modelType.definition = JacksonUtils.jsonNode(content) modelType.modelName = modelName modelType.version = "1.0.0" modelType.tags = ( - "test-datatype ," + BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + - BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + "test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE ) modelType.updatedBy = "xxxxxx@xxx.com" @@ -81,11 +81,11 @@ class ModelTypeReactRepositoryTest { Assert.assertNotNull("Failed to findByModelName ", dbFindByModelName) val dbFindByDefinitionType = - modelTypeReactRepository.findByDefinitionType(BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE).collectList().block() + modelTypeReactRepository.findByDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE).collectList().block() Assert.assertNotNull("Failed to findByDefinitionType ", dbFindByDefinitionType) Assert.assertTrue("Failed to findByDefinitionType count", dbFindByDefinitionType!!.size > 0) - val dbFindByDerivedFrom = modelTypeReactRepository.findByDerivedFrom(BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT).collectList().block() + val dbFindByDerivedFrom = modelTypeReactRepository.findByDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT).collectList().block() Assert.assertNotNull("Failed to find findByDerivedFrom", dbFindByDerivedFrom) Assert.assertTrue("Failed to find findByDerivedFrom by count", dbFindByDerivedFrom!!.size > 0) @@ -94,12 +94,12 @@ class ModelTypeReactRepositoryTest { Assert.assertTrue("Failed to findByModelNameIn by count", dbFindByModelNameIn!!.size > 0) val dbFindByDefinitionTypeIn = - modelTypeReactRepository.findByDefinitionTypeIn(Arrays.asList(BlueprintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)).collectList().block() + modelTypeReactRepository.findByDefinitionTypeIn(Arrays.asList(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)).collectList().block() Assert.assertNotNull("Failed to findByDefinitionTypeIn", dbFindByDefinitionTypeIn) Assert.assertTrue("Failed to findByDefinitionTypeIn by count", dbFindByDefinitionTypeIn!!.size > 0) val dbFindByDerivedFromIn = - modelTypeReactRepository.findByDerivedFromIn(Arrays.asList(BlueprintConstants.MODEL_TYPE_DATATYPES_ROOT)).collectList().block() + modelTypeReactRepository.findByDerivedFromIn(Arrays.asList(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT)).collectList().block() Assert.assertNotNull("Failed to find findByDerivedFromIn", dbFindByDerivedFromIn) Assert.assertTrue("Failed to find findByDerivedFromIn by count", dbFindByDerivedFromIn!!.size > 0) } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BlueprintEnhancerUtilsTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtilsTest.kt index 461af84c4..c644aeedd 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BlueprintEnhancerUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtilsTest.kt @@ -29,7 +29,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.reCreateDirs import java.util.UUID import kotlin.test.assertTrue -class BlueprintEnhancerUtilsTest { +class BluePrintEnhancerUtilsTest { private val blueprintDir = "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" private val blueprintArchivePath: String = "./target/blueprints/archive" @@ -61,8 +61,8 @@ class BlueprintEnhancerUtilsTest { val enhanceId = UUID.randomUUID().toString() val blueprintArchiveLocation = normalizedPathName(blueprintArchivePath, enhanceId) val blueprintEnrichmentLocation = normalizedPathName(blueprintEnrichmentPath, enhanceId) - BlueprintEnhancerUtils.copyFilePartToEnhanceDir(filePart, blueprintArchiveLocation, blueprintEnrichmentLocation) - BlueprintEnhancerUtils.compressEnhanceDirAndReturnFilePart(blueprintEnrichmentLocation, blueprintArchiveLocation) + BluePrintEnhancerUtils.copyFilePartToEnhanceDir(filePart, blueprintArchiveLocation, blueprintEnrichmentLocation) + BluePrintEnhancerUtils.compressEnhanceDirAndReturnFilePart(blueprintEnrichmentLocation, blueprintArchiveLocation) } } } diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt index ab1f9eb54..c1532cd35 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt @@ -38,7 +38,7 @@ open class HealthCheckProperties { @Value("#{'\${cdslistener.healthcheck.mapping-service-name-with-service-link:}'.split(']')}") private val cdsListenerServiceMapping: List<String>? = null - open fun getBlueprintBaseURL(): String? { + open fun getBluePrintBaseURL(): String? { return bluePrintProcessorBaseURL } @@ -46,7 +46,7 @@ open class HealthCheckProperties { return cdsListenerBaseURL } - open fun getBlueprintServiceInformation(): List<ServiceEndpoint> { + open fun getBluePrintServiceInformation(): List<ServiceEndpoint> { val serviceName = ServiceName.BLUEPRINT return getListOfServiceEndPoints(blueprintprocessorServiceMapping, serviceName) } diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/AbstractHealthCheck.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/AbstractHealthCheck.kt index 6bfc182e4..6d49ebe65 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/AbstractHealthCheck.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/AbstractHealthCheck.kt @@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory */ abstract class AbstractHealthCheck(private val endPointExecution: EndPointExecution) { - private var logger = LoggerFactory.getLogger(BlueprintProcessorHealthCheck::class.java) + private var logger = LoggerFactory.getLogger(BluePrintProcessorHealthCheck::class.java) private fun retrieveSystemStatus(list: List<ServiceEndpoint>): HealthApiResponse { val healthApiResponse: HealthApiResponse diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/BlueprintProcessorHealthCheck.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/BluePrintProcessorHealthCheck.kt index 9ffa82442..dddad52e2 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/BlueprintProcessorHealthCheck.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/health/BluePrintProcessorHealthCheck.kt @@ -28,13 +28,13 @@ import org.springframework.stereotype.Service * @version 1.0 */ @Service -open class BlueprintProcessorHealthCheck( +open class BluePrintProcessorHealthCheck( private val endPointExecution: EndPointExecution, private val healthCheckProperties: HealthCheckProperties ) : AbstractHealthCheck(endPointExecution) { override fun setupServiceEndpoint(): List<ServiceEndpoint> { - return healthCheckProperties.getBlueprintServiceInformation() + return healthCheckProperties.getBluePrintServiceInformation() } } diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.kt index 186d4190b..e3ba72428 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.kt @@ -31,7 +31,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.configuration.HealthChec import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.domain.HealthCheckStatus import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.domain.ServiceEndpoint import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.service.EndPointExecution -import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.service.health.BlueprintProcessorHealthCheck +import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.service.health.BluePrintProcessorHealthCheck import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService @@ -52,12 +52,12 @@ class HealthCheckServiceTest { @InjectMocks private var endPointExecution: EndPointExecution? = null - private var bluePrintProcessorHealthCheck: BlueprintProcessorHealthCheck? = null + private var bluePrintProcessorHealthCheck: BluePrintProcessorHealthCheck? = null @Before fun setup() { endPointExecution = Mockito.spy(endPointExecution!!) - Mockito.`when`(healthCheckProperties!!.getBlueprintServiceInformation()).thenReturn( + Mockito.`when`(healthCheckProperties!!.getBluePrintServiceInformation()).thenReturn( Arrays.asList( ServiceEndpoint("Execution service ", "http://cds-blueprints-processor-http:8080/api/v1/execution-service/health-check"), ServiceEndpoint("Resources service", "http://cds-blueprints-processor-http:8080/api/v1/resources/health-check"), @@ -65,7 +65,7 @@ class HealthCheckServiceTest { ) ) - bluePrintProcessorHealthCheck = BlueprintProcessorHealthCheck(endPointExecution!!, healthCheckProperties) + bluePrintProcessorHealthCheck = BluePrintProcessorHealthCheck(endPointExecution!!, healthCheckProperties) } @Test diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/controller/CombinedMetrics.kt b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/controller/CombinedMetrics.kt index d2206df51..d2f02028c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/controller/CombinedMetrics.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/controller/CombinedMetrics.kt @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.ResponseBody import org.springframework.web.bind.annotation.RestController /** - * Exposes API for checking Metrics of Blueprint processor and CDSListener. + * Exposes API for checking Metrics of BluePrint processor and CDSListener. * * @author Shaaban Ebrahim * @version 1.0 @@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RestController @RequestMapping("/api/v1/combinedMetrics") @Api( value = "/api/v1/combinedMetrics", - description = "gather all Metrics info from Blueprint and CDSListener" + description = "gather all Metrics info from BluePrint and CDSListener" ) open class CombinedMetrics(private val combinedMetricsService: CombinedMetricsService) { diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedHealthService.kt b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedHealthService.kt index c7652010b..f4c3e93bf 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedHealthService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedHealthService.kt @@ -23,7 +23,7 @@ import org.springframework.boot.actuate.health.Status import org.springframework.stereotype.Service /** - *Service for combined health (BlueprintProcessor and CDSListener) + *Service for combined health (BluePrintProcessor and CDSListener) * * @author Shaaban Ebrahim * @version 1.0 @@ -36,7 +36,7 @@ open class CombinedHealthService( private fun setupServiceEndpoint(): List<ServiceEndpoint> { return listOf( - ServiceEndpoint("BlueprintProcessor Health Check ", healthCheckProperties.getBlueprintBaseURL() + "actuator/health"), + ServiceEndpoint("BluePrintProcessor Health Check ", healthCheckProperties.getBluePrintBaseURL() + "actuator/health"), ServiceEndpoint("CDSListener Health Check", healthCheckProperties.getCDSListenerBaseURL() + "actuator/health") ) } diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedMetricsService.kt b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedMetricsService.kt index b4d54f65e..0a2e7ae24 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedMetricsService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/service/CombinedMetricsService.kt @@ -27,7 +27,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientSer import org.springframework.stereotype.Service /** - *Service for combined Metrics for CDS Listener and BlueprintProcessor + *Service for combined Metrics for CDS Listener and BluePrintProcessor * * @author Shaaban Ebrahim * @version 1.0 @@ -41,7 +41,7 @@ open class CombinedMetricsService( private fun setupServiceEndpoint(): List<ServiceEndpoint> { return listOf( - ServiceEndpoint("BlueprintProcessor metrics", healthCheckProperties.getBlueprintBaseURL() + "/actuator/metrics"), + ServiceEndpoint("BluePrintProcessor metrics", healthCheckProperties.getBluePrintBaseURL() + "/actuator/metrics"), ServiceEndpoint("CDS Listener metrics", healthCheckProperties.getCDSListenerBaseURL() + "/actuator/metrics") ) } diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckApplicationTests.kt b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckApplicationTests.kt index 5c35fc377..1f3d256b3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckApplicationTests.kt +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckApplicationTests.kt @@ -18,10 +18,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.healthapi /* 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.services.execution.ComponentScriptExecutor -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest import org.springframework.context.annotation.ComponentScan @@ -41,8 +41,8 @@ import org.springframework.test.web.reactive.server.WebTestClient @RunWith(SpringRunner::class) @WebFluxTest @ContextConfiguration( - classes = [BlueprintRuntimeService::class, BlueprintCoreConfiguration::class, - BlueprintCatalogService::class, ComponentScriptExecutor::class] + classes = [BluePrintRuntimeService::class, BluePrintCoreConfiguration::class, + BluePrintCatalogService::class, ComponentScriptExecutor::class] ) @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"]) @TestPropertySource(locations = ["classpath:application-test.properties"]) diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceControllerTest.kt index 77471bd58..40d6f56cb 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceControllerTest.kt @@ -22,7 +22,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolution import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.ResourceResolutionDBService -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -242,7 +242,7 @@ class ResourceControllerTest { resourceAssignment.dictionaryName = "dd$prefix" resourceAssignment.dictionarySource = "source$prefix" resourceAssignment.version = 2 - resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS + resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS resourceAssignment.property = property return resourceAssignment } diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateControllerTest.kt index ff9aadb19..945a30c64 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateControllerTest.kt @@ -19,9 +19,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.resource.api 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.controllerblueprints.core.deleteDir -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest @@ -38,8 +38,8 @@ import kotlin.test.AfterTest @WebFluxTest @ContextConfiguration( classes = [ - TestDatabaseConfiguration::class, BlueprintCoreConfiguration::class, - BlueprintCatalogService::class, ErrorCatalogTestConfiguration::class + TestDatabaseConfiguration::class, BluePrintCoreConfiguration::class, + BluePrintCatalogService::class, ErrorCatalogTestConfiguration::class ] ) @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"]) diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TestDatabaseConfiguration.kt index 61d1595e8..6d87d2735 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.resource.api -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary", diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt index 98577db26..79106c24a 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt @@ -20,10 +20,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api import io.grpc.Status import io.grpc.stub.StreamObserver import kotlinx.coroutines.runBlocking -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintCoreConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.toJava -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +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 import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes @@ -37,14 +37,14 @@ import java.util.concurrent.Phaser import javax.annotation.PreDestroy @Service -open class BlueprintProcessingGRPCHandler( - private val bluePrintCoreConfiguration: BlueprintCoreConfiguration, +open class BluePrintProcessingGRPCHandler( + private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, private val executionServiceHandler: ExecutionServiceHandler, private val errorCatalogService: ErrorCatalogService ) : - BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase() { + BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() { - private val log = LoggerFactory.getLogger(BlueprintProcessingGRPCHandler::class.java) + private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandler::class.java) private val ph = Phaser(1) @@ -69,7 +69,7 @@ open class BlueprintProcessingGRPCHandler( override fun onError(error: Throwable) { log.debug("Fail to process message", error) - if (error is BlueprintProcessorException) onErrorCatalog(error) else onError(error) + if (error is BluePrintProcessorException) onErrorCatalog(error) else onError(error) } fun onError(error: Exception) { @@ -81,7 +81,7 @@ open class BlueprintProcessingGRPCHandler( ) } - fun onErrorCatalog(error: BlueprintProcessorException) { + fun onErrorCatalog(error: BluePrintProcessorException) { if (error.protocol == "") { error.grpc(ErrorCatalogCodes.GENERIC_FAILURE) } @@ -103,7 +103,7 @@ open class BlueprintProcessingGRPCHandler( @PreDestroy fun preDestroy() { - val name = "BlueprintProcessingGRPCHandler" + val name = "BluePrintProcessingGRPCHandler" log.info("Starting to shutdown $name waiting for in-flight requests to finish ...") ph.arriveAndAwaitAdvance() log.info("Done waiting in $name") diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingKafkaConsumer.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt index 82fd78efe..ed9b4d57e 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingKafkaConsumer.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumer.kt @@ -24,10 +24,10 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.message.BlueprintMessageMetricConstants -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.utils.BlueprintMessageUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsType import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage @@ -45,13 +45,13 @@ import javax.annotation.PreDestroy havingValue = "true" ) @Service -open class BlueprintProcessingKafkaConsumer( - private val blueprintMessageLibPropertyService: BlueprintMessageLibPropertyService, +open class BluePrintProcessingKafkaConsumer( + private val blueprintMessageLibPropertyService: BluePrintMessageLibPropertyService, private val executionServiceHandler: ExecutionServiceHandler, private val meterRegistry: MeterRegistry ) { - val log = logger(BlueprintProcessingKafkaConsumer::class) + val log = logger(BluePrintProcessingKafkaConsumer::class) private val ph = Phaser(1) @@ -75,28 +75,28 @@ open class BlueprintProcessingKafkaConsumer( blueprintMessageConsumerService = try { blueprintMessageLibPropertyService .blueprintMessageConsumerService(CONSUMER_SELECTOR) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed creating Kafka consumer message service." throw e.updateErrorMessage( SelfServiceApiDomains.SELF_SERVICE_API, errorMsg, "Wrong Kafka selector provided or internal error in Kafka service." ) } catch (e: Exception) { - throw BlueprintProcessorException("failed to create consumer service ${e.message}") + throw BluePrintProcessorException("failed to create consumer service ${e.message}") } /** Get the Message Producer Service **/ val blueprintMessageProducerService = try { blueprintMessageLibPropertyService .blueprintMessageProducerService(PRODUCER_SELECTOR) - } catch (e: BlueprintProcessorException) { + } catch (e: BluePrintProcessorException) { val errorMsg = "Failed creating Kafka producer message service." throw e.updateErrorMessage( SelfServiceApiDomains.SELF_SERVICE_API, errorMsg, "Wrong Kafka selector provided or internal error in Kafka service." ) } catch (e: Exception) { - throw BlueprintProcessorException("failed to create producer service ${e.message}") + throw BluePrintProcessorException("failed to create producer service ${e.message}") } launch { diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt index 6c6c26c43..bb7ecc6ad 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt @@ -27,11 +27,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutp import org.onap.ccsdk.cds.blueprintsprocessor.core.cluster.optionalClusterService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.mdcWebCoroutineScope import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils.determineHttpStatusCode -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes import org.springframework.beans.factory.annotation.Autowired import org.springframework.http.MediaType @@ -70,8 +70,8 @@ open class ExecutionServiceController { suspend fun executionServiceControllerHealthCheck(): ResponseEntity<JsonNode> = mdcWebCoroutineScope { var body = mutableMapOf("success" to true) var statusCode = 200 - if (BlueprintConstants.CLUSTER_ENABLED && - BlueprintDependencyService.optionalClusterService()?.clusterJoined() != true + if (BluePrintConstants.CLUSTER_ENABLED && + BluePrintDependencyService.optionalClusterService()?.clusterJoined() != true ) { statusCode = 503 body.remove("success") diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt index 8c958c4b4..e604987a7 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt @@ -34,21 +34,21 @@ import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.SelfServiceMetricC import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils.cbaMetricTags import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractServiceFunction import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.config.BlueprintLoadConfiguration -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @Service class ExecutionServiceHandler( - private val bluePrintLoadConfiguration: BlueprintLoadConfiguration, - private val blueprintsProcessorCatalogService: BlueprintCatalogService, + private val bluePrintLoadConfiguration: BluePrintLoadConfiguration, + private val blueprintsProcessorCatalogService: BluePrintCatalogService, private val bluePrintWorkflowExecutionService: - BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>, + BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>, private val publishAuditService: PublishAuditService, private val meterRegistry: MeterRegistry ) { @@ -111,14 +111,14 @@ class ExecutionServiceHandler( val basePath = blueprintsProcessorCatalogService.getFromDatabase(blueprintName, blueprintVersion) log.info("blueprint base path $basePath") - val blueprintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(requestId, basePath.toString()) + val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath.toString()) - executionServiceOutput = bluePrintWorkflowExecutionService.executeBlueprintWorkflow( + executionServiceOutput = bluePrintWorkflowExecutionService.executeBluePrintWorkflow( blueprintRuntimeService, executionServiceInput, hashMapOf() ) - val errors = blueprintRuntimeService.getBlueprintError().allErrors() + val errors = blueprintRuntimeService.getBluePrintError().allErrors() if (errors.isNotEmpty()) { setErrorStatus(errors.joinToString(", "), executionServiceOutput.status) } @@ -144,7 +144,7 @@ class ExecutionServiceHandler( /** If no blueprint is needed, then get the Service function instance mapping to the action name and execute it */ suspend fun executeServiceFunction(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { val actionName = executionServiceInput.actionIdentifiers.actionName - val instance = BlueprintDependencyService.instance<AbstractServiceFunction>(actionName) + val instance = BluePrintDependencyService.instance<AbstractServiceFunction>(actionName) checkNotNull(instance) { "failed to initialize service function($actionName)" } instance.actionName = actionName return instance.applyNB(executionServiceInput) @@ -154,7 +154,7 @@ class ExecutionServiceHandler( status.errorMessage = errorMessage status.eventType = EventType.EVENT_COMPONENT_FAILURE.name status.code = 500 - status.message = BlueprintConstants.STATUS_FAILURE + status.message = BluePrintConstants.STATUS_FAILURE } private fun response( @@ -173,7 +173,7 @@ class ExecutionServiceHandler( } else { status.eventType = EventType.EVENT_COMPONENT_PROCESSING.name status.code = 200 - status.message = BlueprintConstants.STATUS_PROCESSING + status.message = BluePrintConstants.STATUS_PROCESSING } executionServiceOutput.status = status diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/KafkaPublishAuditService.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/KafkaPublishAuditService.kt index 46befee8a..ce407bc8c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/KafkaPublishAuditService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/KafkaPublishAuditService.kt @@ -22,16 +22,16 @@ import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -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.BlueprintMessageProducerService -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.common.ApplicationConstants -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.service.PropertyAssignmentService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -57,8 +57,8 @@ import javax.annotation.PostConstruct ) @Service class KafkaPublishAuditService( - private val bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService, - private val blueprintsProcessorCatalogService: BlueprintCatalogService + private val bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService, + private val blueprintsProcessorCatalogService: BluePrintCatalogService ) : PublishAuditService { private var inputInstance: BlueprintMessageProducerService? = null @@ -166,7 +166,7 @@ class KafkaPublishAuditService( val basePath = blueprintsProcessorCatalogService.getFromDatabase(blueprintName, blueprintVersion) - val blueprintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(requestId, basePath.toString()) + val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath.toString()) val blueprintContext = blueprintRuntimeService.bluePrintContext() blueprintContext.workflowSteps(workflowName).forEach { step -> @@ -175,9 +175,9 @@ class KafkaPublishAuditService( val nodeTemplate = blueprintContext.nodeTemplateByName(nodeTemplateName) /** We need to check in his Node Template Dependencies is case of a Node Template DG */ - if (nodeTemplate.type == BlueprintConstants.NODE_TEMPLATE_TYPE_DG) { + if (nodeTemplate.type == BluePrintConstants.NODE_TEMPLATE_TYPE_DG) { val dependencyNodeTemplate = - nodeTemplate.properties?.get(BlueprintConstants.PROPERTY_DG_DEPENDENCY_NODE_TEMPLATE) as ArrayNode + nodeTemplate.properties?.get(BluePrintConstants.PROPERTY_DG_DEPENDENCY_NODE_TEMPLATE) as ArrayNode dependencyNodeTemplate.forEach { dependencyNodeTemplateName -> clonedExecutionServiceInput = hideSensitiveDataFromResourceResolution( blueprintRuntimeService, @@ -220,15 +220,15 @@ class KafkaPublishAuditService( * @return [executionServiceInput] with sensitive inputs replaced by a generic string */ private suspend fun hideSensitiveDataFromResourceResolution( - blueprintRuntimeService: BlueprintRuntimeService<MutableMap<String, JsonNode>>, - blueprintContext: BlueprintContext, + blueprintRuntimeService: BluePrintRuntimeService<MutableMap<String, JsonNode>>, + blueprintContext: BluePrintContext, executionServiceInput: ExecutionServiceInput, workflowName: String, nodeTemplateName: String ): ExecutionServiceInput { val nodeTemplate = blueprintContext.nodeTemplateByName(nodeTemplateName) - if (nodeTemplate.type == BlueprintConstants.NODE_TEMPLATE_TYPE_COMPONENT_RESOURCE_RESOLUTION) { + if (nodeTemplate.type == BluePrintConstants.NODE_TEMPLATE_TYPE_COMPONENT_RESOURCE_RESOLUTION) { val interfaceName = blueprintContext.nodeTemplateFirstInterfaceName(nodeTemplateName) val operationName = blueprintContext.nodeTemplateFirstInterfaceFirstOperationName(nodeTemplateName) @@ -242,7 +242,7 @@ class KafkaPublishAuditService( val artifactPrefixNamesNode = propertyAssignments[ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES] val propertyAssignmentService = PropertyAssignmentService(blueprintRuntimeService) val artifactPrefixNamesNodeValue = propertyAssignmentService.resolveAssignmentExpression( - BlueprintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE, + BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TEMPLATE, nodeTemplateName, ResourceResolutionConstants.INPUT_ARTIFACT_PREFIX_NAMES, artifactPrefixNamesNode!! diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtils.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtils.kt index c04410a2f..17f7722c4 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtils.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtils.kt @@ -18,8 +18,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils import io.micrometer.core.instrument.Tag import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput -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.springframework.http.HttpStatus import org.springframework.http.codec.multipart.FilePart import org.springframework.util.StringUtils @@ -30,13 +30,13 @@ import java.util.UUID const val INTERNAL_SERVER_ERROR_HTTP_STATUS_CODE = 500 -@Throws(BlueprintException::class, IOException::class) +@Throws(BluePrintException::class, IOException::class) fun saveCBAFile(filePart: FilePart, targetDirectory: Path): Path { val fileName = StringUtils.cleanPath(filePart.filename()) if (StringUtils.getFilenameExtension(fileName) != "zip") { - throw BlueprintException("Invalid file extension required ZIP") + throw BluePrintException("Invalid file extension required ZIP") } val changedFileName = UUID.randomUUID().toString() + ".zip" @@ -68,19 +68,19 @@ fun determineHttpStatusCode(statusCode: Int): HttpStatus { fun cbaMetricTags(executionServiceInput: ExecutionServiceInput): MutableList<Tag> = executionServiceInput.actionIdentifiers.let { mutableListOf( - Tag.of(BlueprintConstants.METRIC_TAG_BP_NAME, it.blueprintName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_VERSION, it.blueprintVersion), - Tag.of(BlueprintConstants.METRIC_TAG_BP_ACTION, it.actionName) + Tag.of(BluePrintConstants.METRIC_TAG_BP_NAME, it.blueprintName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_VERSION, it.blueprintVersion), + Tag.of(BluePrintConstants.METRIC_TAG_BP_ACTION, it.actionName) ) } fun cbaMetricTags(executionServiceOutput: ExecutionServiceOutput): MutableList<Tag> = executionServiceOutput.let { mutableListOf( - Tag.of(BlueprintConstants.METRIC_TAG_BP_NAME, it.actionIdentifiers.blueprintName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_VERSION, it.actionIdentifiers.blueprintVersion), - Tag.of(BlueprintConstants.METRIC_TAG_BP_ACTION, it.actionIdentifiers.actionName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_STATUS, it.status.code.toString()), - Tag.of(BlueprintConstants.METRIC_TAG_BP_OUTCOME, it.status.message) + Tag.of(BluePrintConstants.METRIC_TAG_BP_NAME, it.actionIdentifiers.blueprintName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_VERSION, it.actionIdentifiers.blueprintVersion), + Tag.of(BluePrintConstants.METRIC_TAG_BP_ACTION, it.actionIdentifiers.actionName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_STATUS, it.status.code.toString()), + Tag.of(BluePrintConstants.METRIC_TAG_BP_OUTCOME, it.status.message) ) } diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BlueprintRuntimeValidatorService.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorService.kt index 23d4bf012..ff615536b 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BlueprintRuntimeValidatorService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorService.kt @@ -16,14 +16,14 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.validation -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeValidatorService -import org.onap.ccsdk.cds.controllerblueprints.validation.BlueprintDesignTimeValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeValidatorService +import org.onap.ccsdk.cds.controllerblueprints.validation.BluePrintDesignTimeValidatorService import org.onap.ccsdk.cds.controllerblueprints.validation.extension.ResourceDefinitionValidator import org.springframework.stereotype.Service @Service("bluePrintRuntimeValidatorService") -open class BlueprintRuntimeValidatorService( - bluePrintTypeValidatorService: BlueprintTypeValidatorService, +open class BluePrintRuntimeValidatorService( + bluePrintTypeValidatorService: BluePrintTypeValidatorService, resourceDefinitionValidator: ResourceDefinitionValidator ) : - BlueprintDesignTimeValidatorService(bluePrintTypeValidatorService, resourceDefinitionValidator) + BluePrintDesignTimeValidatorService(bluePrintTypeValidatorService, resourceDefinitionValidator) diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt index 3033103e3..0d79368ad 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt @@ -29,7 +29,7 @@ import org.junit.runner.RunWith import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils -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 import org.slf4j.LoggerFactory @@ -50,9 +50,9 @@ import kotlin.test.BeforeTest ] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) -class BlueprintProcessingGRPCHandlerTest { +class BluePrintProcessingGRPCHandlerTest { - private val log = LoggerFactory.getLogger(BlueprintProcessingGRPCHandlerTest::class.java) + private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandlerTest::class.java) @MockBean lateinit var meterRegistry: MeterRegistry @@ -61,7 +61,7 @@ class BlueprintProcessingGRPCHandlerTest { val grpcServerRule = GrpcServerRule().directExecutor() @Autowired - lateinit var bluePrintProcessingGRPCHandler: BlueprintProcessingGRPCHandler + lateinit var bluePrintProcessingGRPCHandler: BluePrintProcessingGRPCHandler lateinit var requestObs: StreamObserver<ExecutionServiceInput> @@ -69,7 +69,7 @@ class BlueprintProcessingGRPCHandlerTest { fun init() { grpcServerRule.serviceRegistry.addService(bluePrintProcessingGRPCHandler) - val blockingStub = BlueprintProcessingServiceGrpc.newStub(grpcServerRule.channel) + val blockingStub = BluePrintProcessingServiceGrpc.newStub(grpcServerRule.channel) requestObs = blockingStub.process(object : StreamObserver<ExecutionServiceOutput> { override fun onNext(executionServiceOuput: ExecutionServiceOutput) { diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingIntegrationTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingIntegrationTest.kt index d6109727f..80e953822 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingIntegrationTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingIntegrationTest.kt @@ -27,7 +27,7 @@ import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils -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 import org.springframework.test.context.ContextConfiguration @@ -35,9 +35,9 @@ import org.springframework.test.context.ContextConfiguration @ContextConfiguration( classes = [SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class] ) -class BlueprintProcessingIntegrationTest { +class BluePrintProcessingIntegrationTest { - private val log = logger(BlueprintProcessingIntegrationTest::class) + private val log = logger(BluePrintProcessingIntegrationTest::class) /** This is Integration test sample, Do not enable this test case in server build, this is for local desktop testing*/ // @Test @@ -52,7 +52,7 @@ class BlueprintProcessingIntegrationTest { val basicAuthGrpcClientService = TokenAuthGrpcClientService(tokenAuthGrpcClientProperties) val channel = basicAuthGrpcClientService.channel() - val stub = BlueprintProcessingServiceGrpc.newStub(channel) + val stub = BluePrintProcessingServiceGrpc.newStub(channel) repeat(1) { val requestObs = stub.process(object : StreamObserver<ExecutionServiceOutput> { override fun onNext(executionServiceOuput: ExecutionServiceOutput) { diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingKafkaConsumerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumerTest.kt index 56cc691a4..9143d7358 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BlueprintProcessingKafkaConsumerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/BluePrintProcessingKafkaConsumerTest.kt @@ -24,10 +24,10 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking 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.message.service.BlueprintMessageLibPropertyService +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.service.BluePrintMessageLibPropertyService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.ContextConfiguration @@ -39,18 +39,18 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BlueprintMessageLibConfiguration::class, SelfServiceApiTestConfiguration::class, - BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class, ErrorCatalogTestConfiguration::class + BluePrintMessageLibConfiguration::class, SelfServiceApiTestConfiguration::class, + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, ErrorCatalogTestConfiguration::class ] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) -class BlueprintProcessingKafkaConsumerTest { +class BluePrintProcessingKafkaConsumerTest { @MockBean lateinit var meterRegistry: MeterRegistry @Autowired - lateinit var bluePrintMessageLibPropertyService: BlueprintMessageLibPropertyService + lateinit var bluePrintMessageLibPropertyService: BluePrintMessageLibPropertyService @Test fun testExecutionInputMessageConsumer() { @@ -64,7 +64,7 @@ class BlueprintProcessingKafkaConsumerTest { coEvery { executionServiceHandle.doProcess(any()) } returns mockk() - val bluePrintProcessingKafkaConsumer = BlueprintProcessingKafkaConsumer( + val bluePrintProcessingKafkaConsumer = BluePrintProcessingKafkaConsumer( bluePrintMessageLibPropertyService, executionServiceHandle, meterRegistry diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt index f18471127..d7d7aaa2a 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceControllerTest.kt @@ -21,11 +21,11 @@ import io.micrometer.core.instrument.simple.SimpleMeterRegistry 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.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.controllerblueprints.core.compress import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintCatalogService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired @@ -45,8 +45,8 @@ import kotlin.test.assertTrue @WebFluxTest @ContextConfiguration( classes = [ - ExecutionServiceHandler::class, BlueprintCoreConfiguration::class, - BlueprintCatalogService::class, SelfServiceApiTestConfiguration::class, + ExecutionServiceHandler::class, BluePrintCoreConfiguration::class, + BluePrintCatalogService::class, SelfServiceApiTestConfiguration::class, ErrorCatalogTestConfiguration::class, SimpleMeterRegistry::class ] ) @@ -54,7 +54,7 @@ import kotlin.test.assertTrue class ExecutionServiceControllerTest { @Autowired - lateinit var blueprintsProcessorCatalogService: BlueprintCatalogService + lateinit var blueprintsProcessorCatalogService: BluePrintCatalogService @Autowired lateinit var webTestClient: WebTestClient diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt index 526491eb5..0a89c5782 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt @@ -32,7 +32,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractServiceFunction import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.context.ApplicationContext @@ -62,7 +62,7 @@ class ExecutionServiceHandlerTest { @Before fun init() { - BlueprintDependencyService.inject(applicationContext) + BluePrintDependencyService.inject(applicationContext) } @Test diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/TestDatabaseConfiguration.kt index 4401fde78..bca05f68b 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api -import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BlueprintDBLibConfiguration::class) +@Import(BluePrintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary", diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtilsTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtilsTest.kt index 10db349e6..375faa152 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BlueprintProcessingUtilsTest.kt @@ -24,7 +24,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.Status -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.springframework.http.HttpStatus import org.springframework.test.context.junit4.SpringRunner @@ -57,9 +57,9 @@ class BlueprintProcessingUtilsTest { } val expectedTags = mutableListOf( - Tag.of(BlueprintConstants.METRIC_TAG_BP_NAME, executionServiceInput.actionIdentifiers.blueprintName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_VERSION, executionServiceInput.actionIdentifiers.blueprintVersion), - Tag.of(BlueprintConstants.METRIC_TAG_BP_ACTION, executionServiceInput.actionIdentifiers.actionName) + Tag.of(BluePrintConstants.METRIC_TAG_BP_NAME, executionServiceInput.actionIdentifiers.blueprintName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_VERSION, executionServiceInput.actionIdentifiers.blueprintVersion), + Tag.of(BluePrintConstants.METRIC_TAG_BP_ACTION, executionServiceInput.actionIdentifiers.actionName) ) val metricTag = cbaMetricTags(executionServiceInput) @@ -82,11 +82,11 @@ class BlueprintProcessingUtilsTest { } val expectedTags = mutableListOf( - Tag.of(BlueprintConstants.METRIC_TAG_BP_NAME, executionServiceOutput.actionIdentifiers.blueprintName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_VERSION, executionServiceOutput.actionIdentifiers.blueprintVersion), - Tag.of(BlueprintConstants.METRIC_TAG_BP_ACTION, executionServiceOutput.actionIdentifiers.actionName), - Tag.of(BlueprintConstants.METRIC_TAG_BP_STATUS, executionServiceOutput.status.code.toString()), - Tag.of(BlueprintConstants.METRIC_TAG_BP_OUTCOME, executionServiceOutput.status.message) + Tag.of(BluePrintConstants.METRIC_TAG_BP_NAME, executionServiceOutput.actionIdentifiers.blueprintName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_VERSION, executionServiceOutput.actionIdentifiers.blueprintVersion), + Tag.of(BluePrintConstants.METRIC_TAG_BP_ACTION, executionServiceOutput.actionIdentifiers.actionName), + Tag.of(BluePrintConstants.METRIC_TAG_BP_STATUS, executionServiceOutput.status.code.toString()), + Tag.of(BluePrintConstants.METRIC_TAG_BP_OUTCOME, executionServiceOutput.status.message) ) val metricTag = cbaMetricTags(executionServiceOutput) diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BlueprintRuntimeValidatorServiceTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt index c6b90e5b7..84d057f55 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BlueprintRuntimeValidatorServiceTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/validation/BluePrintRuntimeValidatorServiceTest.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.mock.MockResourceSource -import org.onap.ccsdk.cds.controllerblueprints.validation.BlueprintValidationConfiguration +import org.onap.ccsdk.cds.controllerblueprints.validation.BluePrintValidationConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.junit4.SpringRunner @@ -29,14 +29,14 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BlueprintRuntimeValidatorService::class, - BlueprintValidationConfiguration::class, MockResourceSource::class + BluePrintRuntimeValidatorService::class, + BluePrintValidationConfiguration::class, MockResourceSource::class ] ) -class BlueprintRuntimeValidatorServiceTest { +class BluePrintRuntimeValidatorServiceTest { @Autowired - lateinit var bluePrintRuntimeValidatorService: BlueprintRuntimeValidatorService + lateinit var bluePrintRuntimeValidatorService: BluePrintRuntimeValidatorService @Test fun testBlueprintRuntimeValidation() { @@ -45,7 +45,7 @@ class BlueprintRuntimeValidatorServiceTest { "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" assertNotNull(bluePrintRuntimeValidatorService, " failed to initilize bluePrintRuntimeValidatorService") - bluePrintRuntimeValidatorService.validateBlueprints(blueprintBasePath) + bluePrintRuntimeValidatorService.validateBluePrints(blueprintBasePath) } } } |