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.api.exception.RiceIllegalArgumentException; | |
20 | import org.kuali.rice.core.api.exception.RiceIllegalStateException; | |
21 | import org.kuali.rice.core.jaxb.ImmutableListAdapter; | |
22 | import org.kuali.rice.shareddata.api.SharedDataConstants; | |
23 | ||
24 | import javax.jws.WebMethod; | |
25 | import javax.jws.WebParam; | |
26 | import javax.jws.WebResult; | |
27 | import javax.jws.WebService; | |
28 | import javax.jws.soap.SOAPBinding; | |
29 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | |
30 | import java.util.List; | |
31 | ||
32 | ||
33 | @WebService(name = "CountryService", targetNamespace = SharedDataConstants.Namespaces.SHAREDDATA_NAMESPACE) | |
34 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
35 | public interface CountryService { | |
36 | ||
37 | /** | |
38 | * Lookup a country object based on the given country code. | |
39 | * | |
40 | * @param code the given country code | |
41 | * @return a country object with the given country code. A null reference is returned if an invalid or | |
42 | * non-existant code is supplied. | |
43 | */ | |
44 | @WebMethod(operationName = "getCountry") | |
45 | @WebResult(name = "country") | |
46 | Country getCountry(@WebParam(name = "code") String code) throws RiceIllegalArgumentException; | |
47 | ||
48 | /** | |
49 | * Get a country object based on an alternate country code | |
50 | * | |
51 | * @param alternateCode the given alternate country code | |
52 | * @return A country object with the given alternate country code if a country with that alternate country code | |
53 | * exists. Otherwise, null is returned. | |
54 | * @throws IllegalStateException if multiple Countries exist with the same passed in alternateCode | |
55 | * @throws IllegalArgumentException if alternateCode is null or is a whitespace only string. | |
56 | */ | |
57 | @WebMethod(operationName = "getCountryByAlternateCode") | |
58 | @WebResult(name = "country") | |
59 | Country getCountryByAlternateCode(@WebParam(name = "alternateCode") String alternateCode) | |
60 | throws RiceIllegalStateException, RiceIllegalArgumentException; | |
61 | ||
62 | /** | |
63 | * Returns all Countries that are not restricted. | |
64 | * | |
65 | * @return all countries that are not restricted | |
66 | */ | |
67 | @WebMethod(operationName = "findAllCountriesNotRestricted") | |
68 | @WebResult(name = "countriesNotRestricted") | |
69 | @XmlJavaTypeAdapter(value = ImmutableListAdapter.class) | |
70 | List<Country> findAllCountriesNotRestricted(); | |
71 | ||
72 | /** | |
73 | * Returns all Countries | |
74 | * | |
75 | * @return all countries | |
76 | */ | |
77 | @WebMethod(operationName = "findAllCountries") | |
78 | @WebResult(name = "allCountries") | |
79 | @XmlJavaTypeAdapter(value = ImmutableListAdapter.class) | |
80 | List<Country> findAllCountries(); | |
81 | } |