view artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java @ 19:1259d192e3c3

* New configuration based on config directory * Artifact database launches REST web server at startup. artifacts/trunk@43 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 09 Sep 2009 07:55:44 +0000
parents 63a8aa276693
children d5dc2900392f
line wrap: on
line source
package de.intevation.artifactdatabase;

import org.w3c.dom.Document;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import de.intevation.artifacts.Artifact;

import org.apache.log4j.Logger;

/**
 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
 */
public class DefaultArtifact
implements   Artifact
{
    private static Logger logger = Logger.getLogger(DefaultArtifact.class);
    
    /**
     * The URI of the Namespace of the Artifacts
     */
    public final static String NAMESPACE_URI = "http://www.intevation.de/2009/artifacts";
    
    /**
     * The XML-Prefix for the Artifacts-Namespae
     */
    public final static String NAMESPACE_PREFIX = "art";

    protected String identifier;

    public DefaultArtifact() {
    }

    protected Document newDocument() {
        try {
            return DocumentBuilderFactory
                .newInstance()
                .newDocumentBuilder()
                .newDocument();
        }
        catch (ParserConfigurationException pce) {
            logger.error(pce.getLocalizedMessage(), pce);
        }
        return null;
    }

    public String identifier() {
        return this.identifier;
    }

    public String hash() {
        return String.valueOf(hashCode());
    }

    public Document describe(Object context) {
        return newDocument();
    }

    public Document advance(Document target, Object context) {
        return newDocument();
    }

    public Document feed(Document target, Object context) {
        return newDocument();
    }

    public byte [] out(Document format, Object context) {
        return new byte[0];
    }

    public void setup(String identifier, Object context) {
        this.identifier = identifier;
    }

    public void endOfLife(Object context) {
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org