View Javadoc
1   package fr.ifremer.dali.dao.referential.monitoringLocation;
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.HarbourDTO;
27  import fr.ifremer.dali.dto.referential.LocationDTO;
28  import org.springframework.cache.annotation.Cacheable;
29  
30  import java.util.List;
31  
32  /**
33   * <p>DaliMonitoringLocationDao interface.</p>
34   *
35   */
36  public interface DaliMonitoringLocationDao {
37  
38      /** Constant <code>ALL_LOCATIONS_CACHE="allLocations"</code> */
39      String ALL_LOCATIONS_CACHE = "all_locations";
40      /** Constant <code>LOCATION_BY_ID_CACHE="locationById"</code> */
41      String LOCATION_BY_ID_CACHE = "location_by_id";
42      /** Constant <code>LOCATIONS_BY_IDS_CACHE="locationsByIds"</code> */
43      String LOCATIONS_BY_IDS_CACHE = "locations_by_ids";
44      /** Constant <code>LOCATIONS_BY_CAMPAIGN_AND_PROGRAM_CACHE="locationsByCampaignAndProgram"</code> */
45      String LOCATIONS_BY_CAMPAIGN_AND_PROGRAM_CACHE = "locations_by_campaign_and_program";
46      /** Constant <code>ALL_HARBOURS_CACHE="allHarbours"</code> */
47      String ALL_HARBOURS_CACHE = "all_harbours";
48  
49      /**
50       * <p>getAllLocations.</p>
51       *
52       * @param statusCodes a {@link java.util.List} object.
53       * @return a {@link java.util.List} object.
54       */
55      @Cacheable(value = ALL_LOCATIONS_CACHE)
56      List<LocationDTO> getAllLocations(List<String> statusCodes);
57  
58      /**
59       * <p>getLocationById.</p>
60       *
61       * @param locationId a int.
62       * @return a {@link fr.ifremer.dali.dto.referential.LocationDTO} object.
63       */
64      @Cacheable(value = LOCATION_BY_ID_CACHE)
65      LocationDTO getLocationById(int locationId);
66  
67      /**
68       * <p>getLocationsByIds.</p>
69       *
70       * @param locationIds a {@link java.util.List} object.
71       * @return a {@link java.util.List} object.
72       */
73      @Cacheable(value = LOCATIONS_BY_IDS_CACHE)
74      List<LocationDTO> getLocationsByIds(List<Integer> locationIds);
75  
76      /**
77       * <p>getLocationsByCampaignAndProgram.</p>
78       *
79       * @param campaignId a {@link java.lang.Integer} object.
80       * @param programCode a {@link java.lang.String} object.
81       * @return a {@link java.util.List} object.
82       */
83      @Cacheable(value = LOCATIONS_BY_CAMPAIGN_AND_PROGRAM_CACHE)
84      List<LocationDTO> getLocationsByCampaignAndProgram(Integer campaignId, String programCode);
85  
86      /**
87       * <p>findLocations.</p>
88       *
89       * @param statusCodes a {@link java.util.List} object.
90       * @param orderItemTypeCode a {@link java.lang.String} object.
91       * @param orderItemId a {@link java.lang.Integer} object.
92       * @param programCode a {@link java.lang.String} object.
93       * @param label a {@link java.lang.String} object.
94       * @param name a {@link java.lang.String} object.
95       * @param isStrictName a boolean.
96       * @return a {@link java.util.List} object.
97       */
98      List<LocationDTO> findLocations(List<String> statusCodes, String orderItemTypeCode, Integer orderItemId, String programCode, String label, String name, boolean isStrictName);
99  
100     /**
101      * <p>getAllHarbours.</p>
102      *
103      * @param statusCodes a {@link java.util.List} object.
104      * @return a {@link java.util.List} object.
105      */
106     @Cacheable(value = ALL_HARBOURS_CACHE)
107     List<HarbourDTO> getAllHarbours(List<String> statusCodes);
108 
109 }