View Javadoc
1   /*******************************************************************************
2    *   Gisgraphy Project 
3    * 
4    *   This library is free software; you can redistribute it and/or
5    *   modify it under the terms of the GNU Lesser General Public
6    *   License as published by the Free Software Foundation; either
7    *   version 2.1 of the License, or (at your option) any later version.
8    * 
9    *   This library is distributed in the hope that it will be useful,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   *   Lesser General Public License for more details.
13   * 
14   *   You should have received a copy of the GNU Lesser General Public
15   *   License along with this library; if not, write to the Free Software
16   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
17   * 
18   *  Copyright 2008  Gisgraphy project 
19   *  David Masclet <davidmasclet@gisgraphy.com>
20   *  
21   *  
22   *******************************************************************************/
23  /**
24   *
25   */
26  package com.gisgraphy.domain.repository;
27  
28  import java.util.List;
29  
30  import com.gisgraphy.domain.geoloc.entity.Country;
31  
32  /**
33   * Interface of data access object for {@link Country}
34   * 
35   * @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
36   */
37  public interface ICountryDao extends IGisDao<Country> {
38  
39      /**
40       * Get By ISO 3166 Alpha 2 (2-letter) code <u>NOTE</u> : The country code
41       * will be automaticaly converted in upperCase
42       * 
43       * @see #getByIso3166Alpha3Code(String)
44       * @see #getByIso3166Code(String)
45       * @param iso3166Alpha2Code
46       *                The ISO 3166 Alpha 2 code in upper case
47       * @return The expected country for the specified alpha 2 code or null if
48       *         the iso639Alpha2LanguageCode is null
49       */
50      public Country getByIso3166Alpha2Code(String iso3166Alpha2Code);
51  
52      /**
53       * Get by ISO 639 Alpha 3 (3-letter) code <u>NOTE</u> : The country code
54       * will be automaticaly converted in upperCase
55       * 
56       * @see #getByIso3166Alpha2Code(String)
57       * @see #getByIso3166Code(String)
58       * @param iso3166Alpha3Code
59       *                The ISO 3166 Alpha 2 code in upper case
60       * @return The expected country for the specified alpha 3 code or null if
61       *         the iso639Alpha3Code is null
62       */
63      public Country getByIso3166Alpha3Code(String iso3166Alpha3Code);
64  
65      /**
66       * Wrapper method around {@link #getByIso3166Alpha2Code(String)} and
67       * {@link #getByIso3166Alpha3Code(String)}. This method is to use when you
68       * want to get the country with an iso 3166 code that you don't know if it
69       * is an alpha 2 or 3 Get by ISO 639 Alpha 2 or 3 code
70       * 
71       * @see #getByIso3166Alpha3Code(String)
72       * @see #getByIso3166Alpha2Code(String)
73       * @param iso3166Code
74       *                the iso 3166 Code
75       * @return the expected country or null if the code is null or it is not a 2
76       *         or 3 char code
77       */
78      public Country getByIso3166Code(String iso3166Code);
79  
80      /**
81       * returns the country for the specified name
82       * 
83       * @param name
84       *                the name of the country to retrieve
85       * @return the expected country or null if the code is null or it is not a 2
86       *         or 3 char code
87       */
88      public Country getByName(String name);
89  
90      /**
91       * @return all the countries sorted by name, never return null but an empty
92       *         list
93       */
94      public List<Country> getAllSortedByName();
95      
96      /**
97       * List all the featureId of countries 
98       * @return a list of all featureId for all the countries
99       */
100     public List<Long> listFeatureIds();
101 }