comparison artifacts/src/main/java/org/dive4elements/artifacts/ArtifactCollectionFactory.java @ 471:1a87cb24a446

Moved directories to org.dive4elements
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 10:50:31 +0200
parents artifacts/src/main/java/de/intevation/artifacts/ArtifactCollectionFactory.java@942a54670a72
children 415df0fc4fa1
comparison
equal deleted inserted replaced
470:19cb9729bd17 471:1a87cb24a446
1 /*
2 * Copyright (c) 2011 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8 package de.intevation.artifacts;
9
10 import java.util.Date;
11
12 import org.w3c.dom.Document;
13 import org.w3c.dom.Node;
14
15
16 public interface ArtifactCollectionFactory
17 {
18 /**
19 * The short name of this factory.
20 * @return the name of this factory.
21 */
22 String getName();
23
24 /**
25 * Description of this factory.
26 * @return description of the factory.
27 */
28 String getDescription();
29
30 /**
31 * Create a new artifact of certain type, given a general purpose context and
32 * an identifier.
33 * @param context a context from the ArtifactDatabase.
34 * @param identifier unique identifer for the new artifact
35 * @param data the data containing more details for the setup of an Artifact.
36 * @return a new {@linkplain de.intevation.artifacts.ArtifactCollection ArtifactCollection}
37 */
38 ArtifactCollection createCollection(
39 String identifier,
40 String name,
41 Date creationTime,
42 long ttl,
43 Document data,
44 Object context);
45
46 /**
47 * Setup the factory with a given configuration
48 * @param config the configuration
49 * @param factoryNode the ConfigurationNode of this Factory
50 */
51 void setup(Document config, Node factoryNode);
52
53 /**
54 * Tells how long a collection should survive if it is
55 * not touched. This is put in the factory because
56 * life time is nothing a collection should handle it self.
57 * This method is only called once directly after the
58 * artifact is created.
59 * @param artifact The artifact to be rated.
60 * @param context The global context.
61 * @return time to live in ms. null means eternal.
62 */
63 Long timeToLiveUntouched(ArtifactCollection collection, Object context);
64 }
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org