Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java @ 796:a5526908f92f
Added javadoc in state package.
gnv-artifacts/trunk@878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 01 Apr 2010 09:15:36 +0000 |
parents | c4156275c1e1 |
children | feae2f9d6c6f |
comparison
equal
deleted
inserted
replaced
795:cdade5005cba | 796:a5526908f92f |
---|---|
11 | 11 |
12 import org.w3c.dom.Document; | 12 import org.w3c.dom.Document; |
13 import org.w3c.dom.Node; | 13 import org.w3c.dom.Node; |
14 | 14 |
15 /** | 15 /** |
16 * This interface describes the basic method a concrete state class needs to | |
17 * implement. | |
18 * | |
16 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> | 19 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
18 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | 21 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
19 */ | 22 */ |
20 public interface State extends Serializable { | 23 public interface State extends Serializable { |
21 | 24 |
25 /** | |
26 * Setup the state. | |
27 * | |
28 * @param configuration State configuration. | |
29 */ | |
22 public void setup(Node configuration); | 30 public void setup(Node configuration); |
23 | 31 |
32 /** | |
33 * Return the id of the state. | |
34 * | |
35 * @return the id. | |
36 */ | |
24 public String getID(); | 37 public String getID(); |
25 | 38 |
39 /** | |
40 * Return the description of the state. | |
41 * | |
42 * @return the description of the state. | |
43 */ | |
26 public String getDescription(); | 44 public String getDescription(); |
27 | 45 |
46 /** | |
47 * This method is called when an artifacts retrieves a describe request. It | |
48 * creates the user interface description of the current state. | |
49 * | |
50 * @param document Describe doucment. | |
51 * @param rootNode Parent node for all new xml elements. | |
52 * @param context The CallContext. | |
53 * @param uuid The uuid of an artifact. | |
54 */ | |
28 public void describe( | 55 public void describe( |
29 Document document, | 56 Document document, |
30 Node rootNode, | 57 Node rootNode, |
31 CallContext context, | 58 CallContext context, |
32 String uuid | 59 String uuid |
33 ); | 60 ); |
34 | 61 |
62 /** | |
63 * This method is used to insert new data into this state. Concrete | |
64 * subclasses should valide the input before saving it. | |
65 * | |
66 * @param context The CallContext. | |
67 * @param inputData New InputData items. | |
68 * @param uuid The uuid of an artifact. | |
69 * @return a document with an error or sucess message. | |
70 * @throws StateException | |
71 */ | |
35 public Document feed( | 72 public Document feed( |
36 CallContext context, Collection<InputData> inputData, String uuid) | 73 CallContext context, Collection<InputData> inputData, String uuid) |
37 throws StateException; | 74 throws StateException; |
38 | 75 |
76 /** | |
77 * Set the previous state. | |
78 * | |
79 * @param state The previous state. | |
80 */ | |
39 public void setParent(State state); | 81 public void setParent(State state); |
40 | 82 |
83 /** | |
84 * Returns the previous state. | |
85 * | |
86 * @return the previous state. | |
87 */ | |
41 public State getParent(); | 88 public State getParent(); |
42 | 89 |
90 /** | |
91 * Retrieve a collection of required input values. | |
92 * | |
93 * @return required input values. | |
94 */ | |
43 public Collection<InputValue> getRequiredInputValues(); | 95 public Collection<InputValue> getRequiredInputValues(); |
44 | 96 |
97 /** | |
98 * Retrieves a map with InputData items. | |
99 * | |
100 * @return a map with InputData items. | |
101 */ | |
45 public Map<String, InputData> inputData(); | 102 public Map<String, InputData> inputData(); |
46 | 103 |
104 /** | |
105 * Use this method to feed a state with some data. | |
106 * | |
107 * @param inputData InputData collection. | |
108 * @param uuid UUID of an artifact. | |
109 * @throws StateException | |
110 */ | |
47 public void putInputData(Collection<InputData> inputData, String uuid) | 111 public void putInputData(Collection<InputData> inputData, String uuid) |
48 throws StateException; | 112 throws StateException; |
49 | 113 |
114 /** | |
115 * Retrieves a collection with the InputData stored in this state. | |
116 * | |
117 * @return An InputData collection. | |
118 * @throws StateException | |
119 */ | |
50 public Collection<InputData> getInputData() throws StateException; | 120 public Collection<InputData> getInputData() throws StateException; |
51 | 121 |
122 /** | |
123 * This method is called to advance to a next or previous state. | |
124 * | |
125 * @param uuid The uuid of an artifact. | |
126 * @param context The CallContext object. | |
127 * @throws StateException | |
128 */ | |
52 public void advance(String uuid, CallContext context) | 129 public void advance(String uuid, CallContext context) |
53 throws StateException; | 130 throws StateException; |
54 | 131 |
132 /** | |
133 * This method is called when the state is created. | |
134 * | |
135 * @param uuid The uuid of an artifact. | |
136 * @param context The CallContext object. | |
137 * @throws StateException | |
138 */ | |
55 public void initialize(String uuid, CallContext context) | 139 public void initialize(String uuid, CallContext context) |
56 throws StateException; | 140 throws StateException; |
57 | 141 |
142 /** | |
143 * This method can be used to reset the state. | |
144 * | |
145 * @param uuid The uuid of an artifact. | |
146 */ | |
58 public void reset(String uuid); | 147 public void reset(String uuid); |
59 | 148 |
149 /** | |
150 * This method is called when the lifetime of an artifact ends or if the | |
151 * user decides to step back to a previous state. | |
152 * | |
153 * @param globalContext The CallContext. | |
154 */ | |
60 public void endOfLife(Object globalContext); | 155 public void endOfLife(Object globalContext); |
61 | 156 |
157 /** | |
158 * This method is used to put some InputData objects into an artifact before | |
159 * the parameterization begins. | |
160 * | |
161 * @param preSettings | |
162 */ | |
62 public void setPreSettings(Map<String,InputData> preSettings); | 163 public void setPreSettings(Map<String,InputData> preSettings); |
63 | 164 |
165 /** | |
166 * This method retrieves a map with InputData objects which have been | |
167 * inserted into this state before the parameterization has started. The key | |
168 * used to store the objects is the name of the state. | |
169 * | |
170 * @return map with InputData objects. | |
171 */ | |
64 public Map<String,InputData> getPreSettings(); | 172 public Map<String,InputData> getPreSettings(); |
65 | 173 |
174 /** | |
175 * Method to remove the data stored at a state which should not be | |
176 * serialized while an artifact is exported. | |
177 * | |
178 * @param context The CallContext | |
179 */ | |
66 public void cleanup(Object context); | 180 public void cleanup(Object context); |
67 } | 181 } |
182 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |