Mercurial > dive4elements > gnv-client
diff 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 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java Wed Mar 31 13:48:07 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java Thu Apr 01 09:15:36 2010 +0000 @@ -13,18 +13,45 @@ import org.w3c.dom.Node; /** + * This interface describes the basic method a concrete state class needs to + * implement. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ public interface State extends Serializable { + /** + * Setup the state. + * + * @param configuration State configuration. + */ public void setup(Node configuration); + /** + * Return the id of the state. + * + * @return the id. + */ public String getID(); + /** + * Return the description of the state. + * + * @return the description of the state. + */ public String getDescription(); + /** + * This method is called when an artifacts retrieves a describe request. It + * creates the user interface description of the current state. + * + * @param document Describe doucment. + * @param rootNode Parent node for all new xml elements. + * @param context The CallContext. + * @param uuid The uuid of an artifact. + */ public void describe( Document document, Node rootNode, @@ -32,36 +59,124 @@ String uuid ); + /** + * This method is used to insert new data into this state. Concrete + * subclasses should valide the input before saving it. + * + * @param context The CallContext. + * @param inputData New InputData items. + * @param uuid The uuid of an artifact. + * @return a document with an error or sucess message. + * @throws StateException + */ public Document feed( CallContext context, Collection<InputData> inputData, String uuid) throws StateException; + /** + * Set the previous state. + * + * @param state The previous state. + */ public void setParent(State state); + /** + * Returns the previous state. + * + * @return the previous state. + */ public State getParent(); + /** + * Retrieve a collection of required input values. + * + * @return required input values. + */ public Collection<InputValue> getRequiredInputValues(); + /** + * Retrieves a map with InputData items. + * + * @return a map with InputData items. + */ public Map<String, InputData> inputData(); + /** + * Use this method to feed a state with some data. + * + * @param inputData InputData collection. + * @param uuid UUID of an artifact. + * @throws StateException + */ public void putInputData(Collection<InputData> inputData, String uuid) throws StateException; + /** + * Retrieves a collection with the InputData stored in this state. + * + * @return An InputData collection. + * @throws StateException + */ public Collection<InputData> getInputData() throws StateException; + /** + * This method is called to advance to a next or previous state. + * + * @param uuid The uuid of an artifact. + * @param context The CallContext object. + * @throws StateException + */ public void advance(String uuid, CallContext context) throws StateException; + /** + * This method is called when the state is created. + * + * @param uuid The uuid of an artifact. + * @param context The CallContext object. + * @throws StateException + */ public void initialize(String uuid, CallContext context) throws StateException; + /** + * This method can be used to reset the state. + * + * @param uuid The uuid of an artifact. + */ public void reset(String uuid); + /** + * This method is called when the lifetime of an artifact ends or if the + * user decides to step back to a previous state. + * + * @param globalContext The CallContext. + */ public void endOfLife(Object globalContext); + /** + * This method is used to put some InputData objects into an artifact before + * the parameterization begins. + * + * @param preSettings + */ public void setPreSettings(Map<String,InputData> preSettings); + /** + * This method retrieves a map with InputData objects which have been + * inserted into this state before the parameterization has started. The key + * used to store the objects is the name of the state. + * + * @return map with InputData objects. + */ public Map<String,InputData> getPreSettings(); + /** + * Method to remove the data stored at a state which should not be + * serialized while an artifact is exported. + * + * @param context The CallContext + */ public void cleanup(Object context); } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file