View Javadoc

1   /**
2    * Copyright 2005-2012 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.campus;
17  
18  import org.kuali.rice.core.api.criteria.QueryByCriteria;
19  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
20  import org.kuali.rice.location.api.LocationConstants;
21  import org.springframework.cache.annotation.Cacheable;
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.XmlElement;
29  import javax.xml.bind.annotation.XmlElementWrapper;
30  import java.util.List;
31  
32  /**
33   * <p>CampusService interface.</p>
34   *
35   * @author Kuali Rice Team (rice.collab@kuali.org)
36   */
37  @WebService(name = "campusService", targetNamespace = LocationConstants.Namespaces.LOCATION_NAMESPACE_2_0)
38  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
39  public interface CampusService {
40  
41      /**
42       * This will return a {@link Campus}.
43       *
44       * @param code the code of the campus to return
45       * @throws RiceIllegalArgumentException if the code is null
46       * @throws IllegalStateException if the campus does not exist in the system under the
47       * specific code
48       */
49      @WebMethod(operationName="getCampus")
50      @WebResult(name = "campus")
51      @Cacheable(value=Campus.Cache.NAME, key="'code=' + #p0")
52      Campus getCampus(@WebParam(name = "code") String code) throws RiceIllegalArgumentException;
53      
54      /**
55       * This will return all {@link Campus}.
56       */
57      @WebMethod(operationName="findAllCampuses")
58      @XmlElementWrapper(name = "campuses", required = false)
59      @XmlElement(name = "campus", required = false)
60      @WebResult(name = "campuses")
61      @Cacheable(value=Campus.Cache.NAME, key="'all'")
62      List<Campus> findAllCampuses();
63      
64      /**
65       * This will return a {@link CampusType}.
66       *
67       * @param code the code of the campus type to return
68       * @return CampusType object represented by the passed in code
69       * @throws RiceIllegalArgumentException if the code is null
70       *
71       */
72      @WebMethod(operationName="getCampusType")
73      @WebResult(name = "campusType")
74      @Cacheable(value=CampusType.Cache.NAME, key="'code=' + #p0")
75      CampusType getCampusType(@WebParam(name = "code") String code) throws RiceIllegalArgumentException;
76      
77      /**
78       * This will return all {@link CampusType}.
79       */
80      @WebMethod(operationName="findAllCampusTypes")
81      @XmlElementWrapper(name = "campusTypes", required = false)
82      @XmlElement(name = "campusType", required = false)
83      @WebResult(name = "campusTypes")
84      @Cacheable(value=CampusType.Cache.NAME, key="'all'")
85      List<CampusType> findAllCampusTypes();
86  
87      /**
88       * This method find Campuses based on a query criteria.  The criteria cannot be null.
89       *
90       * @since 2.0.1
91       * @param queryByCriteria the criteria.  Cannot be null.
92       * @return query results.  will never return null.
93       * @throws IllegalArgumentException if the queryByCriteria is null
94       */
95      @WebMethod(operationName = "findCampuses")
96      @WebResult(name = "results")
97      CampusQueryResults findCampuses(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
98  
99      /**
100      * This method find CampusTypes based on a query criteria.  The criteria cannot be null.
101      *
102      * @since 2.0.1
103      * @param queryByCriteria the criteria.  Cannot be null.
104      * @return query results.  will never return null.
105      * @throws IllegalArgumentException if the queryByCriteria is null
106      */
107     @WebMethod(operationName = "findCampusTypes")
108     @WebResult(name = "results")
109     CampusTypeQueryResults findCampusTypes(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
110 }