View Javadoc

1   /**
2    * Copyright 2005-2015 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.impl.repository;
17  
18  import java.util.List;
19  
20  
21  import org.kuali.rice.krms.api.repository.proposition.PropositionDefinition;
22  import org.kuali.rice.krms.api.repository.proposition.PropositionParameter;
23  import org.kuali.rice.krms.api.repository.rule.RuleDefinition;
24  import org.springframework.cache.annotation.CacheEvict;
25  import org.springframework.cache.annotation.Cacheable;
26  
27  /**
28   * This is the interface for accessing KRMS repository Proposition related
29   * business objects.
30   *
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   *
33   */
34  public interface PropositionBoService {
35  
36      /**
37       * This will create a {@link PropositionDefinition} exactly like the parameter passed in.
38       *
39       * @param prop the proposition to create
40       * @throws IllegalArgumentException if the proposition is null
41       * @throws IllegalStateException if the proposition already exists in the system
42       */
43      @CacheEvict(value={PropositionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true)
44      PropositionDefinition createProposition(PropositionDefinition prop);
45  
46      /**
47       * This will update an existing {@link PropositionDefinition}.
48       *
49       * @param prop the proposition to update
50       * @throws IllegalArgumentException if the proposition is null
51       * @throws IllegalStateException if the proposition does not exist in the system
52       */
53      @CacheEvict(value={PropositionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true)
54      void updateProposition(PropositionDefinition prop);
55  
56      /**
57       * Lookup the proposition based on the given proposition id.
58       *
59       * @param propId the given proposition id
60       * @return a proposition associated with the given proposition id.  A null reference is returned if an invalid or
61       *         non-existent id is supplied.
62       */
63      @Cacheable(value= PropositionDefinition.Cache.NAME, key="'propId=' + #p0")
64      PropositionDefinition getPropositionById(String propId);
65  
66  
67  
68      /**
69       * This will create a {@link PropositionParameter} exactly like the parameter passed in.
70       *
71       * @param parameter the proposition parameter to create
72       * @throws IllegalArgumentException if the proposition parameter is null
73       * @throws IllegalStateException if the proposition parameter is already existing in the system
74       */
75      @CacheEvict(value={PropositionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true)
76      void createParameter(PropositionParameter parameter);
77  
78      /**
79       * This will update a {@link PropositionParameter}.
80       *
81       *
82       * @param parameter the proposition parameter to update
83       * @throws IllegalArgumentException if the proposition parameter is null
84       * @throws IllegalStateException if the proposition parameter does not exist in the system
85       */
86      @CacheEvict(value={PropositionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true)
87      void updateParameter(PropositionParameter parameter);
88  
89      /**
90       * Lookup the proposition parameters based on the given proposition id.
91       *
92       * @param propId the given proposition id
93       * @return a list of PropositionParameters associated with the given proposition id.  A null reference is returned if an invalid or
94       *         non-existant id is supplied.
95       */
96      List<PropositionParameter> getParameters(String propId);
97  
98      /**
99       * Lookup the proposition parameter based on the id.
100      *
101      * @param id the given proposition id
102      * @return an immutable PropositionParameters associated with the given id.  A null reference is returned if an invalid or
103      *         non-existant id is supplied.
104      */
105     PropositionParameter getParameterById(String id);
106 
107     /**
108      * Lookup the proposition parameter based on the proposition id and sequence number.
109      *
110      * @param id the given proposition id
111      * @return an immutable PropositionParameters associated with the given proposition id and sequence number.  A null reference is returned if an invalid or
112      *         non-existant.
113      */
114     PropositionParameter getParameterByPropIdAndSequenceNumber(String propId, Integer sequenceNumber);
115 
116 
117 }