Mercurial > dive4elements > framework
annotate artifacts/src/main/java/de/intevation/artifacts/ArtifactFactory.java @ 270:89f6de49803d
Modified the method to create the document to trigger the out() operation of a collection in ClientProtocolUtils.
artifacts/trunk@2046 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 03 Jun 2011 06:37:23 +0000 |
parents | c030895edfcb |
children | a367a0d011af |
rev | line source |
---|---|
100
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
1 /* |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
3 * |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
7 */ |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
85
diff
changeset
|
8 |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.artifacts; |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
33
251e8904d6c2
Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents:
10
diff
changeset
|
11 import java.io.Serializable; |
251e8904d6c2
Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents:
10
diff
changeset
|
12 |
4
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
13 import org.w3c.dom.Document; |
7
f95d9a449215
Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents:
4
diff
changeset
|
14 import org.w3c.dom.Node; |
4
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
15 |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 /** |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 * Interface of an artifact producing factory. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 * |
77
48d1a9a082c2
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
75
diff
changeset
|
19 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 */ |
33
251e8904d6c2
Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents:
10
diff
changeset
|
21 public interface ArtifactFactory extends Serializable |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 { |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 /** |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 * The short name of this factory. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 * @return the name of this factory. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 */ |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 String getName(); |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 /** |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 * Description of this factory. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 * @return description of the factory. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 */ |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 String getDescription(); |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 /** |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 * Create a new artifact of certain type, given a general purpose context and |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 * an identifier. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 * @param context a context from the ArtifactDatabase. |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 * @param identifier unique identifer for the new artifact |
75
d4c4c23847f5
Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents:
41
diff
changeset
|
40 * @param data the data containing more details for the setup of an Artifact. |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 * @return a new {@linkplain de.intevation.artifacts.Artifact Artifact} |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 */ |
75
d4c4c23847f5
Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents:
41
diff
changeset
|
43 Artifact createArtifact(String identifier, Object context, Document data); |
4
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
44 |
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
45 /** |
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
46 * Setup the factory with a given configuration |
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
47 * @param config the configuration |
7
f95d9a449215
Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents:
4
diff
changeset
|
48 * @param factoryNode the ConfigurationNode of this Factory |
4
13a12b607baf
Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1
diff
changeset
|
49 */ |
7
f95d9a449215
Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents:
4
diff
changeset
|
50 void setup(Document config, Node factoryNode); |
10
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
51 |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
52 /** |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
53 * Tells how long an artifact should survive if it is |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
54 * not touched. This is put in the factory because |
120
c030895edfcb
Added method to figure out TTL of a collection.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
55 * life time is nothing an artifact should handle it self. |
10
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
56 * This method is only called once directly after the |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
57 * artifact is created. |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
58 * @param artifact The artifact to be rated. |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
59 * @param context The global context. |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
77
diff
changeset
|
60 * @return time to live in ms. null means eternal. |
10
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
61 */ |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
62 Long timeToLiveUntouched(Artifact artifact, Object context); |
41
5e4bc24ea438
Made serilization more flexible. DB update required!!!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
33
diff
changeset
|
63 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
77
diff
changeset
|
64 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
77
diff
changeset
|
65 * Returns the serializer used to store the artifacts. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
77
diff
changeset
|
66 * @return The Serializer |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
77
diff
changeset
|
67 */ |
41
5e4bc24ea438
Made serilization more flexible. DB update required!!!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
33
diff
changeset
|
68 ArtifactSerializer getSerializer(); |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 } |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
78
diff
changeset
|
70 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |