view artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java @ 68:541814404822

Added interfaces for XML processing services. TODO: Implement them! artifacts/trunk@593 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 22 Jan 2010 09:48:18 +0000
parents 9a29899b31e5
children d4c4c23847f5
line wrap: on
line source
package de.intevation.artifactdatabase;

import org.w3c.dom.Document;

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

import org.apache.log4j.Logger;

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

/**
 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
 */
public class DefaultArtifact
implements   Artifact
{
    private static Logger logger = Logger.getLogger(DefaultArtifact.class);

    protected String identifier;

    public DefaultArtifact() {
    }

    public String identifier() {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.identifier: " + identifier);
        }
        return this.identifier;
    }

    public String hash() {
        String hash = String.valueOf(hashCode());
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.hashCode: "
                + identifier + " (" + hash + ")");
        }
        return hash;
    }

    public Document describe(Document data, CallContext context) {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.describe: " + identifier);
        }
        return XMLUtils.newDocument();
    }

    public Document advance(Document target, CallContext context) {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.advance: " + identifier);
        }
        return XMLUtils.newDocument();
    }

    public Document feed(Document target, CallContext context) {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.feed: " + identifier);
        }
        return XMLUtils.newDocument();
    }

    public void out(
        Document     format,
        OutputStream out,
        CallContext  context
    )
    throws IOException
    {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.out: " + identifier);
        }
    }

    public void setup(String identifier, ArtifactFactory factory, Object context) {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.setup: " + identifier);
        }
        this.identifier = identifier;
    }

    public void endOfLife(Object context) {
        if (logger.isDebugEnabled()) {
            logger.debug("DefaultArtifact.endOfLife: " + identifier);
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org