ingo@1022: /* ingo@1022: * Copyright (c) 2010 by Intevation GmbH ingo@1022: * ingo@1022: * This program is free software under the LGPL (>=v2.1) ingo@1022: * Read the file LGPL.txt coming with the software for details ingo@1022: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@1022: */ ingo@1022: tim@7: package de.intevation.gnv.artifactdatabase.objects; tim@9: tim@9: import java.util.Collection; tim@30: import java.util.Map; tim@9: tim@9: import org.w3c.dom.Node; tim@9: tim@7: /** ingo@690: * An ArtifactObject representing an artifact. sascha@699: * sascha@684: * @author Tim Englich sascha@681: * tim@7: */ tim@9: public class Artifact implements ArtifactObject, ArtifactDescription { tim@7: tim@165: tim@165: /** tim@165: * The UID of this Class tim@165: */ tim@165: private static final long serialVersionUID = 8606869493141810364L; sascha@681: tim@958: /** tim@958: * The uuid of this Artifact which must be used to identify tim@958: * the artifact at the ArtifactDatabase. tim@958: */ tim@7: private String id = null; tim@958: tim@958: /** tim@958: * The hash of the artifact which was send be the ArtifactDatabase. tim@958: */ tim@7: private String hash = null; tim@958: tim@958: /** tim@958: * Flag which marks if the Artifact is currently selected or not. tim@958: */ tim@7: private boolean selected = false; tim@36: tim@958: /** tim@958: * The XML-Node of the current User-Interface tim@958: */ tim@9: private Node currentUI = null; tim@958: tim@958: /** tim@958: * The XML-Nodes of the OutputModes. tim@958: */ tim@9: private Node currentOut = null; tim@36: tim@958: /** tim@958: * The ids of the states which could be reached. tim@958: */ tim@9: private Collection reachableStates; tim@958: tim@958: /** tim@958: * The parameters whcih could be feed to the artifact at the current state. tim@958: */ tim@12: private Collection inputParameter; tim@958: tim@958: /** tim@958: * The OutputModes that could be reached at the current state. tim@958: */ tim@36: private Map outputModes; tim@958: tim@958: /** tim@958: * The id of the state which is currently used. tim@958: */ tim@9: private String currentState = null; tim@36: tim@958: /** tim@958: * Constructor tim@958: * @param uuid the uuid of this Artifact which must be used to identify tim@958: * the artifact at the ArtifactDatabase tim@958: * @param hash the hash of the artifact which was send be the tim@958: * ArtifactDatabase tim@958: */ tim@958: public Artifact(String uuid, String hash) { tim@958: this.id = uuid; tim@958: this.hash = hash; tim@958: } ingo@690: tim@9: public Node getCurrentUI() { tim@9: return currentUI; tim@9: } tim@9: ingo@690: tim@9: public void setCurrentUI(Node currentUI) { tim@9: this.currentUI = currentUI; tim@9: } tim@9: ingo@690: tim@9: public Node getCurrentOut() { tim@9: return currentOut; tim@9: } tim@9: ingo@690: tim@9: public void setCurrentOut(Node currentOut) { tim@9: this.currentOut = currentOut; tim@9: } tim@9: ingo@690: tim@9: public Collection getReachableStates() { tim@9: return reachableStates; tim@9: } tim@9: ingo@690: tim@9: public void setReachableStates(Collection reachableStates) { tim@9: this.reachableStates = reachableStates; tim@9: } tim@9: ingo@690: tim@9: public String getCurrentState() { tim@9: return currentState; tim@9: } tim@9: ingo@690: tim@9: public void setCurrentState(String currentState) { tim@9: this.currentState = currentState; tim@9: } tim@9: tim@7: public String getHash() { tim@7: return this.hash; tim@7: } tim@7: ingo@690: tim@7: public String getDescription() { tim@7: return this.id; tim@7: } tim@7: ingo@690: tim@7: public String getId() { tim@7: return this.id; tim@7: } tim@7: ingo@690: tim@7: public String getName() { tim@7: return this.id; tim@7: } tim@7: ingo@690: tim@7: public boolean isSelected() { tim@7: return this.selected; tim@7: } tim@7: ingo@690: tim@7: public void setSelected(boolean selected) { tim@7: this.selected = selected; tim@7: } tim@7: ingo@690: tim@12: public Collection getInputParameter() { tim@12: return this.inputParameter; tim@12: } tim@12: ingo@690: tim@12: public void setInputParameter(Collection inputParameter) { tim@12: this.inputParameter = inputParameter; tim@12: } tim@12: ingo@690: tim@30: public Map getOutputModes() { tim@30: return this.outputModes; tim@30: } tim@36: ingo@690: tim@30: public Collection getOutputModesAsCollection() { tim@36: if (this.outputModes != null) { tim@30: return this.outputModes.values(); tim@30: } tim@30: return null; tim@30: } tim@30: ingo@690: tim@30: public void setOutputModes(Map outputModes) { tim@30: this.outputModes = outputModes; tim@30: } tim@7: } sascha@700: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :