ingo@105: package de.intevation.flys.artifacts; ingo@105: ingo@105: import java.io.IOException; ingo@105: import java.io.OutputStream; ingo@105: ingo@105: import org.w3c.dom.Document; ingo@105: ingo@105: import org.apache.log4j.Logger; ingo@105: ingo@105: import de.intevation.artifacts.ArtifactFactory; ingo@105: import de.intevation.artifacts.CallContext; ingo@105: ingo@105: import de.intevation.artifactdatabase.DefaultArtifact; ingo@105: ingo@105: ingo@105: /** ingo@105: * The default WINFO artifact. ingo@105: * ingo@105: * @author Ingo Weinzierl ingo@105: */ ingo@105: public class WINFOArtifact extends DefaultArtifact { ingo@105: ingo@105: /** The logger for this class */ ingo@105: private static Logger logger = Logger.getLogger(WINFOArtifact.class); ingo@105: ingo@105: ingo@105: /** ingo@105: * The default constructor. ingo@105: */ ingo@105: public WINFOArtifact() { ingo@105: super(); ingo@105: } ingo@105: ingo@105: ingo@105: /** ingo@105: * Initialize the artifact and insert new data if data contains ingo@105: * information necessary for this artifact. ingo@105: * ingo@105: * @param identifier The UUID. ingo@105: * @param factory The factory that is used to create this artifact. ingo@105: * @param context The CallContext. ingo@105: * @param data Some optional data. ingo@105: */ ingo@105: @Override ingo@105: public void setup( ingo@105: String identifier, ingo@105: ArtifactFactory factory, ingo@105: Object context, ingo@105: Document data) ingo@105: { ingo@105: logger.debug("Setup this artifact with the uuid: " + identifier); ingo@105: ingo@105: super.setup(identifier, factory, context, data); ingo@105: } ingo@105: ingo@105: ingo@105: /** ingo@105: * This method handles requests for changing the current state of an ingo@105: * artifact. ingo@105: * ingo@105: * @param target The target of the advance action. ingo@105: * @param context The CallContext. ingo@105: * ingo@105: * @return the result of the advance action. ingo@105: */ ingo@105: @Override ingo@105: public Document advance(Document target, CallContext context) { ingo@105: logger.debug("Advance to another state."); ingo@105: ingo@105: return super.advance(target, context); ingo@105: } ingo@105: ingo@105: ingo@105: /** ingo@105: * This methods introduces new data to the current artifact. ingo@105: * ingo@105: * @param data A document containing the new data. ingo@105: * @param context The CallContext. ingo@105: * ingo@105: * @return the result of the feed action. ingo@105: */ ingo@105: @Override ingo@105: public Document feed(Document data, CallContext context) { ingo@105: logger.debug("Feed the artifact with new data."); ingo@105: ingo@105: return super.feed(data, context); ingo@105: } ingo@105: ingo@105: ingo@105: /** ingo@105: * This method returns a description of this artifact. ingo@105: * ingo@105: * @param data Some data. ingo@105: * @param CallContext The CallContext. ingo@105: * ingo@105: * @return the description of this artifact. ingo@105: */ ingo@105: public Document describe(Document data, CallContext context) { ingo@105: logger.debug("Describe the artifact."); ingo@105: ingo@105: return super.describe(data, context); ingo@105: } ingo@105: ingo@105: ingo@105: /** ingo@105: * Call an output target. ingo@105: * ingo@105: * @param format The format for the output. ingo@105: * @param outStream The output stream. ingo@105: * @param context The CallContext. ingo@105: * @throws IOException if an error occured while writing the result to the ingo@105: * output stream. ingo@105: */ ingo@105: public void out( ingo@105: Document format, OutputStream outStream, CallContext context) ingo@105: throws IOException ingo@105: { ingo@105: logger.debug("Call an out target."); ingo@105: ingo@105: super.out(format, outStream, context); ingo@105: } ingo@105: } ingo@105: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :