Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / blueprints / blueprint-core / src / main / kotlin / org / onap / ccsdk / cds / controllerblueprints / core / interfaces / BluePrintCatalogService.kt
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.controllerblueprints.core.interfaces
18
19 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
20 import java.io.File
21 import java.nio.file.Path
22
23 interface BluePrintCatalogService {
24
25     /**
26      * Save the CBA to database.
27      * @param processingId Processing Id
28      * @param blueprintFile Either a directory, or an archive
29      * @param validate whether to validate blueprint content. Default true.
30      * @return The unique blueprint identifier
31      * @throws BluePrintException if process failed
32      */
33     @Throws(BluePrintException::class)
34     suspend fun saveToDatabase(processingId: String, blueprintFile: File, validate: Boolean = true): String
35
36     /**
37      * Retrieve the CBA from database either archived or extracted.
38      * @param name Name of the blueprint
39      * @param version Version of the blueprint
40      * @param extract true to extract the content, false for archived content. Default to true
41      * @return Path where CBA is located
42      * @throws BluePrintException if process failed
43      */
44
45     @Throws(BluePrintException::class)
46     suspend fun getFromDatabase(name: String, version: String, extract: Boolean = true): Path
47
48     /**
49      * Delete the CBA from database.
50      * @param name Name of the blueprint
51      * @param version Version of the blueprint
52      * @throws BluePrintException if process failed
53      */
54
55     @Throws(BluePrintException::class)
56     suspend fun deleteFromDatabase(name: String, version: String)
57 }