Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollection.java @ 153:bf596b83d984
Adjusted method signatures for deleting users in the UserFactory and in the Backend.
artifacts/trunk@1378 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 03 Mar 2011 08:51:02 +0000 |
parents | 3bb121d5b0b7 |
children | db0d20440b92 |
rev | line source |
---|---|
119
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 /* |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.artifactdatabase; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import java.io.IOException; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.io.OutputStream; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import java.util.ArrayList; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import java.util.Date; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import java.util.HashMap; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import java.util.List; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import java.util.Map; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import org.apache.log4j.Logger; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import org.w3c.dom.Document; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.artifacts.Artifact; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.artifacts.ArtifactCollection; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.artifacts.ArtifactCollectionFactory; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import de.intevation.artifacts.CallContext; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 import de.intevation.artifacts.User; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * Trivial implementation of an artifact collection. Useful to be subclassed. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 public class DefaultArtifactCollection |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 implements ArtifactCollection |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 /** The logger used in this class.*/ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 private static Logger logger = |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 Logger.getLogger(DefaultArtifactCollection.class); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * The identifier of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 protected String identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * The owner of this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 protected User user; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 * The artifacts stored in this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 protected List<Artifact> artifacts; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 * The attributes used for the artifacts stored in this collection. The key |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 * of this map represents the identifier of the artifact which the attribute |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 * belong to. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 protected Map<String, Document> attributes; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 /** The creation time of this collection.*/ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 protected Date creationTime; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 * Default constructor. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 public DefaultArtifactCollection() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 * When created by a factory this method is called to |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 * initialize the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 * @param identifier The identifier from collection database |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 * @param factory The factory which created this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 * @param context The global context of the runtime system. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 * @param data The data which can be use to setup a collection with |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 * more details. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 public void setup( |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 String identifier, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 ArtifactCollectionFactory factory, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 Object context, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 Document data) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 logger.debug("DefaultArtifactCollection.setup: " + identifier); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 artifacts = new ArrayList<Artifact>(); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 attributes = new HashMap<String, Document>(); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 setIdentifier(identifier); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 * Set a new identifier for this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 * @param identifier New identifier for this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 public void setIdentifier(String identifier) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 this.identifier = identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 * Identify this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 * @return Returns unique string to identify this collection globally. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 public String identifier() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 return identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 * Set a new owner of this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 * @param user New owner for this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 public void setUser(User user) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 this.user = user; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 * Identify the owner of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 * @return Returns owner of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 public User getUser() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 return user; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 * Returns the creation time of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 * @return the creation time of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 public Date getCreationTime() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 return creationTime; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 * Sets the creation time of the collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 * @param creationTime The new creation time. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 public void setCreationTime(Date creationTime) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 this.creationTime = creationTime; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 * Called from artifact database when an artifact is |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 * going to be removed from system. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 * @param context The global context of the runtime system. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 public void endOfLife(Object context) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 logger.debug("DefaultArtifactCollection.endOfLife"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 * Internal hash of this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 * @return Returns hash that should stay the same if the internal |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 * value has not changed. Useful for caching |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 public String hash() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 logger.debug("DefaultArtifactCollection.hash"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 return String.valueOf(hashCode()); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 * Called from artifact database before an artifact is |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 * going to be exported as xml document. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 * @param context The global context of the runtime system. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 public void cleanup(Object context) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 logger.debug("DefaultArtifactCollection.cleanup"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 * Adds a new artifact to this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 * @param artifact The new artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 * @param attribute The attributes used for this artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 * @param context The CallContext. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 public void addArtifact( |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 Artifact artifact, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 Document attribute, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 CallContext context) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 logger.debug("DefaultArtifactCollection.addArtifact"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 artifacts.add(artifact); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 attributes.put(artifact.identifier(), attribute); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 * Removes the given artifact from this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 * @param artifact The artifact that should be removed. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 * @param context The CallContext. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 public void removeArtifact(Artifact artifact, CallContext context) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 logger.debug("DefaultArtifactCollection.removeArtifact"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 if (artifact == null) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 return; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 artifacts.remove(artifact); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 attributes.remove(artifact.identifier()); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 * Returns a list of artifacts that are stored in this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 * @param context The CallContext. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 * @return the list of artifacts stored in this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 public Artifact[] getArtifacts(CallContext context) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 logger.debug("DefaultArtifactCollection.getArtifacts"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 return (Artifact[]) artifacts.toArray(); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 * Returns the attribute document for the given artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 * @param artifact The artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 * @param context The CallContext. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
241 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 * @return a document that contains the attributes of the artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 public Document getAttribute(Artifact artifact, CallContext context) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 logger.debug("DefaultArtifactCollection.getAttribute"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 return attributes.get(artifact.identifier()); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 * Set the attribute for the given artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 * @param artifact The artifact of the attribute. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 * @param document The new attribute of the artifact. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 * @param context The CallContext. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 public void setAttribute( |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 Artifact artifact, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 Document document, |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 CallContext context) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 logger.debug("DefaultArtifactCollection.setAttribute"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
265 attributes.put(artifact.identifier(), document); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
266 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
267 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
268 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
269 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
270 * Produce output for this collection. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 * @param format Specifies the format of the output. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 * @param out Stream to write the result data to. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 * @param context The global context of the runtime system. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 * @throws IOException Thrown if an I/O occurs. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 public void out(Document format, OutputStream out, CallContext context) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
277 throws IOException |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 logger.debug("DefaultArtifactCollection.out"); |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
281 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |