Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CountyService |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2005-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 | package org.kuali.rice.location.api.county; | |
17 | ||
18 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
19 | import org.kuali.rice.location.api.LocationConstants; | |
20 | import org.springframework.cache.annotation.Cacheable; | |
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.XmlElement; | |
28 | import javax.xml.bind.annotation.XmlElementWrapper; | |
29 | import java.util.List; | |
30 | ||
31 | /** | |
32 | * <p>CountyService interface.</p> | |
33 | * | |
34 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
35 | */ | |
36 | @WebService(name = "CountyService", targetNamespace = LocationConstants.Namespaces.LOCATION_NAMESPACE_2_0) | |
37 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
38 | public interface CountyService { | |
39 | ||
40 | /** | |
41 | * Gets a {@link County} from a postal country code and postal code value. | |
42 | * <p/> | |
43 | * <p> | |
44 | * This method will return null if the state does not exist. | |
45 | * </p> | |
46 | * <p/> | |
47 | * <p> | |
48 | * This method will return active or inactive counties. | |
49 | * </p> | |
50 | * | |
51 | * @param countryCode country code. cannot be blank. | |
52 | * @param stateCode postal state code. cannot be blank. | |
53 | * @param code county code. cannot be blank | |
54 | * @return a {@link County} or null | |
55 | * @throws IllegalArgumentException country code, postal state code, or county code is blank | |
56 | */ | |
57 | @WebMethod(operationName = "getCounty") | |
58 | @WebResult(name = "county") | |
59 | @Cacheable(value=County.Cache.NAME, key="'countryCode=' + #p0 + '|' + 'stateCode=' + #p1 + '|' + 'code=' + #p3") | |
60 | County getCounty(@WebParam(name = "countryCode") String countryCode, @WebParam(name = "stateCode") String stateCode, @WebParam(name = "code") String code) | |
61 | throws RiceIllegalArgumentException; | |
62 | ||
63 | /** | |
64 | * Gets all the {@link County County} for postal country code & postal state code. | |
65 | * <p/> | |
66 | * <p> | |
67 | * This method will always return an <b>immutable</b> Collection | |
68 | * even when no values exist. | |
69 | * </p> | |
70 | * <p/> | |
71 | * <p> | |
72 | * This method will only return active counties. | |
73 | * </p> | |
74 | * | |
75 | * @param countryCode state code. cannot be blank. | |
76 | * @param stateCode postal state code. cannot be blank. | |
77 | * @return an immutable collection of counties | |
78 | * @throws IllegalArgumentException country code, postal state code is blank | |
79 | */ | |
80 | @WebMethod(operationName = "findAllCountiesInCountryAndState") | |
81 | @XmlElementWrapper(name = "counties", required = true) | |
82 | @XmlElement(name = "county", required = false) | |
83 | @WebResult(name = "counties") | |
84 | @Cacheable(value=County.Cache.NAME, key="'countryCode=' + #p0 + '|' + 'stateCode=' + #p1") | |
85 | List<County> findAllCountiesInCountryAndState(@WebParam(name = "countryCode") String countryCode, @WebParam(name = "stateCode") String stateCode) | |
86 | throws RiceIllegalArgumentException; | |
87 | } |