Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultArtifact.java @ 862:c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
flys-client/trunk@2669 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 07 Sep 2011 13:57:28 +0000 |
parents | 2c48d75c4ab7 |
children | d5fb88ba99d2 |
rev | line source |
---|---|
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 * The default implementation of an artifact that might be used in the client. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 * |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 */ |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 public class DefaultArtifact implements Artifact { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
11 /** The artifact's uuid. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 protected String uuid; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
14 /** The artifacts hash value. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 protected String hash; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
17 /** Determines if the artifact is in background mode.*/ |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
18 protected boolean inBackground; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
19 |
855
2c48d75c4ab7
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
227
diff
changeset
|
20 /** The current artifact description. */ |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 protected ArtifactDescription artifactDescription; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 * This constructor should not be used to create new instances of this |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 * class. An empty artifact without uuid and hash will be the result of |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 * this constructor call. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 */ |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 public DefaultArtifact() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
32 public DefaultArtifact(String uuid, String hash) { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
33 this(uuid, hash, false); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
34 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
35 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
36 |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 /** |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 * This constructor creates a new artifact instance with a uuid and a hash. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 * |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 * @param uuid The artifact's uuid. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * @param hash The artifact's hash. |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 */ |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
43 public DefaultArtifact(String uuid, String hash, boolean inBackground) { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
44 this.uuid = uuid; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
45 this.hash = hash; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
46 this.inBackground = inBackground; |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public String getUuid() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 return uuid; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 public String getHash() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 return hash; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
227
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
60 public String getName() { |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
61 return "default"; |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
62 } |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
63 |
7f7f6d2c4b2c
We can now distinuish between different artifact types based on its name in the DESCRIBE. The ArtifactCreator returns concrete instances of Artifacts now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
10
diff
changeset
|
64 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
65 public boolean isInBackground() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
66 return inBackground; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
67 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
68 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
855
diff
changeset
|
69 |
10
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 public ArtifactDescription getArtifactDescription() { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 return artifactDescription; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 public void setArtifactDescription(ArtifactDescription description) { |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 this.artifactDescription = description; |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
fc616c192902
Modified the Artifact interface and added a DefaultArtifact implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |