view gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java @ 1022:28a0628b11b0

Added license file and license header. gnv/trunk@1258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:15:08 +0000
parents d5d4dbda17cc
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.artifactdatabase.objects;

import java.util.Collection;
import java.util.Map;

import org.w3c.dom.Node;

/**
 * An <code>ArtifactObject</code> representing an artifact.
 *
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 *
 */
public class Artifact implements ArtifactObject, ArtifactDescription {


    /**
     * The UID of this Class
     */
    private static final long serialVersionUID = 8606869493141810364L;

    /**
     * The uuid of this Artifact which must be used to identify 
     * the artifact at the <code>ArtifactDatabase</code>.
     */
    private String id = null;

    /**
     * The hash of the artifact which was send be the <code>ArtifactDatabase</code>.
     */
    private String hash = null;

    /**
     * Flag which marks if the Artifact is currently selected or not. 
     */
    private boolean selected = false;

    /**
     * The XML-Node of the current User-Interface
     */
    private Node currentUI = null;
    
    /**
     * The XML-Nodes of the OutputModes.
     */
    private Node currentOut = null;

    /**
     * The ids of the states which could be reached.
     */
    private Collection<String> reachableStates;

    /**
     * The parameters whcih could be feed to the artifact at the current state.
     */
    private Collection<String> inputParameter;

    /**
     * The <code>OutputModes</code> that could be reached at the current state.
     */
    private Map<String, OutputMode> outputModes;

    /**
     * The id of the state which is currently used.
     */
    private String currentState = null;

    /**
     * Constructor
     * @param uuid the uuid of this Artifact which must be used to identify 
     *             the artifact at the <code>ArtifactDatabase</code>
     * @param hash the hash of the artifact which was send be the 
     *             <code>ArtifactDatabase</code>
     */
    public Artifact(String uuid, String hash) {
        this.id = uuid;
        this.hash = hash;
    }

    public Node getCurrentUI() {
        return currentUI;
    }


    public void setCurrentUI(Node currentUI) {
        this.currentUI = currentUI;
    }


    public Node getCurrentOut() {
        return currentOut;
    }


    public void setCurrentOut(Node currentOut) {
        this.currentOut = currentOut;
    }


    public Collection<String> getReachableStates() {
        return reachableStates;
    }


    public void setReachableStates(Collection<String> reachableStates) {
        this.reachableStates = reachableStates;
    }


    public String getCurrentState() {
        return currentState;
    }


    public void setCurrentState(String currentState) {
        this.currentState = currentState;
    }

    public String getHash() {
        return this.hash;
    }


    public String getDescription() {
        return this.id;
    }


    public String getId() {
        return this.id;
    }


    public String getName() {
        return this.id;
    }


    public boolean isSelected() {
        return this.selected;
    }


    public void setSelected(boolean selected) {
        this.selected = selected;
    }


    public Collection<String> getInputParameter() {
        return this.inputParameter;
    }


    public void setInputParameter(Collection<String> inputParameter) {
        this.inputParameter = inputParameter;
    }


    public Map<String, OutputMode> getOutputModes() {
        return this.outputModes;
    }


    public Collection<OutputMode> getOutputModesAsCollection() {
        if (this.outputModes != null) {
            return this.outputModes.values();
        }
        return null;
    }


    public void setOutputModes(Map<String, OutputMode> outputModes) {
        this.outputModes = outputModes;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org