Mercurial > dive4elements > framework
comparison artifacts/src/main/java/org/dive4elements/artifacts/ArtifactFactory.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/ArtifactFactory.java@ab3900303f25 |
children | 415df0fc4fa1 |
comparison
equal
deleted
inserted
replaced
470:19cb9729bd17 | 471:1a87cb24a446 |
---|---|
1 /* | |
2 * Copyright (c) 2010 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 | |
9 package de.intevation.artifacts; | |
10 | |
11 import java.io.Serializable; | |
12 | |
13 import org.w3c.dom.Document; | |
14 import org.w3c.dom.Node; | |
15 | |
16 | |
17 /** | |
18 * Interface of an artifact producing factory. | |
19 * | |
20 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
21 */ | |
22 public interface ArtifactFactory extends Serializable | |
23 { | |
24 /** | |
25 * The short name of this factory. | |
26 * @return the name of this factory. | |
27 */ | |
28 String getName(); | |
29 | |
30 /** | |
31 * Description of this factory. | |
32 * @return description of the factory. | |
33 */ | |
34 String getDescription(); | |
35 | |
36 /** | |
37 * Create a new artifact of certain type, given a general purpose context and | |
38 * an identifier. | |
39 * @param context a context from the ArtifactDatabase. | |
40 * @param identifier unique identifer for the new artifact | |
41 * @param data the data containing more details for the setup of an Artifact. | |
42 * @return a new {@linkplain de.intevation.artifacts.Artifact Artifact} | |
43 */ | |
44 Artifact createArtifact( | |
45 String identifier, | |
46 GlobalContext context, | |
47 CallMeta callMeta, | |
48 Document data); | |
49 | |
50 /** | |
51 * Setup the factory with a given configuration | |
52 * @param config the configuration | |
53 * @param factoryNode the ConfigurationNode of this Factory | |
54 */ | |
55 void setup(Document config, Node factoryNode); | |
56 | |
57 /** | |
58 * Tells how long an artifact should survive if it is | |
59 * not touched. This is put in the factory because | |
60 * life time is nothing an artifact should handle it self. | |
61 * This method is only called once directly after the | |
62 * artifact is created. | |
63 * @param artifact The artifact to be rated. | |
64 * @param context The global context. | |
65 * @return time to live in ms. null means eternal. | |
66 */ | |
67 Long timeToLiveUntouched(Artifact artifact, Object context); | |
68 | |
69 /** | |
70 * Returns the serializer used to store the artifacts. | |
71 * @return The Serializer | |
72 */ | |
73 ArtifactSerializer getSerializer(); | |
74 } | |
75 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |