summaryrefslogtreecommitdiffstats
path: root/components/core
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-01-12 15:48:20 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-01-18 13:56:01 -0500
commit125b60f22593467dd633c19a296b92ddcb4b260b (patch)
tree8c279361132219433e496eea5edf60ec25249072 /components/core
parent78702c12bd0b6cb8ec0fd621f27fa61c9a017fbe (diff)
Implement BluePrintCatalogService
Change-Id: Ifcb0d730daec4da747d704c270b72b991e01f474 Issue-ID: CCSDK-908 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'components/core')
-rwxr-xr-xcomponents/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintCatalogService.kt41
1 files changed, 30 insertions, 11 deletions
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintCatalogService.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintCatalogService.kt
index 9186635e..c99cdf74 100755
--- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintCatalogService.kt
+++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintCatalogService.kt
@@ -16,25 +16,44 @@
package org.onap.ccsdk.apps.controllerblueprints.core.interfaces
-interface BluePrintCatalogService {
+import org.jetbrains.annotations.NotNull
+import org.jetbrains.annotations.Nullable
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
+import java.io.File
+import java.nio.file.Path
- /**
- * Upload the CBA Zip fle to data base and return the Database identifier
- */
- fun uploadToDataBase(file: String, validate : Boolean): String
+interface BluePrintCatalogService {
/**
- * Download the CBA zip file from the data base and place it in a path and return the CBA zip absolute path
+ * Save the CBA to database.
+ * @param blueprintFile Either a directory, or an archive
+ * @param validate whether to validate blueprint content. Default true.
+ * @return The unique blueprint identifier
+ * @throws BluePrintException if process failed
*/
- fun downloadFromDataBase(name: String, version: String, path: String): String
+ @NotNull
+ @Throws(BluePrintException::class)
+ fun saveToDatabase(@NotNull blueprintFile: File, @Nullable validate: Boolean = true): String
/**
- * Get the Blueprint from Data Base and Download it under working directory and return the path path
+ * Retrieve the CBA from database either archived or extracted.
+ * @param name Name of the blueprint
+ * @param version Version of the blueprint
+ * @param extract true to extract the content, false for archived content. Default to true
+ * @return Path where CBA is located
+ * @throws BluePrintException if process failed
*/
- fun prepareBluePrint(name: String, version: String): String
+ @NotNull
+ @Throws(BluePrintException::class)
+ fun getFromDatabase(@NotNull name: String, @NotNull version: String, @Nullable extract: Boolean = true): Path
/**
- * Get blueprint archive with zip file from Data Base
+ * Delete the CBA from database.
+ * @param name Name of the blueprint
+ * @param version Version of the blueprint
+ * @throws BluePrintException if process failed
*/
- fun downloadFromDataBase(uuid: String, path: String): String
+ @NotNull
+ @Throws(BluePrintException::class)
+ fun deleteFromDatabase(@NotNull name: String, @NotNull version: String)
} \ No newline at end of file