org.kuali.rice.location.api.country
Interface CountryService

All Known Implementing Classes:
CountryServiceImpl

public interface CountryService

CountryService interface.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 List<Country> findAllCountries()
          Returns all Countries
 List<Country> findAllCountriesNotRestricted()
          Returns all Countries that are not restricted.
 CountryQueryResults findCountries(QueryByCriteria queryByCriteria)
          This method find Countries based on a query criteria.
 Country getCountry(String code)
          Lookup a country object based on the given country code.
 Country getCountryByAlternateCode(String alternateCode)
          Get a country object based on an alternate country code
 Country getDefaultCountry()
          Returns the system default country.
 

Method Detail

getCountry

@Cacheable(value="http://rice.kuali.org/location/v2_0/CountryType",
           key="\'code=\' + #p0")
Country getCountry(String code)
                   throws RiceIllegalArgumentException
Lookup a country object based on the given country code.

Parameters:
code - the given country code
Returns:
a country object with the given country code. A null reference is returned if an invalid or non-existant code is supplied.
Throws:
RiceIllegalArgumentException - if the code is blank or null

getCountryByAlternateCode

@Cacheable(value="http://rice.kuali.org/location/v2_0/CountryType",
           key="\'alternateCode=\' + #p0")
Country getCountryByAlternateCode(String alternateCode)
                                  throws RiceIllegalStateException,
                                         RiceIllegalArgumentException
Get a country object based on an alternate country code

Parameters:
alternateCode - the given alternate country code
Returns:
A country object with the given alternate country code if a country with that alternate country code exists. Otherwise, null is returned.
Throws:
RiceIllegalStateException - if multiple Countries exist with the same passed in alternateCode
RiceIllegalArgumentException - if alternateCode is null or is a whitespace only string.

findAllCountriesNotRestricted

@Cacheable(value="http://rice.kuali.org/location/v2_0/CountryType",
           key="\'allRestricted\'")
List<Country> findAllCountriesNotRestricted()
Returns all Countries that are not restricted.

Returns:
all countries that are not restricted

findAllCountries

@Cacheable(value="http://rice.kuali.org/location/v2_0/CountryType",
           key="\'all\'")
List<Country> findAllCountries()
Returns all Countries

Returns:
all countries

getDefaultCountry

@Cacheable(value="http://rice.kuali.org/location/v2_0/CountryType",
           key="\'default\'")
Country getDefaultCountry()
Returns the system default country. This is simply meant to be informational for applications which need the ability to utilize a default country (such as for defaulting of certain fields during data entry). This method may return null in situations where no default country is configured.

Returns:
the default country, or null if no default country is defined

findCountries

CountryQueryResults findCountries(QueryByCriteria queryByCriteria)
                                  throws RiceIllegalArgumentException
This method find Countries based on a query criteria. The criteria cannot be null.

Parameters:
queryByCriteria - the criteria. Cannot be null.
Returns:
query results. will never return null.
Throws:
IllegalArgumentException - if the queryByCriteria is null
RiceIllegalArgumentException
Since:
2.0.1


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.