ingo@10: package de.intevation.flys.client.shared.model;
ingo@10:
ingo@870: import java.util.List;
ingo@870:
ingo@10:
ingo@10: /**
ingo@10: * The default implementation of an artifact that might be used in the client.
ingo@10: *
ingo@10: * @author Ingo Weinzierl
ingo@10: */
ingo@10: public class DefaultArtifact implements Artifact {
ingo@10:
felix@855: /** The artifact's uuid. */
ingo@10: protected String uuid;
ingo@10:
felix@855: /** The artifacts hash value. */
ingo@10: protected String hash;
ingo@10:
ingo@862: /** Determines if the artifact is in background mode.*/
ingo@862: protected boolean inBackground;
ingo@862:
ingo@870: protected List messages;
ingo@870:
felix@855: /** The current artifact description. */
ingo@10: protected ArtifactDescription artifactDescription;
ingo@10:
ingo@10: /**
ingo@10: * This constructor should not be used to create new instances of this
ingo@10: * class. An empty artifact without uuid and hash will be the result of
ingo@10: * this constructor call.
ingo@10: */
ingo@10: public DefaultArtifact() {
ingo@10: }
ingo@10:
ingo@10:
ingo@862: public DefaultArtifact(String uuid, String hash) {
ingo@870: this(uuid, hash, false, null);
ingo@862: }
ingo@862:
ingo@862:
ingo@10: /**
ingo@10: * This constructor creates a new artifact instance with a uuid and a hash.
ingo@10: *
ingo@10: * @param uuid The artifact's uuid.
ingo@10: * @param hash The artifact's hash.
ingo@10: */
ingo@870: public DefaultArtifact(
ingo@870: String uuid,
ingo@870: String hash,
ingo@870: boolean inBackground,
ingo@870: List messages
ingo@870: ) {
ingo@862: this.uuid = uuid;
ingo@862: this.hash = hash;
ingo@862: this.inBackground = inBackground;
ingo@870: this.messages = messages;
ingo@10: }
ingo@10:
ingo@10:
ingo@10: public String getUuid() {
ingo@10: return uuid;
ingo@10: }
ingo@10:
ingo@10:
ingo@10: public String getHash() {
ingo@10: return hash;
ingo@10: }
ingo@10:
ingo@10:
ingo@227: public String getName() {
ingo@227: return "default";
ingo@227: }
ingo@227:
ingo@227:
ingo@862: public boolean isInBackground() {
ingo@862: return inBackground;
ingo@862: }
ingo@862:
ingo@862:
ingo@870: public List getBackgroundMessages() {
ingo@870: return messages;
ingo@870: }
ingo@870:
ingo@870:
ingo@10: public ArtifactDescription getArtifactDescription() {
ingo@10: return artifactDescription;
ingo@10: }
ingo@10:
ingo@10:
ingo@10: public void setArtifactDescription(ArtifactDescription description) {
ingo@10: this.artifactDescription = description;
ingo@10: }
ingo@10: }
ingo@10: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :