Onboarding upload control
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / dao / VspUploadStatusRecordAccessor.java
1 /*
2  * -
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
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  *  SPDX-License-Identifier: Apache-2.0
19  *  ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.sdc.vendorsoftwareproduct.dao;
23
24 import com.datastax.driver.mapping.Result;
25 import com.datastax.driver.mapping.annotations.Accessor;
26 import com.datastax.driver.mapping.annotations.Query;
27 import java.util.UUID;
28 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspUploadStatusRecord;
29
30 /**
31  * Cassandra accessor for the {@link VspUploadStatusRecord}
32  */
33 @Accessor
34 public interface VspUploadStatusRecordAccessor {
35
36     @Query("SELECT * FROM vsp_upload_status WHERE vsp_id = ? AND vsp_version_id = ?")
37     Result<VspUploadStatusRecord> findAllByVspIdAndVspVersionId(final String vspId, final String vspVersionId);
38
39     @Query("SELECT * FROM vsp_upload_status WHERE vsp_id = ? AND vsp_version_id = ? AND is_complete = FALSE")
40     Result<VspUploadStatusRecord> findAllIncomplete(final String vspId, final String vspVersionId);
41
42     @Query("SELECT * FROM vsp_upload_status WHERE vsp_id = ? AND vsp_version_id = ? AND lock_id = ?")
43     Result<VspUploadStatusRecord> findByVspIdAndVersionIdAndLockId(final String vspId, final String vspVersionId, final UUID lockId);
44 }