resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=blueprints/deploy
-controllerblueprints.blueprintArchivePath=blueprints/archive
-controllerblueprints.blueprintWorkingPath=blueprints/work
+blueprintsprocessor.blueprintDeployPath=blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=blueprints/work
# Controller Blueprint Load Configurations
# blueprints.load.initial-data may be overridden by ENV variables
-controllerblueprints.loadInitialData=true
-controllerblueprints.loadBluePrint=false
-controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/service-blueprint
-controllerblueprints.loadModelType=true
-controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=true
-controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=true
+blueprintsprocessor.loadBluePrint=false
+blueprintsprocessor.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/service-blueprint
+blueprintsprocessor.loadModelType=true
+blueprintsprocessor.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=true
+blueprintsprocessor.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
-controllerblueprints.loadCbaExtension=zip
+blueprintsprocessor.loadCbaExtension=zip
### END -Controller Blueprints Properties
### blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
### blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
### blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working
-blueprintsprocessor.blueprintDeployPath=blueprints/deploy
-blueprintsprocessor.blueprintArchivePath=blueprints/archive
-blueprintsprocessor.blueprintWorkingPath=blueprints/work
# Primary Database Configuration
blueprintsprocessor.db.url=jdbc:mysql://localhost:3306/sdnctl
blueprintsprocessor.db.username=sdnctl
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=/opt/app/onap/blueprints/deploy
-controllerblueprints.blueprintArchivePath=/opt/app/onap/blueprints/archive
-controllerblueprints.blueprintWorkingPath=/opt/app/onap/blueprints/working
+blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working
# Controller Blueprint Load Configurations
# blueprints.load.initial-data may be overridden by ENV variables
-controllerblueprints.loadInitialData=false
-controllerblueprints.loadBluePrint=false
-controllerblueprints.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model/service-blueprint
-controllerblueprints.loadModelType=false
-controllerblueprints.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=false
-controllerblueprints.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=false
+blueprintsprocessor.loadBluePrint=false
+blueprintsprocessor.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model/service-blueprint
+blueprintsprocessor.loadModelType=false
+blueprintsprocessor.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=false
+blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
controllerblueprints.loadCbaExtension=zip
blueprintsprocessor.httpPort=8080
blueprintsprocessor.grpcPort=9111
-# Blueprint Processor File Execution and Handling Properties
-blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
-blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
-blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working
-
# Primary Database Configuration
blueprintsprocessor.db.url=jdbc:mysql://db:3306/sdnctl
blueprintsprocessor.db.username=sdnctl
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=/opt/app/onap/blueprints/deploy
-controllerblueprints.blueprintArchivePath=/opt/app/onap/blueprints/archive
-controllerblueprints.blueprintWorkingPath=/opt/app/onap/blueprints/working
+blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working
# Controller Blueprint Load Configurations
# blueprints.load.initial-data may be overridden by ENV variables
-controllerblueprints.loadInitialData=false
-controllerblueprints.loadBluePrint=false
-controllerblueprints.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model/service-blueprint
-controllerblueprints.loadModelType=false
-controllerblueprints.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=false
-controllerblueprints.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=false
+blueprintsprocessor.loadBluePrint=false
+blueprintsprocessor.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model/service-blueprint
+blueprintsprocessor.loadModelType=false
+blueprintsprocessor.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=false
+blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
controllerblueprints.loadCbaExtension=zip
blueprintsprocessor.grpcEnable=false
blueprintsprocessor.httpPort=8080
blueprintsprocessor.grpcPort=9111
-# Blueprint Processor File Execution and Handling Properties
-blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
-blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
-blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/work
+
# Primary Database Configuration
blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
blueprintsprocessor.db.username=sa
import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintProcessorProperties
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertySevice
@ContextConfiguration(classes = [DatabaseResourceAssignmentProcessor::class, BlueprintPropertyConfiguration::class,
BluePrintProperties::class, BluePrintDBLibPropertySevice::class, BluePrintDBLibConfiguration::class,
BluePrintCoreConfiguration::class, MockDatabaseConfiguration::class, MockBlueprintProcessorCatalogServiceImpl::class,
- BlueprintProcessorProperties::class])
+ BlueprintPropertiesService::class])
@TestPropertySource(locations = ["classpath:application-test.properties"])
class DatabaseResourceResolutionProcessorTest {
import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintProcessorModelRepository
import org.onap.ccsdk.cds.controllerblueprints.core.*
import org.onap.ccsdk.cds.controllerblueprints.core.common.ApplicationConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService
import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache
*/
@Service("blueprintsProcessorCatalogService")
class BlueprintProcessorCatalogServiceImpl(bluePrintRuntimeValidatorService: BluePrintValidatorService,
- private val bluePrintPathConfiguration: BluePrintPathConfiguration,
+ private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val blueprintModelRepository: BlueprintProcessorModelRepository)
- : BlueprintCatalogServiceImpl(bluePrintPathConfiguration, bluePrintRuntimeValidatorService) {
+ : BlueprintCatalogServiceImpl(bluePrintLoadConfiguration, bluePrintRuntimeValidatorService) {
private val log = LoggerFactory.getLogger(BlueprintProcessorCatalogServiceImpl::class.toString())
override suspend fun delete(name: String, version: String) {
// Clean blueprint script cache
val cacheKey = BluePrintFileUtils
- .compileCacheKey(normalizedPathName(bluePrintPathConfiguration.blueprintDeployPath, name, version))
+ .compileCacheKey(normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath, name, version))
BluePrintCompileCache.cleanClassLoader(cacheKey)
log.info("removed cba file name($name), version($version) from cache")
// Cleaning Deployed Blueprint
- deleteNBDir(bluePrintPathConfiguration.blueprintDeployPath, name, version)
+ deleteNBDir(bluePrintLoadConfiguration.blueprintDeployPath, name, version)
log.info("removed cba file name($name), version($version) from deploy location")
// Cleaning Data Base
blueprintModelRepository
override suspend fun get(name: String, version: String, extract: Boolean): Path? {
- val deployFile = normalizedFile(bluePrintPathConfiguration.blueprintDeployPath, name, version)
- val cbaFile = normalizedFile(bluePrintPathConfiguration.blueprintArchivePath,
+ val deployFile = normalizedFile(bluePrintLoadConfiguration.blueprintDeployPath, name, version)
+ val cbaFile = normalizedFile(bluePrintLoadConfiguration.blueprintArchivePath,
UUID.randomUUID().toString(), "cba.zip")
if (extract && deployFile.exists()) {
log.info("Overwriting blueprint model :$artifactName::$artifactVersion")
blueprintModelRepository.deleteByArtifactNameAndArtifactVersion(artifactName, artifactVersion)
val deployFile =
- normalizedPathName(bluePrintPathConfiguration.blueprintDeployPath, artifactName, artifactVersion)
+ normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath, artifactName, artifactVersion)
deleteNBDir(deployFile).let {
if (it) log.info("Deleted deployed blueprint model :$artifactName::$artifactVersion")
else log.info("Fail to delete deployed blueprint model :$artifactName::$artifactVersion")
blueprintsProcessorCatalogService.get("baseconfiguration", "1.0.0", true)
}
- assertTrue(File(blueprintCoreConfiguration.bluePrintPathConfiguration().blueprintArchivePath +
+ assertTrue(File(blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath +
"/baseconfiguration").deleteRecursively(),"Couldn't get blueprint archive " +
- "${blueprintCoreConfiguration.bluePrintPathConfiguration().blueprintArchivePath}/baseconfiguration " +
+ "${blueprintCoreConfiguration.bluePrintLoadConfiguration().blueprintArchivePath}/baseconfiguration " +
"from data base.")
}
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.ccsdk.cds.blueprintsprocessor.core
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
@Configuration
-open class BluePrintCoreConfiguration(private val bluePrintProperties: BlueprintProcessorProperties) {
+open class BluePrintCoreConfiguration(private val bluePrintPropertiesService: BlueprintPropertiesService) {
companion object {
const val PREFIX_BLUEPRINT_PROCESSOR = "blueprintsprocessor"
}
@Bean
- open fun bluePrintPathConfiguration(): BluePrintPathConfiguration {
- return bluePrintProperties
- .propertyBeanType(PREFIX_BLUEPRINT_PROCESSOR, BluePrintPathConfiguration::class.java)
+ open fun bluePrintLoadConfiguration(): BluePrintLoadConfiguration {
+ return bluePrintPropertiesService
+ .propertyBeanType(PREFIX_BLUEPRINT_PROCESSOR, BluePrintLoadConfiguration::class.java)
}
-
}
@Configuration
}
@Service
-open class BlueprintProcessorProperties(private var bluePrintPropertyBinder: Binder) {
+open class BlueprintPropertiesService(private var bluePrintPropertyBinder: Binder) {
fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
}
import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils.currentTimestamp
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
import java.util.*
@Service
-open class BluePrintManagementGRPCHandler(private val bluePrintPathConfiguration: BluePrintPathConfiguration,
+open class BluePrintManagementGRPCHandler(private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val blueprintsProcessorCatalogService: BluePrintCatalogService)
: BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase() {
log.info("request(${request.commonHeader.requestId})")
val uploadId = UUID.randomUUID().toString()
try {
- val cbaFile = normalizedFile(bluePrintPathConfiguration.blueprintArchivePath, uploadId, "cba-zip")
+ val cbaFile = normalizedFile(bluePrintLoadConfiguration.blueprintArchivePath, uploadId, "cba-zip")
saveToDisk(request, cbaFile)
} catch (e: Exception) {
responseObserver.onError(failStatus("request(${request.commonHeader.requestId}): Failed to upload CBA", e))
} finally {
- deleteDir(bluePrintPathConfiguration.blueprintArchivePath, uploadId)
- deleteDir(bluePrintPathConfiguration.blueprintWorkingPath, uploadId)
+ deleteDir(bluePrintLoadConfiguration.blueprintArchivePath, uploadId)
+ deleteDir(bluePrintLoadConfiguration.blueprintWorkingPath, uploadId)
}
}
}
import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils.toProto
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
import org.onap.ccsdk.cds.controllerblueprints.core.*
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
import java.util.stream.Collectors
@Service
-class ExecutionServiceHandler(private val bluePrintPathConfiguration: BluePrintPathConfiguration,
+class ExecutionServiceHandler(private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val blueprintsProcessorCatalogService: BluePrintCatalogService,
private val bluePrintWorkflowExecutionService
: BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>) {
suspend fun upload(filePart: FilePart): String {
val saveId = UUID.randomUUID().toString()
- val blueprintArchive = normalizedPathName(bluePrintPathConfiguration.blueprintArchivePath, saveId)
- val blueprintWorking = normalizedPathName(bluePrintPathConfiguration.blueprintWorkingPath, saveId)
+ val blueprintArchive = normalizedPathName(bluePrintLoadConfiguration.blueprintArchivePath, saveId)
+ val blueprintWorking = normalizedPathName(bluePrintLoadConfiguration.blueprintWorkingPath, saveId)
try {
val compressedFile = normalizedFile(blueprintArchive, "cba.zip")
} finally {
// Clean blueprint script cache
val cacheKey = BluePrintFileUtils
- .compileCacheKey(normalizedPathName(bluePrintPathConfiguration.blueprintWorkingPath,saveId))
+ .compileCacheKey(normalizedPathName(bluePrintLoadConfiguration.blueprintWorkingPath,saveId))
BluePrintCompileCache.cleanClassLoader(cacheKey)
deleteNBDir(blueprintArchive)
deleteNBDir(blueprintWorking)
# Load Resource Source Mappings
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=blueprints/deploy
-controllerblueprints.blueprintArchivePath=blueprints/archive
-controllerblueprints.blueprintWorkingPath=blueprints/work
+blueprintsprocessor.blueprintDeployPath=blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=blueprints/work
# Controller Blueprint Load Configurations
-controllerblueprints.loadInitialData=true
-controllerblueprints.loadBluePrint=false
-controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint
-controllerblueprints.loadModelType=true
-controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=true
-controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=true
+blueprintsprocessor.loadBluePrint=false
+blueprintsprocessor.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint
+blueprintsprocessor.loadModelType=true
+blueprintsprocessor.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=true
+blueprintsprocessor.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
-controllerblueprints.loadCbaExtension=zip
+blueprintsprocessor.loadCbaExtension=zip
# Web server config
server.port=8082
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy
-controllerblueprints.blueprintArchivePath=/etc/blueprints/archive
-controllerblueprints.blueprintWorkingPath=/etc/blueprints/work
+blueprintsprocessor.blueprintDeployPath=/etc/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=/etc/blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=/etc/blueprints/work
# Controller Blueprint Load Configurations
# blueprints.load.initial-data may be overridden by ENV variables
-controllerblueprints.loadInitialData=true
-controllerblueprints.loadBluePrint=true
-controllerblueprints.loadBluePrintPaths=/opt/app/onap//model-catalog/blueprint-model/service-blueprint
-controllerblueprints.loadModelType=true
-controllerblueprints.loadModeTypePaths=/opt/app/onap//model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=true
-controllerblueprints.loadResourceDictionaryPaths=/opt/app/onap//model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=true
+blueprintsprocessor.loadBluePrint=true
+blueprintsprocessor.loadBluePrintPaths=/opt/app/onap//model-catalog/blueprint-model/service-blueprint
+blueprintsprocessor.loadModelType=true
+blueprintsprocessor.loadModeTypePaths=/opt/app/onap//model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=true
+blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap//model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
-controllerblueprints.loadCbaExtension=zip
+blueprintsprocessor.loadCbaExtension=zip
# Web server config
server.port=8080
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability\r
\r
# Controller Blueprints Core Configuration\r
-controllerblueprints.blueprintDeployPath=./target/blueprints/deploy\r
-controllerblueprints.blueprintArchivePath=./target/blueprints/archive\r
-controllerblueprints.blueprintEnrichmentPath=./target/blueprints/enrichment\r
+blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy\r
+blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive\r
+blueprintsprocessor.blueprintEnrichmentPath=./target/blueprints/enrichment\r
# Controller Blueprint Load Configurations\r
-controllerblueprints.loadInitialData=false\r
-controllerblueprints.loadBluePrint=false\r
-controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint\r
-controllerblueprints.loadModelType=false\r
-controllerblueprints.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type\r
-controllerblueprints.loadResourceDictionary=false\r
-controllerblueprints.loadResourceDictionaryPaths=./../../../../components/model-catalog/resource-dictionary/starter-dictionary\r
+blueprintsprocessor.loadInitialData=false\r
+blueprintsprocessor.loadBluePrint=false\r
+blueprintsprocessor.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint\r
+blueprintsprocessor.loadModelType=false\r
+blueprintsprocessor.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type\r
+blueprintsprocessor.loadResourceDictionary=false\r
+blueprintsprocessor.loadResourceDictionaryPaths=./../../../../components/model-catalog/resource-dictionary/starter-dictionary\r
\r
# CBA file extension\r
-controllerblueprints.loadCbaExtension=zip\r
+blueprintsprocessor.loadCbaExtension=zip\r
\r
# CBA examples for tests cases\r
-controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint\r
+blueprintsprocessor.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint\r
\r
# Web server config\r
server.port=8080\r
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.ccsdk.cds.controllerblueprints.core.config
-open class BluePrintPathConfiguration {
+open class BluePrintLoadConfiguration {
lateinit var blueprintDeployPath: String
lateinit var blueprintArchivePath: String
lateinit var blueprintWorkingPath: String
-}
-
-open class BluePrintLoadConfiguration : BluePrintPathConfiguration() {
var loadInitialData: Boolean = false
var loadBluePrint: Boolean = false
var loadBluePrintPaths: String? = null
import com.hubspot.jinjava.loader.ResourceLocator
import com.hubspot.jinjava.loader.ResourceNotFoundException
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintJsonNodeFactory
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
import org.onap.ccsdk.cds.controllerblueprints.core.removeNullNode
/**
* To enable inheritance within CBA, we need Jinja runtime to know where to load the templates.
*/
- class BlueprintRelatedTemplateLocator(private val bluePrintPathConfiguration: BluePrintPathConfiguration,
+ class BlueprintRelatedTemplateLocator(private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val artifactName: String,
private val artifactVersion: String) : ResourceLocator {
override fun getString(fullName: String, encoding: Charset, interpreter: JinjavaInterpreter): String {
try {
val deployFile =
- normalizedPathName(bluePrintPathConfiguration.blueprintDeployPath,
+ normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath,
artifactName,
artifactVersion,
fullName)
fun generateContent(template: String, json: String, ignoreJsonNull: Boolean,
additionalContext: MutableMap<String, Any>,
- bluePrintPathConfiguration: BluePrintPathConfiguration, artifactName: String,
+ bluePrintLoadConfiguration: BluePrintLoadConfiguration, artifactName: String,
artifactVersion: String): String {
return generateContent(template,
json,
ignoreJsonNull,
additionalContext,
- BlueprintRelatedTemplateLocator(bluePrintPathConfiguration, artifactName, artifactVersion))
+ BlueprintRelatedTemplateLocator(bluePrintLoadConfiguration, artifactName, artifactVersion))
}
fun generateContent(template: String, json: String, ignoreJsonNull: Boolean,
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTemplateService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.stereotype.Service
@Service
-class BluePrintTemplateService(private val bluePrintPathConfiguration: BluePrintPathConfiguration) :
+class BluePrintTemplateService(private val bluePrintLoadConfiguration: BluePrintLoadConfiguration) :
BlueprintTemplateService {
override suspend fun generateContent(bluePrintRuntimeService: BluePrintRuntimeService<*>,
jsonData,
ignoreJsonNull,
additionalContext,
- bluePrintPathConfiguration,
+ bluePrintLoadConfiguration,
bluePrintRuntimeService.bluePrintContext().name(),
bluePrintRuntimeService.bluePrintContext().version())
}
package org.onap.ccsdk.cds.controllerblueprints.db.resources
import org.onap.ccsdk.cds.controllerblueprints.core.*
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
+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.BluePrintValidatorService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils
@MappedSuperclass
abstract class BlueprintCatalogServiceImpl(
- private val bluePrintPathConfiguration: BluePrintPathConfiguration,
+ private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
private val blueprintValidator: BluePrintValidatorService) : BluePrintCatalogService {
private val log = LoggerFactory.getLogger(BlueprintCatalogServiceImpl::class.java)!!
if (blueprintFile.isDirectory) {
log.info("Save processing($processingId) Working Dir(${blueprintFile.absolutePath})")
workingDir = blueprintFile.absolutePath
- archiveFile = normalizedFile(bluePrintPathConfiguration.blueprintArchivePath, processingId, "cba.zip")
+ archiveFile = normalizedFile(bluePrintLoadConfiguration.blueprintArchivePath, processingId, "cba.zip")
if (!BluePrintArchiveUtils.compress(blueprintFile, archiveFile)) {
throw BluePrintException("Fail to compress blueprint")
} else {
// Compressed File
log.info("Save processing($processingId) CBA(${blueprintFile.absolutePath})")
- workingDir = normalizedPathName(bluePrintPathConfiguration.blueprintWorkingPath, processingId)
+ workingDir = normalizedPathName(bluePrintLoadConfiguration.blueprintWorkingPath, processingId)
archiveFile = blueprintFile
// Decompress the CBA file to working Directory
blueprintFile.deCompress(workingDir)
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.springframework.stereotype.Service
@Configuration
-open class ControllerBluePrintCoreConfiguration(private val bluePrintProperties: ControllerBlueprintProperties) {
+open class BluePrintDesignerCoreConfiguration(private val bluePrintProperties: BluePrintDesignerProperties) {
companion object {
- const val PREFIX_BLUEPRINT_LOAD_CONFIGURATION = "controllerblueprints"
+ const val PREFIX_BLUEPRINT_LOAD_CONFIGURATION = "blueprintsprocessor"
}
@Bean
- open fun bluePrintLoadConfiguration(): BluePrintLoadConfiguration {
+ open fun bluePrintDesignerLoadConfiguration(): BluePrintLoadConfiguration {
return bluePrintProperties
.propertyBeanType(PREFIX_BLUEPRINT_LOAD_CONFIGURATION, BluePrintLoadConfiguration::class.java)
}
}
@Configuration
-open class ControllerBlueprintPropertyConfiguration {
+open class BlueprintDesignerPropertyConfiguration {
@Autowired
lateinit var environment: Environment
@Bean
- open fun controllerBluePrintPropertyBinder(): Binder {
+ open fun bluePrintDesignerPropertyBinder(): Binder {
val configurationPropertySource = ConfigurationPropertySources.get(environment)
return Binder(configurationPropertySource)
}
}
@Service
-open class ControllerBlueprintProperties(private var bluePrintPropertyBinder: Binder) {
+open class BluePrintDesignerProperties(private var bluePrintDesignerPropertyBinder: Binder) {
fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
- return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
+ return bluePrintDesignerPropertyBinder.bind(prefix, Bindable.of(type)).get()
}
}
\ No newline at end of file
import org.junit.runners.MethodSorters
import org.onap.ccsdk.cds.controllerblueprints.TestApplication
import org.onap.ccsdk.cds.controllerblueprints.core.*
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration
-import org.onap.ccsdk.cds.controllerblueprints.service.ControllerBluePrintCoreConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.service.BluePrintDesignerCoreConfiguration
import org.onap.ccsdk.cds.controllerblueprints.service.domain.BlueprintModelSearch
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
@RunWith(SpringRunner::class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = [TestApplication::class, ControllerBluePrintCoreConfiguration::class])
+@ContextConfiguration(classes = [TestApplication::class, BluePrintDesignerCoreConfiguration::class])
@ComponentScan(basePackages = ["org.onap.ccsdk.cds.controllerblueprints"])
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@EnableAutoConfiguration
@Autowired
lateinit var webTestClient: WebTestClient
- private var bluePrintLoadConfiguration: BluePrintPathConfiguration? = null
+ private var bluePrintLoadConfiguration: BluePrintLoadConfiguration? = null
private val blueprintDir = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
private var zipBlueprintFileName: String? = null
fun setUp() {
assertNotNull(webTestClient, " Failed to create WebTestClient")
- bluePrintLoadConfiguration = BluePrintPathConfiguration().apply {
+ bluePrintLoadConfiguration = BluePrintLoadConfiguration().apply {
blueprintArchivePath = "./target/blueprints/archive"
blueprintWorkingPath = "./target/blueprints/work"
blueprintDeployPath = "./target/blueprints/deploy"
# Load Resource Source Mappings
resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability
# Controller Blueprints Core Configuration
-controllerblueprints.blueprintDeployPath=./target/blueprints/deploy
-controllerblueprints.blueprintArchivePath=./target/blueprints/archive
-controllerblueprints.blueprintWorkingPath=./target/blueprints/work
+blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive
+blueprintsprocessor.blueprintWorkingPath=./target/blueprints/work
# Controller Blueprint Load Configurations
-controllerblueprints.loadInitialData=false
-controllerblueprints.loadBluePrint=false
-controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint
-controllerblueprints.loadModelType=false
-controllerblueprints.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type
-controllerblueprints.loadResourceDictionary=false
-controllerblueprints.loadResourceDictionaryPaths=./../../../../components/model-catalog/resource-dictionary/starter-dictionary
+blueprintsprocessor.loadInitialData=false
+blueprintsprocessor.loadBluePrint=false
+blueprintsprocessor.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint
+blueprintsprocessor.loadModelType=false
+blueprintsprocessor.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type
+blueprintsprocessor.loadResourceDictionary=false
+blueprintsprocessor.loadResourceDictionaryPaths=./../../../../components/model-catalog/resource-dictionary/starter-dictionary
# CBA file extension
-controllerblueprints.loadCbaExtension=zip
+blueprintsprocessor.loadCbaExtension=zip
# CBA examples for tests cases
-controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint
+blueprintsprocessor.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint