From 04425ebaae2abc1862160acc7674205377078b4f Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Tue, 4 Dec 2018 10:25:44 -0500 Subject: Add Blueprint Runtime Input/Output logic Change-Id: I0355e78862096b7b4074faa882d66ce27d6e1844 Issue-ID: CCSDK-670 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../core/BluePrintCoreConfiguration.kt | 32 ++++++++++++++ .../factory/ResourceAssignmentProcessorFactory.kt | 51 ---------------------- .../core/interfaces/BluePrintCatalogService.kt | 24 ++++++++++ 3 files changed, 56 insertions(+), 51 deletions(-) create mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt delete mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt create mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/interfaces/BluePrintCatalogService.kt (limited to 'ms/blueprintsprocessor/modules/commons') diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt new file mode 100644 index 00000000..3b5722d5 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt @@ -0,0 +1,32 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.core + +import org.springframework.beans.factory.annotation.Value +import org.springframework.context.annotation.Configuration + + +@Configuration +open class BluePrintCoreConfiguration { + + @Value("\${blueprintsprocessor.blueprint-deploy-path}") + lateinit var deployPath: String + + @Value("\${blueprintsprocessor.blueprint-archive-path}") + lateinit var archivePath: String + +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt deleted file mode 100644 index 80ad0e67..00000000 --- a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onap.ccsdk.apps.blueprintsprocessor.core.factory - -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor -import org.springframework.context.ApplicationContext -import org.springframework.context.ApplicationContextAware -import org.springframework.context.annotation.Configuration - -/** - * ResourceAssignmentProcessorFactory - * - * @author Brinda Santh - */ -@Configuration -open class ResourceAssignmentProcessorFactory : ApplicationContextAware { - - private val log = EELFManager.getInstance().getLogger(ResourceAssignmentProcessorFactory::class.java) - - var resourceAssignmentProcessors: MutableMap = hashMapOf() - - fun getInstance(instanceName: String): ResourceAssignmentProcessor? { - log.trace("looking for Resource Assignment Processor : {}", instanceName) - return resourceAssignmentProcessors.get(instanceName) - } - - fun injectInstance(instanceName: String, resourceAssignmentProcessor: ResourceAssignmentProcessor) { - this.resourceAssignmentProcessors[instanceName] = resourceAssignmentProcessor - } - - override fun setApplicationContext(context: ApplicationContext) { - resourceAssignmentProcessors = context.getBeansOfType(ResourceAssignmentProcessor::class.java) - log.info("Injected Resource Assignment Processor : {}", resourceAssignmentProcessors) - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/interfaces/BluePrintCatalogService.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/interfaces/BluePrintCatalogService.kt new file mode 100644 index 00000000..64847964 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/interfaces/BluePrintCatalogService.kt @@ -0,0 +1,24 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.core.interfaces + +interface BluePrintCatalogService { + /** + * Get the Blueprint from Data Base and Download it under working directory and return the path path + */ + fun prepareBluePrint(name: String, version: String): String +} \ No newline at end of file -- cgit 1.2.3-korg