3 * ============LICENSE_START=======================================================
4 * Copyright (C) 2022 Nordix Foundation.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.openecomp.sdcrests.vsp.rest.services;
24 import java.util.Optional;
25 import java.util.UUID;
26 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspUploadStatus;
27 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspUploadStatusDto;
29 public interface OrchestrationTemplateCandidateUploadManager {
32 * Creates a lock to start uploading a package.
34 * @param vspId the Vendor Software Product id
35 * @param vspVersionId the Vendor Software Product version id
36 * @param user the current user
37 * @return a new upload status containing the lock
39 VspUploadStatusDto putUploadInProgress(String vspId, String vspVersionId, String user);
42 * Finishes the upload process, applying the given VspUploadStatusType completion status.
44 * @param vspId the Vendor Software Product id
45 * @param vspVersionId the Vendor Software Product version id
46 * @param lockId the upload lock id
47 * @param completionStatus any status that represents a completion
48 * @param user the current user
49 * @return the updated status
51 VspUploadStatusDto putUploadAsFinished(final String vspId, final String vspVersionId, final UUID lockId, final VspUploadStatus completionStatus,
55 * Finds the latest upload status for a given Vendor Software Product version.
57 * @param vspId the Vendor Software Product id
58 * @param vspVersionId the Vendor Software Product version id
59 * @param user the current user
60 * @return the latest upload status for the requested Vendor Software Product version
62 Optional<VspUploadStatusDto> findLatestStatus(String vspId, String vspVersionId, String user);