KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > service > cmr > action > Action


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.service.cmr.action;
18
19 import java.util.Date JavaDoc;
20 import java.util.List JavaDoc;
21
22 import org.alfresco.service.cmr.repository.NodeRef;
23
24
25 /**
26  * The rule action interface
27  *
28  * @author Roy Wetherall
29  */

30 public interface Action extends ParameterizedItem
31 {
32     /**
33      * Get the name of the action definition that relates to this action
34      *
35      * @return the action defintion name
36      */

37     String JavaDoc getActionDefinitionName();
38     
39     /**
40      * Get the title of the action
41      *
42      * @return the title of the action
43      */

44     String JavaDoc getTitle();
45     
46     /**
47      * Set the title of the action
48      *
49      * @param title the title of the action
50      */

51     void setTitle(String JavaDoc title);
52     
53     /**
54      * Get the description of the action
55      *
56      * @return the description of the action
57      */

58     String JavaDoc getDescription();
59     
60     /**
61      * Set the description of the action
62      *
63      * @param description the description of the action
64      */

65     void setDescription(String JavaDoc description);
66     
67     /**
68      * Get the node reference of the node that 'owns' this action.
69      * <p>
70      * The node that 'owns' the action is th one that stores it via its
71      * actionable aspect association.
72      *
73      * @return node reference
74      */

75     NodeRef getOwningNodeRef();
76     
77     /**
78      * Gets a value indicating whether the action should be executed asychronously or not.
79      * <p>
80      * The default is to execute the action synchronously.
81      *
82      * @return true if the action is executed asychronously, false otherwise.
83      */

84     boolean getExecuteAsychronously();
85     
86     /**
87      * Set the value that indicates whether the action should be executed asychronously or not.
88      *
89      * @param executeAsynchronously true if the action is to be executed asychronously, false otherwise.
90      */

91     void setExecuteAsynchronously(boolean executeAsynchronously);
92     
93     /**
94      * Get the compensating action.
95      * <p>
96      * This action is executed if the failure behaviour is to compensate and the action being executed
97      * fails.
98      *
99      * @return the compensating action
100      */

101     Action getCompensatingAction();
102     
103     /**
104      * Set the compensating action.
105      *
106      * @param action the compensating action
107      */

108     void setCompensatingAction(Action action);
109     
110     /**
111      * Get the date the action was created
112      *
113      * @return action creation date
114      */

115     Date JavaDoc getCreatedDate();
116     
117     /**
118      * Get the name of the user that created the action
119      *
120      * @return user name
121      */

122     String JavaDoc getCreator();
123     
124     /**
125      * Get the date that the action was last modified
126      *
127      * @return aciton modification date
128      */

129     Date JavaDoc getModifiedDate();
130     
131     /**
132      * Get the name of the user that last modified the action
133      *
134      * @return user name
135      */

136     String JavaDoc getModifier();
137     
138     /**
139      * Indicates whether the action has any conditions specified
140      *
141      * @return true if the action has any conditions specified, flase otherwise
142      */

143     boolean hasActionConditions();
144     
145     /**
146      * Gets the index of an action condition
147      *
148      * @param actionCondition the action condition
149      * @return the index
150      */

151     int indexOfActionCondition(ActionCondition actionCondition);
152     
153     /**
154      * Gets a list of the action conditions for this action
155      *
156      * @return list of action conditions
157      */

158     List JavaDoc<ActionCondition> getActionConditions();
159     
160     /**
161      * Get the action condition at a given index
162      *
163      * @param index the index
164      * @return the action condition
165      */

166     ActionCondition getActionCondition(int index);
167     
168     /**
169      * Add an action condition to the action
170      *
171      * @param actionCondition an action condition
172      */

173     void addActionCondition(ActionCondition actionCondition);
174     
175     /**
176      * Add an action condition at the given index
177      *
178      * @param index the index
179      * @param actionCondition the action condition
180      */

181     void addActionCondition(int index, ActionCondition actionCondition);
182     
183     /**
184      * Replaces the current action condition at the given index with the
185      * action condition provided.
186      *
187      * @param index the index
188      * @param actionCondition the action condition
189      */

190     void setActionCondition(int index, ActionCondition actionCondition);
191     
192     /**
193      * Removes an action condition
194      *
195      * @param actionCondition an action condition
196      */

197     void removeActionCondition(ActionCondition actionCondition);
198     
199     /**
200      * Removes all action conditions
201      */

202     void removeAllActionConditions();
203 }
204
Popular Tags