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.sdc.vendorsoftwareproduct.dao;
24 import java.util.List;
25 import java.util.Optional;
26 import java.util.UUID;
27 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspUploadStatusRecord;
30 * Data Access Object for the package upload process status record.
32 public interface VspUploadStatusRecordDao {
35 * Creates an upload status record.
37 * @param vspUploadStatusRecord the upload status record to create
39 void create(final VspUploadStatusRecord vspUploadStatusRecord);
42 * Updates an upload status record.
44 * @param vspUploadStatusRecord the upload status record to update
46 void update(final VspUploadStatusRecord vspUploadStatusRecord);
49 * Finds all upload status record by Vendor Software Product id and its version id.
51 * @param vspId the Vendor Software Product id
52 * @param vspVersionId the Vendor Software Product version id
53 * @return a list with all the status record found that matches the criteria
55 List<VspUploadStatusRecord> findAllByVspIdAndVersionId(final String vspId, final String vspVersionId);
58 * Finds all upload status record by Vendor Software Product id and its version id.
60 * @param vspId the Vendor Software Product id
61 * @param vspVersionId the Vendor Software Product version id
62 * @return a list with all the status record found that matches the criteria
64 Optional<VspUploadStatusRecord> findByVspIdAndVersionIdAndLockId(final String vspId, final String vspVersionId, final UUID lockId);
67 * Finds all uploads in progress by Vendor Software Product id and its version id.
69 * @param vspId the Vendor Software Product id
70 * @param vspVersionId the Vendor Software Product version id
71 * @return a list with all the status record found that matches the criteria
73 List<VspUploadStatusRecord> findAllInProgress(final String vspId, final String vspVersionId);
76 * Finds the latest upload status record for the Vendor Software Product id and its version id.
78 * @param vspId the Vendor Software Product id
79 * @param vspVersionId the Vendor Software Product version id
80 * @return the latest upload status record that matches the criteria
82 Optional<VspUploadStatusRecord> findLatest(final String vspId, final String vspVersionId);