View Javadoc
1   package fr.ifremer.dali.dao.referential;
2   
3   /*
4    * #%L
5    * Dali :: 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.dali.dto.referential.*;
27  import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
28  import org.springframework.cache.annotation.Cacheable;
29  
30  import java.util.List;
31  
32  /**
33   * <p>DaliReferentialDao interface.</p>
34   *
35   */
36  public interface DaliReferentialDao {
37  
38      String ALL_STATUS_CACHE = "all_status";
39      String STATUS_BY_CODE_CACHE = "status_by_code";
40  
41      String DEPTH_LEVEL_BY_ID_CACHE = "depth_level_by_id";
42  
43      String POSITIONING_SYSTEM_BY_ID_CACHE = "positioning_system_by_id";
44  
45      String QUALITY_FLAG_BY_CODE_CACHE = "quality_flag_by_code";
46      String ALL_QUALITY_FLAGS_CACHE = "all_quality_flags";
47  
48      String ALL_TAXONOMIC_LEVELS_CACHE = "all_taxonomic_levels";
49      String TAXONOMIC_LEVEL_BY_CODE_CACHE = "taxonomic_level_by_code";
50  
51      @Cacheable(value = ALL_STATUS_CACHE)
52      List<StatusDTO> getAllStatus();
53  
54      @Cacheable(value = STATUS_BY_CODE_CACHE)
55      StatusDTO getStatusByCode(String statusCode);
56  
57      List<StatusDTO> getStatusByCodes(List<String> statusCodes);
58  
59  
60      /**
61       * <p>getAllDepthLevels.</p>
62       *
63       * @return a {@link java.util.List} object.
64       */
65      @Cacheable(value = "all_depth_levels")
66      List<LevelDTO> getAllDepthLevels();
67  
68      /**
69       * <p>getDepthLevelById.</p>
70       *
71       * @param depthLevelId a int.
72       * @return a {@link fr.ifremer.dali.dto.referential.LevelDTO} object.
73       */
74      @Cacheable(value = DEPTH_LEVEL_BY_ID_CACHE)
75      LevelDTO getDepthLevelById(int depthLevelId);
76  
77      /**
78       * <p>getAllQualityFlags.</p>
79       *
80       * @param statusCodes a {@link java.util.List} object.
81       * @return a {@link java.util.List} object.
82       */
83      @Cacheable(value = ALL_QUALITY_FLAGS_CACHE)
84      List<QualityLevelDTO> getAllQualityFlags(List<String> statusCodes);
85  
86      /**
87       * <p>getQualityFlagByCode.</p>
88       *
89       * @param qualityFlagCode a {@link java.lang.String} object.
90       * @return a {@link fr.ifremer.dali.dto.referential.QualityLevelDTO} object.
91       */
92      @Cacheable(value = QUALITY_FLAG_BY_CODE_CACHE)
93      QualityLevelDTO getQualityFlagByCode(String qualityFlagCode);
94  
95      /**
96       * <p>getAllPositioningSystems.</p>
97       *
98       * @return a {@link java.util.List} object.
99       */
100     @Cacheable(value = "all_positioning_systems")
101     List<PositioningSystemDTO> getAllPositioningSystems();
102 
103     /**
104      * <p>getPositioningSystemById.</p>
105      *
106      * @param posSystemId a int.
107      * @return a {@link fr.ifremer.dali.dto.referential.PositioningSystemDTO} object.
108      */
109     @Cacheable(value = POSITIONING_SYSTEM_BY_ID_CACHE)
110     PositioningSystemDTO getPositioningSystemById(int posSystemId);
111 
112     /**
113      * <p>getAllGroupingTypes.</p>
114      *
115      * @return a {@link java.util.List} object.
116      */
117     @Cacheable(value = "all_grouping_types")
118     List<GroupingTypeDTO> getAllGroupingTypes();
119 
120     /**
121      * <p>getGroupingsByType.</p>
122      *
123      * @param groupingType a {@link java.lang.String} object.
124      * @return a {@link java.util.List} object.
125      */
126     @Cacheable(value = "groupings_by_type")
127     List<GroupingDTO> getGroupingsByType(String groupingType);
128 
129     /**
130      * <p>getAllCitations.</p>
131      *
132      * @return a {@link java.util.List} object.
133      */
134     @Cacheable(value = "all_citations")
135     List<CitationDTO> getAllCitations();
136 
137     /**
138      * <p>getAllPhotoTypes.</p>
139      *
140      * @return a {@link java.util.List} object.
141      */
142     List<PhotoTypeDTO> getAllPhotoTypes();
143 
144     /**
145      * <p>getPhotoTypeByCode.</p>
146      *
147      * @param photoTypeCode a {@link java.lang.String} object.
148      * @return a {@link fr.ifremer.dali.dto.referential.PhotoTypeDTO} object.
149      */
150     PhotoTypeDTO getPhotoTypeByCode(String photoTypeCode);
151 
152     @Cacheable(value = ALL_TAXONOMIC_LEVELS_CACHE)
153     List<TaxonomicLevelDTO> getAllTaxonomicLevels();
154 
155     @Cacheable(value = TAXONOMIC_LEVEL_BY_CODE_CACHE)
156     TaxonomicLevelDTO getTaxonomicLevelByCode(String code);
157 
158 }