2 * Copyright © 2017-2018 AT&T Intellectual Property.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.ccsdk.cds.controllerblueprints.core.interfaces
19 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
21 import java.nio.file.Path
23 interface BluePrintCatalogService {
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
33 @Throws(BluePrintException::class)
34 suspend fun saveToDatabase(processingId: String, blueprintFile: File, validate: Boolean = true): String
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
45 @Throws(BluePrintException::class)
46 suspend fun getFromDatabase(name: String, version: String, extract: Boolean = true): Path
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
55 @Throws(BluePrintException::class)
56 suspend fun deleteFromDatabase(name: String, version: String)