Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PostalCodeService |
|
| 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.postalcode; | |
18 | ||
19 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
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 java.util.List; | |
28 | ||
29 | /** | |
30 | * Service for interacting with {@link PostalCode PostalCodes}. | |
31 | */ | |
32 | @WebService(name = "PostalCodeService", targetNamespace = SharedDataConstants.Namespaces.SHAREDDATA_NAMESPACE) | |
33 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
34 | public interface PostalCodeService { | |
35 | ||
36 | /** | |
37 | * Gets a {@link PostalCode} from a postal country code and postal code value. | |
38 | * | |
39 | * <p> | |
40 | * This method will return null if the state does not exist. | |
41 | * </p> | |
42 | * | |
43 | * <p> | |
44 | * This method will return active or inactive postal codes. | |
45 | * </p> | |
46 | * | |
47 | * @param countryCode country code. cannot be blank. | |
48 | * @param code postal code value. cannot be blank. | |
49 | * @return a {@link PostalCode} or null | |
50 | * @throws IllegalArgumentException country code or postal code value is blank | |
51 | */ | |
52 | @WebMethod(operationName="getPostalCode") | |
53 | @WebResult(name = "postalCode") | |
54 | PostalCode getPostalCode(@WebParam(name = "countryCode") String countryCode, @WebParam(name = "code") String code) | |
55 | throws RiceIllegalArgumentException; | |
56 | ||
57 | /** | |
58 | * Gets all the {@link PostalCode PostalCode} for postal country code. | |
59 | * | |
60 | * <p> | |
61 | * This method will always return an <b>immutable</b> Collection | |
62 | * even when no values exist. | |
63 | * </p> | |
64 | * | |
65 | * <p> | |
66 | * This method will only return active postal codes. | |
67 | * </p> | |
68 | * | |
69 | * @param countryCode state code. cannot be blank. | |
70 | * @return an immutable collection of states | |
71 | * @throws IllegalArgumentException country code is blank | |
72 | */ | |
73 | @WebMethod(operationName="findAllPostalCodesInCountry") | |
74 | @WebResult(name = "postalCodes") | |
75 | List<PostalCode> findAllPostalCodesInCountry(@WebParam(name = "countryCode") String countryCode) | |
76 | throws RiceIllegalArgumentException; | |
77 | } |