2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.csar.storage;
23 import java.io.InputStream;
26 * Manages the artifact storage and handles operations on the artifacts
28 public interface ArtifactStorageManager {
31 * Persists the uploaded artifact in the storage.
33 * @param vspId the VSP id
34 * @param versionId the VSP version id
35 * @param uploadedArtifactInfo the uploaded
36 * @return the information about the persisted artifact
38 ArtifactInfo persist(String vspId, String versionId, ArtifactInfo uploadedArtifactInfo);
41 * Uploads a file to the Artifact Storage. This file will be temporary until persisted by {@link #persist(String, String, ArtifactInfo)}.
43 * @param vspId the VSP id
44 * @param versionId the VSP version id
45 * @param fileToUpload the file input stream
46 * @return the information about the uploaded artifact
48 ArtifactInfo upload(String vspId, String versionId, InputStream fileToUpload);
51 * Checks if the Artifact Storage is enabled.
53 * @return {@code true} if enable, {@code false} otherwise
55 default boolean isEnabled() {
60 * @return Storage Configuration
62 ArtifactStorageConfig getStorageConfiguration();
64 InputStream get(final ArtifactInfo artifactInfo);
66 void delete(ArtifactInfo artifactInfo);