| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| CountryService |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2006-2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package org.kuali.rice.shareddata.api.country; | |
| 18 | ||
| 19 | import org.kuali.rice.core.jaxb.ImmutableListAdapter; | |
| 20 | import org.kuali.rice.shareddata.api.SharedDataConstants; | |
| 21 | ||
| 22 | import javax.jws.WebMethod; | |
| 23 | import javax.jws.WebParam; | |
| 24 | import javax.jws.WebResult; | |
| 25 | import javax.jws.WebService; | |
| 26 | import javax.jws.soap.SOAPBinding; | |
| 27 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | |
| 28 | import java.util.List; | |
| 29 | ||
| 30 | ||
| 31 | @WebService(name = "CountryService", targetNamespace = SharedDataConstants.Namespaces.SHAREDDATA_NAMESPACE) | |
| 32 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
| 33 | public interface CountryService { | |
| 34 | ||
| 35 | /** | |
| 36 | * Lookup a country object based on the given country code. | |
| 37 | * | |
| 38 | * @param code the given country code | |
| 39 | * @return a country object with the given country code. A null reference is returned if an invalid or | |
| 40 | * non-existant code is supplied. | |
| 41 | */ | |
| 42 | @WebMethod(operationName = "getCountry") | |
| 43 | @WebResult(name = "country") | |
| 44 | Country getCountry(@WebParam(name = "code") String code); | |
| 45 | ||
| 46 | /** | |
| 47 | * Get a country object based on an alternate country code | |
| 48 | * | |
| 49 | * @param alternateCode the given alternate country code | |
| 50 | * @return A country object with the given alternate country code if a country with that alternate country code | |
| 51 | * exists. Otherwise, null is returned. | |
| 52 | * @throws IllegalStateException if multiple Countries exist with the same passed in alternateCode | |
| 53 | */ | |
| 54 | @WebMethod(operationName = "getCountryByAlternateCode") | |
| 55 | @WebResult(name = "country") | |
| 56 | Country getCountryByAlternateCode( | |
| 57 | @WebParam(name = "alternateCode") String alternateCode); | |
| 58 | ||
| 59 | /** | |
| 60 | * Returns all Countries that are not restricted. | |
| 61 | * | |
| 62 | * @return all countries that are not restricted | |
| 63 | */ | |
| 64 | @WebMethod(operationName = "findAllCountriesNotRestricted") | |
| 65 | @WebResult(name = "countriesNotRestricted") | |
| 66 | @XmlJavaTypeAdapter(value = ImmutableListAdapter.class) | |
| 67 | List<Country> findAllCountriesNotRestricted(); | |
| 68 | ||
| 69 | /** | |
| 70 | * Returns all Countries | |
| 71 | * | |
| 72 | * @return all countries | |
| 73 | */ | |
| 74 | @WebMethod(operationName = "findAllCountries") | |
| 75 | @WebResult(name = "allCountries") | |
| 76 | @XmlJavaTypeAdapter(value = ImmutableListAdapter.class) | |
| 77 | List<Country> findAllCountries(); | |
| 78 | } |