View Javadoc
1   package fr.ifremer.dali.dao.referential.pmfm;
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.pmfm.ParameterDTO;
27  import fr.ifremer.dali.dto.referential.pmfm.ParameterGroupDTO;
28  import org.springframework.cache.annotation.Cacheable;
29  
30  import java.util.List;
31  
32  /**
33   * Created by Ludovic on 29/07/2015.
34   */
35  public interface DaliParameterDao {
36  
37      /** Constant <code>PARAMETER_BY_CODE_CACHE="parameterByCode"</code> */
38      String PARAMETER_BY_CODE_CACHE = "parameter_by_code";
39      /** Constant <code>ALL_PARAMETERS_CACHE="allParameters"</code> */
40      String ALL_PARAMETERS_CACHE = "all_parameters";
41  
42      /** Constant <code>ALL_PARAMETER_GROUPS_CACHE="allParameterGroups"</code> */
43      String ALL_PARAMETER_GROUPS_CACHE = "all_parameter_groups";
44      /** Constant <code>PARAMETER_GROUP_BY_ID_CACHE="parameterGroupById"</code> */
45      String PARAMETER_GROUP_BY_ID_CACHE = "parameter_group_by_id";
46  
47      /**
48       * <p>getAllParameters.</p>
49       *
50       * @param statusCodes a {@link java.util.List} object.
51       * @return a {@link java.util.List} object.
52       */
53      @Cacheable(value = ALL_PARAMETERS_CACHE)
54      List<ParameterDTO> getAllParameters(List<String> statusCodes);
55  
56      /**
57       * <p>getParameterByCode.</p>
58       *
59       * @param parameterCode a {@link java.lang.String} object.
60       * @return a {@link fr.ifremer.dali.dto.referential.pmfm.ParameterDTO} object.
61       */
62      @Cacheable(value = PARAMETER_BY_CODE_CACHE)
63      ParameterDTO getParameterByCode(String parameterCode);
64  
65      /**
66       * <p>findParameters.</p>
67       *
68       * @param parameterCode a {@link java.lang.String} object.
69       * @param parameterGroupId a {@link java.lang.Integer} object.
70       * @param statusCodes a {@link java.util.List} object.
71       * @return a {@link java.util.List} object.
72       */
73      List<ParameterDTO> findParameters(String parameterCode, Integer parameterGroupId, List<String> statusCodes);
74  
75      /**
76       * <p>getAllParameterGroups.</p>
77       *
78       * @param statusCodes a {@link java.util.List} object.
79       * @return a {@link java.util.List} object.
80       */
81      @Cacheable(value = ALL_PARAMETER_GROUPS_CACHE)
82      List<ParameterGroupDTO> getAllParameterGroups(List<String> statusCodes);
83  
84      /**
85       * <p>getParameterGroupById.</p>
86       *
87       * @param parameterGroupId a int.
88       * @return a {@link fr.ifremer.dali.dto.referential.pmfm.ParameterGroupDTO} object.
89       */
90      @Cacheable(value = PARAMETER_GROUP_BY_ID_CACHE)
91      ParameterGroupDTO getParameterGroupById(int parameterGroupId);
92  
93  }