001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.location.api.campus;
017
018import org.kuali.rice.core.api.criteria.QueryByCriteria;
019import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
020import org.kuali.rice.location.api.LocationConstants;
021import org.springframework.cache.annotation.Cacheable;
022
023import javax.jws.WebMethod;
024import javax.jws.WebParam;
025import javax.jws.WebResult;
026import javax.jws.WebService;
027import javax.jws.soap.SOAPBinding;
028import javax.xml.bind.annotation.XmlElement;
029import javax.xml.bind.annotation.XmlElementWrapper;
030import java.util.List;
031
032/**
033 * <p>CampusService interface.</p>
034 *
035 * @author Kuali Rice Team (rice.collab@kuali.org)
036 */
037@WebService(name = "campusService", targetNamespace = LocationConstants.Namespaces.LOCATION_NAMESPACE_2_0)
038@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
039public interface CampusService {
040
041    /**
042     * This will return a {@link Campus}.
043     *
044     * @param code the code of the campus to return
045     * @throws RiceIllegalArgumentException if the code is null or blank
046     */
047    @WebMethod(operationName="getCampus")
048    @WebResult(name = "campus")
049    @Cacheable(value=Campus.Cache.NAME, key="'code=' + #p0")
050    Campus getCampus(@WebParam(name = "code") String code) throws RiceIllegalArgumentException;
051    
052    /**
053     * This will return all {@link Campus}.
054     */
055    @WebMethod(operationName="findAllCampuses")
056    @XmlElementWrapper(name = "campuses", required = false)
057    @XmlElement(name = "campus", required = false)
058    @WebResult(name = "campuses")
059    @Cacheable(value=Campus.Cache.NAME, key="'all'")
060    List<Campus> findAllCampuses();
061    
062    /**
063     * This will return a {@link CampusType}.
064     *
065     * @param code the code of the campus type to return
066     * @return CampusType object represented by the passed in code
067     * @throws RiceIllegalArgumentException if the code is null
068     *
069     */
070    @WebMethod(operationName="getCampusType")
071    @WebResult(name = "campusType")
072    @Cacheable(value=CampusType.Cache.NAME, key="'code=' + #p0")
073    CampusType getCampusType(@WebParam(name = "code") String code) throws RiceIllegalArgumentException;
074    
075    /**
076     * This will return all {@link CampusType}.
077     */
078    @WebMethod(operationName="findAllCampusTypes")
079    @XmlElementWrapper(name = "campusTypes", required = false)
080    @XmlElement(name = "campusType", required = false)
081    @WebResult(name = "campusTypes")
082    @Cacheable(value=CampusType.Cache.NAME, key="'all'")
083    List<CampusType> findAllCampusTypes();
084
085    /**
086     * This method find Campuses based on a query criteria.  The criteria cannot be null.
087     *
088     * @since 2.0.1
089     * @param queryByCriteria the criteria.  Cannot be null.
090     * @return query results.  will never return null.
091     * @throws IllegalArgumentException if the queryByCriteria is null
092     */
093    @WebMethod(operationName = "findCampuses")
094    @WebResult(name = "results")
095    CampusQueryResults findCampuses(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
096
097    /**
098     * This method find CampusTypes based on a query criteria.  The criteria cannot be null.
099     *
100     * @since 2.0.1
101     * @param queryByCriteria the criteria.  Cannot be null.
102     * @return query results.  will never return null.
103     * @throws IllegalArgumentException if the queryByCriteria is null
104     */
105    @WebMethod(operationName = "findCampusTypes")
106    @WebResult(name = "results")
107    CampusTypeQueryResults findCampusTypes(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
108}