ingo@104: package de.intevation.artifactdatabase.transition;
ingo@104: 
ingo@257: import org.w3c.dom.Node;
ingo@257: 
ingo@257: import de.intevation.artifacts.Artifact;
ingo@257: 
ingo@104: import de.intevation.artifactdatabase.state.State;
ingo@104: 
ingo@104: 
ingo@104: /**
ingo@104:  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
ingo@104:  */
ingo@104: public interface Transition {
ingo@104: 
ingo@104:     /**
ingo@257:      * Initializes the transition.
ingo@257:      *
ingo@257:      * @param config The configuration node for the transition.
ingo@257:      */
ingo@257:     public void init(Node config);
ingo@257: 
ingo@257:     /**
ingo@104:      * Return the ID of the start State.
ingo@104:      */
ingo@104:     public String getFrom();
ingo@104: 
ingo@104:     /**
ingo@104:      * Return the ID of the target State.
ingo@104:      */
ingo@104:     public String getTo();
ingo@104: 
ingo@104:     /**
ingo@104:      * Set the ID of the current State.
ingo@104:      *
ingo@104:      * @param from The ID of the current state.
ingo@104:      */
ingo@104:     public void setFrom(String from);
ingo@104: 
ingo@104:     /**
ingo@104:      * Set the ID of the target State.
ingo@104:      *
ingo@104:      * @param to The ID of the target state.
ingo@104:      */
ingo@104:     public void setTo(String to);
ingo@104: 
ingo@104:     /**
ingo@257:      * Determines if its valid to step from state <i>a</i> of an artifact
ingo@257:      * <i>artifact</i> to state <i>b</i>.
ingo@257:      *
ingo@257:      * @param artifact The owner artifact of state a and b.
ingo@257:      * @param a The current state.
ingo@257:      * @param b The target state.
ingo@257:      *
ingo@257:      * @return true, if it is valid to step from a to b, otherwise false.
ingo@104:      */
ingo@257:     public boolean isValid(Artifact artifact, State a, State b);
ingo@104: }
ingo@104: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :