From fb230e85476a091f7f3a035242f1e884d631dee0 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sat, 12 Jan 2019 15:48:20 -0500 Subject: Implement BluePrintCatalogService MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifcb0d730daec4da747d704c270b72b991e01f474 Issue-ID: CCSDK-908 Signed-off-by: Alexis de Talhouët --- .../selfservice/api/ExecutionServiceHandler.kt | 4 ++-- .../selfservice/api/mock/SelfServiceApiMocks.kt | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt index 69758ecf8..56a6393af 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt @@ -40,10 +40,10 @@ class ExecutionServiceHandler(private val bluePrintCatalogService: BluePrintCata val blueprintName = actionIdentifiers.blueprintName val blueprintVersion = actionIdentifiers.blueprintVersion - val basePath = bluePrintCatalogService.prepareBluePrint(blueprintName, blueprintVersion) + val basePath = bluePrintCatalogService.getFromDatabase(blueprintName, blueprintVersion) log.info("blueprint base path $basePath") - val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath) + val blueprintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(requestId, basePath.toString()) return blueprintDGExecutionService.executeDirectedGraph(blueprintRuntimeService, executionServiceInput) } diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt index 656d92f14..e8f25a896 100755 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt @@ -22,6 +22,9 @@ import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.BlueprintDGExec import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService import org.springframework.stereotype.Service +import java.io.File +import java.nio.file.Path +import java.nio.file.Paths import kotlin.test.assertNotNull @Service @@ -38,22 +41,17 @@ class MockBlueprintDGExecutionService : BlueprintDGExecutionService { @Service class MockBluePrintCatalogService : BluePrintCatalogService { - - override fun uploadToDataBase(file: String, validate : Boolean): String { + override fun deleteFromDatabase(name: String, version: String) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun downloadFromDataBase(name: String, version: String, path: String): String { + override fun saveToDatabase(blueprintFile: File, validate: Boolean): String { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun prepareBluePrint(name: String, version: String): String { + override fun getFromDatabase(name: String, version: String, extract: Boolean): Path { assertNotNull(name, "failed to get blueprint Name") assertNotNull(version, "failed to get blueprint version") - return "./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration" - } - - override fun downloadFromDataBase(uuid: String, path: String): String { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + return Paths.get("./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") } } \ No newline at end of file -- cgit 1.2.3-korg