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 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;
31 * Cassandra accessor for the {@link VspUploadStatusRecord}
34 public interface VspUploadStatusRecordAccessor {
36 @Query("SELECT * FROM vsp_upload_status WHERE vsp_id = ? AND vsp_version_id = ?")
37 Result<VspUploadStatusRecord> findAllByVspIdAndVspVersionId(final String vspId, final String vspVersionId);
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);
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);