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