Mercurial > dive4elements > framework
annotate artifacts/src/main/java/de/intevation/artifacts/ArtifactCollectionFactory.java @ 178:535e4ea2ef9b
Added code to get the attribute of a collection item
artifacts/trunk@1404 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 06 Mar 2011 10:27:16 +0000 |
parents | 25d472a67a9f |
children | 16cd059945e5 |
rev | line source |
---|---|
115
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 /* |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.artifacts; |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 |
170
ac0f8bd97277
Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
159
diff
changeset
|
10 import java.util.Date; |
ac0f8bd97277
Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
159
diff
changeset
|
11 |
115
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import org.w3c.dom.Document; |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import org.w3c.dom.Node; |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
170
ac0f8bd97277
Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
159
diff
changeset
|
15 |
115
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public interface ArtifactCollectionFactory |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 { |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 /** |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 * The short name of this factory. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 * @return the name of this factory. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 */ |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 String getName(); |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 /** |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 * Description of this factory. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 * @return description of the factory. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 */ |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 String getDescription(); |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 /** |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 * Create a new artifact of certain type, given a general purpose context and |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 * an identifier. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 * @param context a context from the ArtifactDatabase. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 * @param identifier unique identifer for the new artifact |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 * @param data the data containing more details for the setup of an Artifact. |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 * @return a new {@linkplain de.intevation.artifacts.ArtifactCollection ArtifactCollection} |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 */ |
159
db0d20440b92
Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
120
diff
changeset
|
38 ArtifactCollection createCollection( |
db0d20440b92
Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
120
diff
changeset
|
39 String identifier, |
170
ac0f8bd97277
Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
159
diff
changeset
|
40 String name, |
ac0f8bd97277
Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
159
diff
changeset
|
41 Date creationTime, |
159
db0d20440b92
Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
120
diff
changeset
|
42 Document data, |
db0d20440b92
Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
120
diff
changeset
|
43 Object context); |
115
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 /** |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 * Setup the factory with a given configuration |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 * @param config the configuration |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 * @param factoryNode the ConfigurationNode of this Factory |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 */ |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 void setup(Document config, Node factoryNode); |
120
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
51 |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
52 /** |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
53 * Tells how long a collection should survive if it is |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
54 * not touched. This is put in the factory because |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
55 * life time is nothing a collection should handle it self. |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
56 * This method is only called once directly after the |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
57 * artifact is created. |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
58 * @param artifact The artifact to be rated. |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
59 * @param context The global context. |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
60 * @return time to live in ms. null means eternal. |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
61 */ |
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
115
diff
changeset
|
62 Long timeToLiveUntouched(ArtifactCollection collection, Object context); |
115
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 } |
a1200c6ed048
Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |