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.krms.impl.repository;
17
18 import java.util.List;
19
20 import org.kuali.rice.krms.api.repository.action.ActionDefinition;
21
22 /**
23 * This is the interface for accessing KRMS repository Action related
24 * business objects.
25 *
26 * @author Kuali Rice Team (rice.collab@kuali.org)
27 *
28 */
29 public interface ActionBoService {
30
31 /**
32 * This will create a {@link ActionDefinition} exactly like the parameter passed in.
33 *
34 * @param action The Action to create
35 * @throws IllegalArgumentException if the action is null
36 * @throws IllegalStateException if the action already exists in the system
37 */
38 public ActionDefinition createAction(ActionDefinition action);
39
40 /**
41 * This will update an existing {@link ActionDefinition}.
42 *
43 * @param action The Action to update
44 * @throws IllegalArgumentException if the Action is null
45 * @throws IllegalStateException if the Action does not exists in the system
46 */
47 public void updateAction(ActionDefinition action);
48
49 /**
50 * Retrieves an Action from the repository based on the given action id.
51 *
52 * @param actionId the id of the Action to retrieve
53 * @return an {@link ActionDefinition} identified by the given actionId.
54 * A null reference is returned if an invalid or non-existent id is supplied.
55 * @throws IllegalArgumentException if the actionId is null or blank.
56 */
57 public ActionDefinition getActionByActionId(String actionId);
58
59 /**
60 * Retrieves an Action from the repository based on the provided action name
61 * and namespace.
62 *
63 * @param name the name of the Action to retrieve.
64 * @param namespace the namespace that the action is under.
65 * @return an {@link ActionDefinition} identified by the given name and namespace.
66 * A null reference is returned if an invalid or non-existent name and
67 * namespace combination is supplied.
68 * @throws IllegalArgumentException if the either the name or the namespace
69 * is null or blank.
70 */
71 public ActionDefinition getActionByNameAndNamespace(String name, String namespace);
72
73 /**
74 * Retrieves an ordered List of Actions associated with a
75 * {@link org.kuali.rice.krms.api.repository.rule.RuleDefinition}.
76 * The order of the list is determined by the sequenceNumber property
77 * of the Actions.
78 *
79 * @param ruleId the id of the rule
80 * @return a list of {@link ActionDefinition} associated with the given rule.
81 * A null reference is returned if an invalid or ruleId is supplied.
82 * @throws IllegalArgumentException if the ruleId is null or blank.
83 */
84 public List<ActionDefinition> getActionsByRuleId(String ruleId);
85
86 /**
87 * Retrieves an specific Action associated with a Rule.
88 *
89 * @param ruleId the id of the rule
90 * @param sequenceNumber an Integer that represents the sequence number of the action.
91 * @return an {@link ActionDefinition} identified associated with the
92 * Rule and identified by the given sequenceNumber
93 * A null reference is returned if an invalid or non-existent name and
94 * namespace combination is supplied.
95 * @throws IllegalArgumentException if the ruleId is null or blank. Or
96 * if the sequenceNumber is null.
97 */
98 public ActionDefinition getActionByRuleIdAndSequenceNumber(String ruleId, Integer sequenceNumber);
99
100 // public ActionAttribute createActionAttribute(ActionAttribute actionAttribute);
101 // public void updateActionAttribute(ActionAttribute actionAttribute);
102
103 }