annotate artifacts/src/main/java/org/dive4elements/artifacts/ArtifactCollectionFactory.java @ 475:415df0fc4fa1

Fixed maven group ids
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:23:04 +0200
parents 1a87cb24a446
children a1769b2f04c9
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 */
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 471
diff changeset
8 package org.dive4elements.artifacts;
115
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.
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 471
diff changeset
36 * @return a new {@linkplain org.dive4elements.artifacts.ArtifactCollection ArtifactCollection}
115
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(
233
16cd059945e5 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 174
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,
281
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
42 long ttl,
233
16cd059945e5 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 174
diff changeset
43 Document data,
159
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 120
diff changeset
44 Object context);
115
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 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 * 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
48 * @param config the configuration
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49 * @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
50 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 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
52
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
53 /**
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
54 * 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
55 * 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
56 * 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
57 * 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
58 * artifact is created.
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
59 * @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
60 * @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
61 * @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
62 */
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
63 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
64 }
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org