View Javadoc

1   /**
2    * Copyright 2005-2014 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.krms.api.repository.term;
17  
18  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
19  import org.kuali.rice.krms.api.KrmsConstants;
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.List;
30  
31  /**
32   * The TermRepositoryService provides the basic access to terms and term resolvers in the repository needed
33   * for executing rules.
34   *
35   * @author Kuali Rice Team (rice.collab@kuali.org)
36   *
37   */
38  @WebService(name = "termRepositoryService", targetNamespace = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0)
39  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
40  public interface TermRepositoryService {
41  
42  
43      /**
44       * Retrieves all {@link TermResolverDefinition}s for the given namespace.
45       *
46       * @since 2.1.1
47       * @param namespace the namespace for which to get all term resolvers.
48       * @return the List of {@link TermResolverDefinition}s for the given namespace. May be empty, but never null.
49       *
50       * @throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException if the namespace is null or blank.
51       */
52      @WebMethod(operationName = "findTermResolversByNamespace")
53      @XmlElementWrapper(name = "termResolvers", required = true)
54      @XmlElement(name = "termResolver", required = false)
55      @WebResult(name = "termResolvers")
56      @Cacheable(value= TermResolverDefinition.Cache.NAME, key="'namespace=' + #p0")
57      List<TermResolverDefinition> findTermResolversByNamespace(@WebParam(name = "namespace") String namespace) throws RiceIllegalArgumentException;;
58  
59      /**
60       * Retrieves the {@link TermDefinition} with the given termId.
61       *
62       * @since 2.1.1
63       * @param termId the identifier of the term to retrieve.
64       * @return the {@link TermDefinition} with the given termId.  May be null if there is no term with the given termId
65       * in the repository.
66       *
67       * @throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException if the termId is null or blank.
68       */
69      @WebMethod(operationName = "getTerm")
70      @WebResult(name = "term")
71      @Cacheable(value= TermDefinition.Cache.NAME, key="'id=' + #p0")
72      TermDefinition getTerm(@WebParam(name = "termId") String termId) throws RiceIllegalArgumentException;;
73  
74      /**
75       * Retrieves all the {@link TermSpecificationDefinition}s that are valid for the context with the given contextId.
76       *
77       * @since 2.1.4
78       * @param contextId the identifier for the context whose valid {@link TermSpecificationDefinition}s are to be retrieved. 
79       * @return all the {@link TermSpecificationDefinition}s that are valid for the context with the given contextId. May be empty but never null
80       *
81       * @throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException if the contextId is null or blank.
82       */
83      @WebMethod(operationName = "findAllTermSpecificationsByContextId")
84      @XmlElementWrapper(name = "termSpecifications", required = true)
85      @XmlElement(name = "termSpecification", required = false)
86      @WebResult(name = "termSpecifications")
87      @Cacheable(value= TermSpecificationDefinition.Cache.NAME, key="'id=' + #p0")
88      List<TermSpecificationDefinition> findAllTermSpecificationsByContextId(@WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;;
89  }