2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022 Bell Canada. All rights reserved.
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.onap.policy.pap.main.repository;
23 import java.util.Date;
24 import java.util.List;
25 import org.onap.policy.models.pdp.persistence.concepts.JpaPdpStatistics;
26 import org.springframework.data.domain.Pageable;
27 import org.springframework.data.jpa.repository.JpaRepository;
28 import org.springframework.stereotype.Repository;
31 public interface PdpStatisticsRepository extends JpaRepository<JpaPdpStatistics, Long> {
33 List<JpaPdpStatistics> findByTimeStampBetween(Date startTime, Date endTime, Pageable topRecordsSize);
35 List<JpaPdpStatistics> findByTimeStampGreaterThanEqual(Date startTime, Pageable topRecordsSize);
37 List<JpaPdpStatistics> findByTimeStampLessThanEqual(Date endTime, Pageable topRecordsSize);
39 List<JpaPdpStatistics> findByPdpGroupName(String pdpGroup, Pageable topRecordsSize);
41 List<JpaPdpStatistics> findByPdpGroupNameAndTimeStampBetween(String pdpGroup, Date startTime, Date endTime,
42 Pageable topRecordsSize);
44 List<JpaPdpStatistics> findByPdpGroupNameAndTimeStampGreaterThanEqual(String pdpGroup, Date startTime,
45 Pageable topRecordsSize);
47 List<JpaPdpStatistics> findByPdpGroupNameAndTimeStampLessThanEqual(String pdpGroup, Date endTime,
48 Pageable topRecordsSize);
50 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupName(String pdpGroup, String pdpSubGroup,
51 Pageable topRecordsSize);
53 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndTimeStampBetween(String pdpGroup, String pdpSubGroup,
54 Date startTime, Date endTime, Pageable topRecordsSize);
56 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndTimeStampGreaterThanEqual(String pdpGroup,
57 String pdpSubGroup, Date startTime, Pageable topRecordsSize);
59 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndTimeStampLessThanEqual(String pdpGroup,
60 String pdpSubGroup, Date endTime, Pageable topRecordsSize);
62 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndName(String pdpGroup, String pdpSubGroup,
63 String pdp, Pageable topRecordsSize);
65 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndNameAndTimeStampGreaterThanEqual(String pdpGroup,
66 String pdpSubGroup, String pdp, Date startTime, Pageable topRecordsSize);
68 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndNameAndTimeStampLessThanEqual(String pdpGroup,
69 String pdpSubGroup, String pdp, Date endTime, Pageable topRecordsSize);
71 List<JpaPdpStatistics> findByPdpGroupNameAndPdpSubGroupNameAndNameAndTimeStampBetween(String pdpGroup,
72 String pdpSubGroup, String pdp, Date startTime, Date endTime, Pageable topRecordsSize);
74 List<JpaPdpStatistics> findByName(String pdp, Pageable topRecordsSize);
76 List<JpaPdpStatistics> findByNameAndTimeStampGreaterThanEqual(String pdp, Date startTime,
77 Pageable topRecordsSize);
79 List<JpaPdpStatistics> findByNameAndTimeStampLessThanEqual(String pdp, Date startTime, Pageable topRecordsSize);
81 List<JpaPdpStatistics> findByNameAndTimeStampBetween(String pdp, Date startTime, Date endTime,
82 Pageable topRecordsSize);