View Javadoc
1   package fr.ifremer.reefdb.dao.referential;
2   
3   /*
4    * #%L
5    * Reef DB :: Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
27  import fr.ifremer.reefdb.dto.referential.*;
28  import org.springframework.cache.annotation.Cacheable;
29  
30  import java.util.List;
31  
32  /**
33   * <p>ReefDbReferentialDao interface.</p>
34   *
35   */
36  public interface ReefDbReferentialDao {
37  
38      String DEPTH_LEVEL_BY_ID_CACHE = "depth_level_by_id";
39      String DEPTH_VALUE_BY_ID_CACHE = "depth_value_by_id";
40      String POSITIONING_SYSTEM_BY_ID = "positioning_system_by_id";
41      String QUALITY_FLAG_BY_CODE = "quality_flag_by_code";
42  
43      /**
44       * <p>getAllDepthLevels.</p>
45       *
46       * @return a {@link java.util.List} object.
47       */
48      @Cacheable(value = "all_depth_levels")
49      List<LevelDTO> getAllDepthLevels();
50  
51      /**
52       * <p>getDepthLevelById.</p>
53       *
54       * @param depthLevelId a int.
55       * @return a {@link fr.ifremer.reefdb.dto.referential.LevelDTO} object.
56       */
57      @Cacheable(value = DEPTH_LEVEL_BY_ID_CACHE)
58      LevelDTO getDepthLevelById(int depthLevelId);
59  
60      /**
61       * <p>getAllDepthValues.</p>
62       *
63       * @return a {@link java.util.List} object.
64       */
65      @Cacheable(value = "all_depth_values")
66      List<DepthDTO> getAllDepthValues();
67  
68      /**
69       * <p>getDepthValueById.</p>
70       *
71       * @param depthValueId a int.
72       * @return a {@link fr.ifremer.reefdb.dto.referential.DepthDTO} object.
73       */
74      @Cacheable(value = DEPTH_VALUE_BY_ID_CACHE)
75      DepthDTO getDepthValueById(int depthValueId);
76  
77      /**
78       * <p>getAllStatus.</p>
79       *
80       * @param statusCodes a {@link java.util.List} object.
81       * @return a {@link java.util.List} object.
82       */
83      List<StatusDTO> getAllStatus(List<String> statusCodes);
84  
85      /**
86       * <p>getAllQualityFlags.</p>
87       *
88       * @param statusCodes a {@link java.util.List} object.
89       * @return a {@link java.util.List} object.
90       */
91      @Cacheable(value = "all_quality_flags")
92      List<QualityLevelDTO> getAllQualityFlags(List<String> statusCodes);
93  
94      /**
95       * <p>findQualityFlags.</p>
96       *
97       * @param statusCodes a {@link java.util.List} object.
98       * @param qualityFlagCode a {@link java.lang.String} object.
99       * @return a {@link java.util.List} object.
100      */
101     List<QualityLevelDTO> findQualityFlags(List<String> statusCodes, String qualityFlagCode);
102 
103     /**
104      * <p>getQualityFlagByCode.</p>
105      *
106      * @param qualityFlagCode a {@link java.lang.String} object.
107      * @return a {@link fr.ifremer.reefdb.dto.referential.QualityLevelDTO} object.
108      */
109     @Cacheable(value = QUALITY_FLAG_BY_CODE)
110     QualityLevelDTO getQualityFlagByCode(String qualityFlagCode);
111 
112     /**
113      * <p>getAllPositioningSystems.</p>
114      *
115      * @return a {@link java.util.List} object.
116      */
117     @Cacheable(value = "all_positioning_systems")
118     List<PositioningSystemDTO> getAllPositioningSystems();
119 
120     /**
121      * <p>getPositioningSystemById.</p>
122      *
123      * @param posSystemId a int.
124      * @return a {@link fr.ifremer.reefdb.dto.referential.PositioningSystemDTO} object.
125      */
126     @Cacheable(value = POSITIONING_SYSTEM_BY_ID)
127     PositioningSystemDTO getPositioningSystemById(int posSystemId);
128 
129     /**
130      * <p>getAllGroupingTypes.</p>
131      *
132      * @return a {@link java.util.List} object.
133      */
134     @Cacheable(value = "all_grouping_types")
135     List<GroupingTypeDTO> getAllGroupingTypes();
136 
137     /**
138      * <p>getGroupingsByType.</p>
139      *
140      * @param groupingType a {@link java.lang.String} object.
141      * @return a {@link java.util.List} object.
142      */
143     @Cacheable(value = "groupings_by_type")
144     List<GroupingDTO> getGroupingsByType(String groupingType);
145 
146     /**
147      * <p>getAllCitations.</p>
148      *
149      * @return a {@link java.util.List} object.
150      */
151     @Cacheable(value = "all_citations")
152     List<CitationDTO> getAllCitations();
153 
154     /**
155      * <p>getAllPhotoTypes.</p>
156      *
157      * @return a {@link java.util.List} object.
158      */
159     List<PhotoTypeDTO> getAllPhotoTypes();
160 
161     /**
162      * <p>getPhotoTypeByCode.</p>
163      *
164      * @param photoTypeCode a {@link java.lang.String} object.
165      * @return a {@link fr.ifremer.reefdb.dto.referential.PhotoTypeDTO} object.
166      */
167     PhotoTypeDTO getPhotoTypeByCode(String photoTypeCode);
168 }