org.kuali.rice.location.api.state
Interface StateService

All Known Implementing Classes:
StateServiceImpl

public interface StateService

Service for interacting with States.

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

Method Summary
 List<State> findAllStatesInCountry(String countryCode)
          Finds all the States for postal country code.
 List<State> findAllStatesInCountryByAltCode(String alternateCode)
          Finds all the States for alternate postal country code.
 State getState(String countryCode, String code)
          Gets a State from a postal country code and postal state code.
 

Method Detail

getState

@Cacheable(value="http://rice.kuali.org/location/v2_0/StateType",
           key="\'countryCode=\' + #countryCode + \'|\' + \'code=\' + #code")
State getState(String countryCode,
                         String code)
               throws RiceIllegalArgumentException
Gets a State from a postal country code and postal state code.

This method will return null if the state does not exist.

This method will return active or inactive states.

Parameters:
countryCode - country code. cannot be blank.
code - state code. cannot be blank.
Returns:
a State or null
Throws:
IllegalArgumentException - country code or state code is blank
RiceIllegalArgumentException

findAllStatesInCountry

@Cacheable(value="http://rice.kuali.org/location/v2_0/StateType",
           key="\'countryCode=\' + #countryCode")
List<State> findAllStatesInCountry(String countryCode)
                                   throws RiceIllegalArgumentException
Finds all the States for postal country code.

This method will always return an immutable Collection even when no values exist.

This method will only return active states.

Parameters:
countryCode - state code. cannot be blank.
Returns:
an immutable collection of states
Throws:
IllegalArgumentException - country code is blank
RiceIllegalArgumentException

findAllStatesInCountryByAltCode

@Cacheable(value="http://rice.kuali.org/location/v2_0/StateType",
           key="\'alternateCode=\' + #alternateCode")
List<State> findAllStatesInCountryByAltCode(String alternateCode)
                                            throws RiceIllegalArgumentException,
                                                   RiceIllegalStateException
Finds all the States for alternate postal country code.

This method will always return an immutable Collection even when no values exist.

This method will only return active states.

Parameters:
alternateCode - cannot be blank.
Returns:
an immutable collection of states
Throws:
RiceIllegalArgumentException - alternate country code is null
RiceIllegalStateException - when no countries are found for alternate country code


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