Coverage Report - org.kuali.rice.kim.api.type.KimTypeInfoService
 
Classes in this File Line Coverage Branch Coverage Complexity
KimTypeInfoService
N/A
N/A
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.kim.api.type;
 17  
 
 18  
 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
 19  
 import org.kuali.rice.kim.api.KimApiConstants;
 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.Collection;
 30  
 
 31  
 @WebService(name = "kimTypeInfoService", targetNamespace = KimApiConstants.Namespaces.KIM_NAMESPACE_2_0)
 32  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 33  
 public interface KimTypeInfoService {
 34  
 
 35  
     /**
 36  
      * Gets a {@link KimType} from a kim type id.
 37  
      * <p/>
 38  
      * <p>
 39  
      * This method will return null if the kim type does not exist.
 40  
      * </p>
 41  
      *
 42  
      * @param id the id to retrieve the kim type by. cannot be null.
 43  
      * @return a {@link KimType} or null
 44  
      * @throws IllegalArgumentException if the id is null
 45  
      */
 46  
     @WebMethod(operationName="getKimType")
 47  
     @WebResult(name = "kimType")
 48  
     @Cacheable(value=KimType.Cache.NAME, key="'id=' + #p0")
 49  
     KimType getKimType(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
 50  
 
 51  
     /**
 52  
      * Gets a {@link KimType} from a kim type name and namespace code.
 53  
      * <p/>
 54  
      * <p>
 55  
      * This method will return null if the kim type does not exist.
 56  
      * </p>
 57  
      * <p/>
 58  
      * <p>
 59  
      * This method will only return active kim types.
 60  
      * </p>
 61  
      *
 62  
      * @param namespaceCode the namespaceCode to retrieve the kim type by. cannot be null.
 63  
      * @param name          the name to retrieve the kim type by. cannot be null.
 64  
      * @return a {@link KimType} or null
 65  
      * @throws IllegalArgumentException if the namespaceCode or name is null
 66  
      * @throws IllegalStateException    if multiple active results are found for a namespaceCode and name
 67  
      */
 68  
     @WebMethod(operationName="findKimTypeByNameAndNamespace")
 69  
     @WebResult(name = "kimType")
 70  
     @Cacheable(value=KimType.Cache.NAME, key="'namespaceCode=' + #p0 + '|' + 'name=' + #p1")
 71  
     KimType findKimTypeByNameAndNamespace(@WebParam(name = "namespaceCode") String namespaceCode, @WebParam(name = "name") String name) throws RiceIllegalArgumentException;
 72  
 
 73  
     /**
 74  
      * Gets all the {@link KimType KimTypes}.
 75  
      * <p/>
 76  
      * <p>
 77  
      * This method will always return an <b>immutable</b> Collection
 78  
      * even when no values exist.
 79  
      * </p>
 80  
      * <p/>
 81  
      * <p>
 82  
      * This method will only return active kim types.
 83  
      * </p>
 84  
      *
 85  
      * @return an immutable collection of kim types
 86  
      */
 87  
     @WebMethod(operationName="findAllKimTypes")
 88  
     @XmlElementWrapper(name = "kimTypes", required = true)
 89  
     @XmlElement(name = "kimType", required = false)
 90  
     @WebResult(name = "kimTypes")
 91  
     @Cacheable(value=KimType.Cache.NAME, key="'all'")
 92  
     Collection<KimType> findAllKimTypes();
 93  
 }