view flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 105:beb991dc4827

Added a first stub of an WINFO artifact. flys-artifacts/trunk@1287 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 02 Feb 2011 14:56:22 +0000
parents
children 9891d133f08d
line wrap: on
line source
package de.intevation.flys.artifacts;

import java.io.IOException;
import java.io.OutputStream;

import org.w3c.dom.Document;

import org.apache.log4j.Logger;

import de.intevation.artifacts.ArtifactFactory;
import de.intevation.artifacts.CallContext;

import de.intevation.artifactdatabase.DefaultArtifact;


/**
 * The default WINFO artifact.
 *
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class WINFOArtifact extends DefaultArtifact {

    /** The logger for this class */
    private static Logger logger = Logger.getLogger(WINFOArtifact.class);


    /**
     * The default constructor.
     */
    public WINFOArtifact() {
        super();
    }


    /**
     * Initialize the artifact and insert new data if <code>data</code> contains
     * information necessary for this artifact.
     *
     * @param identifier The UUID.
     * @param factory The factory that is used to create this artifact.
     * @param context The CallContext.
     * @param data Some optional data.
     */
    @Override
    public void setup(
        String          identifier,
        ArtifactFactory factory,
        Object          context,
        Document        data)
    {
        logger.debug("Setup this artifact with the uuid: " + identifier);

        super.setup(identifier, factory, context, data);
    }


    /**
     * This method handles requests for changing the current state of an
     * artifact.
     *
     * @param target The target of the advance action.
     * @param context The CallContext.
     *
     * @return the result of the advance action.
     */
    @Override
    public Document advance(Document target, CallContext context) {
        logger.debug("Advance to another state.");

        return super.advance(target, context);
    }


    /**
     * This methods introduces new data to the current artifact.
     *
     * @param data A document containing the new data.
     * @param context The CallContext.
     *
     * @return the result of the feed action.
     */
    @Override
    public Document feed(Document data, CallContext context) {
        logger.debug("Feed the artifact with new data.");

        return super.feed(data, context);
    }


    /**
     * This method returns a description of this artifact.
     *
     * @param data Some data.
     * @param CallContext The CallContext.
     *
     * @return the description of this artifact.
     */
    public Document describe(Document data, CallContext context) {
        logger.debug("Describe the artifact.");

        return super.describe(data, context);
    }


    /**
     * Call an output target.
     *
     * @param format The format for the output.
     * @param outStream The output stream.
     * @param context The CallContext.
     * @throws IOException if an error occured while writing the result to the
     * output stream.
     */
    public void out(
        Document format, OutputStream outStream, CallContext context)
    throws IOException
    {
        logger.debug("Call an out target.");

        super.out(format, outStream, context);
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org