annotate artifacts/src/main/java/org/dive4elements/artifacts/ArtifactCollectionFactory.java @ 565:8d11d6a17f3b

Mit 3.2.x zusammenführen
author Gernot Belger <g.belger@bjoernsen.de>
date Wed, 15 Jul 2020 11:53:27 +0200
parents a1769b2f04c9
children
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
504
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 475
diff changeset
16 /** Create ArtifactCollections. */
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17 public interface ArtifactCollectionFactory
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 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 * 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
21 * @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
22 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 String getName();
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 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 * Description of this factory.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 * @return description of the factory.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 String getDescription();
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 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 * 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
33 * an identifier.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 * @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
35 * @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
36 * @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
37 * @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
38 */
159
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 120
diff changeset
39 ArtifactCollection createCollection(
233
16cd059945e5 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 174
diff changeset
40 String identifier,
170
ac0f8bd97277 Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 159
diff changeset
41 String name,
ac0f8bd97277 Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 159
diff changeset
42 Date creationTime,
281
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
43 long ttl,
233
16cd059945e5 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 174
diff changeset
44 Document data,
159
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 120
diff changeset
45 Object context);
115
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 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 * 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
49 * @param config the configuration
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 * @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
51 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52 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
53
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
54 /**
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
55 * 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
56 * 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
57 * 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
58 * 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
59 * artifact is created.
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
60 * @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
61 * @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
62 * @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
63 */
c030895edfcb Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
64 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
65 }
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org