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.apps.controllerblueprints.core.interfaces
19 import org.jetbrains.annotations.NotNull
20 import org.jetbrains.annotations.Nullable
21 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
23 import java.nio.file.Path
25 interface BluePrintCatalogService {
28 * Save the CBA to database.
29 * @param blueprintFile Either a directory, or an archive
30 * @param validate whether to validate blueprint content. Default true.
31 * @return The unique blueprint identifier
32 * @throws BluePrintException if process failed
35 @Throws(BluePrintException::class)
36 fun saveToDatabase(@NotNull blueprintFile: File, @Nullable validate: Boolean = true): String
39 * Retrieve the CBA from database either archived or extracted.
40 * @param name Name of the blueprint
41 * @param version Version of the blueprint
42 * @param extract true to extract the content, false for archived content. Default to true
43 * @return Path where CBA is located
44 * @throws BluePrintException if process failed
47 @Throws(BluePrintException::class)
48 fun getFromDatabase(@NotNull name: String, @NotNull version: String, @Nullable extract: Boolean = true): Path
51 * Delete the CBA from database.
52 * @param name Name of the blueprint
53 * @param version Version of the blueprint
54 * @throws BluePrintException if process failed
57 @Throws(BluePrintException::class)
58 fun deleteFromDatabase(@NotNull name: String, @NotNull version: String)