Mercurial > dive4elements > framework
annotate artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java @ 243:33b9cc23ac9b
Granularity of ttls should be milliseconds and not microseconds.
artifacts/trunk@1678 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 13 Apr 2011 15:19:59 +0000 |
parents | 171b6200d26d |
children | 6de74b0b878e |
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 |
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:
70
diff
changeset
|
11 import java.io.IOException; |
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:
70
diff
changeset
|
12 import java.io.OutputStream; |
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:
70
diff
changeset
|
13 |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
14 import org.w3c.dom.Document; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
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 managing database. |
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 */ |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 public interface ArtifactDatabase |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 { |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
23 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
24 * Implementations of this class defer the out call. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
25 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
26 public interface DeferredOutput { |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
28 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
29 * Inside this method the Artifact.out() method is called |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
30 * with the given Outputstream. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
31 * @param output The stream to write the out() output into. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
32 * @throws IOException Thrown if an exception occurs while writing to |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
33 * the output stream. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
34 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
35 void write(OutputStream output) throws IOException; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
36 |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
37 } // interface DeferredOut |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 |
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 /** |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
40 * List of artifact factories names accessible through the database. |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
41 * @return pairs of names and descriptions of the factories. |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
43 String [][] artifactFactoryNamesAndDescriptions(); |
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 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
45 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
46 * The methods returns a 'pure' factory which is not bound to |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
47 * the artifact database. This means when an artifact is created |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
48 * with the factory the created artifact is not stored in the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
49 * artifact database. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
50 * @param factoryName The name of the queried artifact factory. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
51 * @return The queried artifact factory or null if corresponing |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
52 * factory is found. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
53 */ |
66
89e3de0ee05f
Implemented some methods to get access to ArtifactFactories which are stored in the ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
55
diff
changeset
|
54 ArtifactFactory getInternalArtifactFactory(String factoryName); |
89e3de0ee05f
Implemented some methods to get access to ArtifactFactories which are stored in the ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
55
diff
changeset
|
55 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
56 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
57 * Used to create an artifact with the factory which given |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
58 * by the name 'factory'. The artifact is stored inside the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
59 * artifact database. If the creation succeeds the describe |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
60 * document of the artifact is returned. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
61 * @param factory The name of the factory to create the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
62 * @param callMeta The meta information (languages et. al.) of the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
63 * creation. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
64 * @param data Optional input data to parameterize the creation. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
65 * @return The describe document of new artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
66 * @throws ArtifactDatabaseException Thrown if something went wrong |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
67 * during artifact creation. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
68 */ |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
69 Document createArtifactWithFactory( |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
70 String factory, |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
71 CallMeta callMeta, |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
72 Document data |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
73 ) throws ArtifactDatabaseException; |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
74 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
75 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
76 * Returns the describe document of artifact identified |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
77 * with the string 'artifact'. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
78 * @param artifact The identifier of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
79 * @param data Optional input data to parameterize the description. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
80 * @param callMeta the meta information (language et. al.) of |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
81 * the description. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
82 * @return The describe document of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
83 * @throws ArtifactDatabaseException Thrown id something went wrong |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
84 * during the creation of the describe document. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
85 */ |
55
9a29899b31e5
describe() in REST interface is also handled as POST to pass
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
48
diff
changeset
|
86 Document describe(String artifact, Document data, CallMeta callMeta) |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
87 throws ArtifactDatabaseException; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
88 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
89 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
90 * Advances the artifact identified by 'artifact' to the state |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
91 * 'target'. The result of the attempt is returned. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
92 * @param artifact The identifier of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
93 * @param target The target state of the advance attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
94 * @param callMeta The meta information (language et. al.) of the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
95 * advance attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
96 * @return The result document of the advance attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
97 * @throws ArtifactDatabaseException Thrown if something went wrong |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
98 * during the advance attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
99 */ |
48
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
100 Document advance(String artifact, Document target, CallMeta callMeta) |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
101 throws ArtifactDatabaseException; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
102 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
103 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
104 * Feeds the artifact identified by 'artifact' with some data 'data'. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
105 * @param artifact The identifier of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
106 * @param data The data to be fed into the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
107 * @param callMeta The meta information (language et. al.) of the feed |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
108 * attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
109 * @return The result of the feed attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
110 * @throws ArtifactDatabaseException Throw if something went wrong during |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
111 * the feed attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
112 */ |
48
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
113 Document feed(String artifact, Document data, CallMeta callMeta) |
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
114 throws ArtifactDatabaseException; |
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
115 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
116 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
117 * Produces output for a given artifact identified by 'artifact' in |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
118 * a requested format 'format'. The writing of the data is done when |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
119 * the write() method of the returned DeferredOutput is called. This |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
120 * optimizes the out streaming of the data because the call can be |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
121 * deferred into to the calling context. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
122 * @param artifact The identifier of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
123 * @param format The request format of the output. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
124 * @param callMeta The meta information (language et. al.) of the output. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
125 * @return The deferred output to be written later in the calling context. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
126 * @throws ArtifactDatabaseException Thrown if something went wrong during |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
127 * producing the output. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
128 */ |
48
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
129 DeferredOutput out(String artifact, Document format, CallMeta callMeta) |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
130 throws ArtifactDatabaseException; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4
diff
changeset
|
131 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
132 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
133 * Produces an extenal represention of the artifact identified by |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
134 * 'artifact' to be re-imported by #importArtifact(Document, CallMeta) |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
135 * later. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
136 * @param artifact The identifier of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
137 * @param callMeta The meta informatio (language et. al.) of the export. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
138 * @return A extenal representation of the artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
139 * @throws ArtifactDatabaseException Thrown if something went wrong |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
140 * during export. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
141 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
142 Document exportArtifact(String artifact, CallMeta callMeta) |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
143 throws ArtifactDatabaseException; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
144 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
145 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
146 * The symmetrical counter part of #exportArtifact(String, CallMeta). |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
147 * It attempts to import the artifact which is coded inside the 'data' |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
148 * document. When the import succeeds the new artifact is given a new |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
149 * internal identifier and the describe document of the artifact is |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
150 * returned. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
151 * @param data The encoded artifact. Has to be the output of |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
152 * #exportArtifact(String, CallMeta). |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
153 * @param callMeta The meta information (language et. al.) of the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
154 * import. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
155 * @return The describe document of the imported artifact. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
156 * @throws ArtifactDatabaseException Thrown if something went wrong during |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
157 * the import attempt. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
158 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
159 Document importArtifact(Document data, CallMeta callMeta) |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
160 throws ArtifactDatabaseException; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
161 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
162 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
163 * Returns a list of services offered by this artifact database. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
164 * @return The array returned contains tuples of (name, description) |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
165 * strings. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
166 */ |
68
541814404822
Added interfaces for XML processing services. TODO: Implement them!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
167 String [][] serviceNamesAndDescriptions(); |
541814404822
Added interfaces for XML processing services. TODO: Implement them!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
168 |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
169 /** |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
170 * Calls a service identified by 'service' with input document 'input' |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
171 * to produce some output document. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
172 * @param service The name of the service. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
173 * @param input The input document. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
174 * @param callMeta The meta information (language et. al.) of the |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
175 * service call. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
176 * @return The result document produced by the service. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
177 * @throws ArtifactDatabaseException Thrown if someting went wrong during |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
178 * the service processing. |
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
179 */ |
70
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
68
diff
changeset
|
180 Document process(String service, Document input, CallMeta callMeta) |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
68
diff
changeset
|
181 throws ArtifactDatabaseException; |
117
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
182 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
183 // User API |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
184 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
185 Document listUsers(CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
186 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
187 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
188 Document createUser(Document data, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
189 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
190 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
191 Document deleteUser(String userId, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
192 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
193 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
194 // Collection API |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
195 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
196 Document listCollections(String userId, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
197 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
198 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
199 Document createCollection(String ownerId, Document data, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
200 CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
201 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
202 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
203 Document deleteCollection(String collectionId, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
204 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
205 |
196
171b6200d26d
Added a describe() action for collections - the implementation in the artifact server is currently just a stub that throws an not implemented exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
189
diff
changeset
|
206 Document describeCollection(String collectionId, CallMeta callMeta) |
171b6200d26d
Added a describe() action for collections - the implementation in the artifact server is currently just a stub that throws an not implemented exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
189
diff
changeset
|
207 throws ArtifactDatabaseException; |
171b6200d26d
Added a describe() action for collections - the implementation in the artifact server is currently just a stub that throws an not implemented exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
189
diff
changeset
|
208 |
117
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
209 Document getCollectionAttribute(String collectionId, String artifactId, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
210 CallMeta callMeta) throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
211 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
212 Document setCollectionAttribute(String collectionId, String artifactId, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
213 Document attribute, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
214 throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
215 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
216 Document addCollectionArtifact(String collectionId, String artifactId, |
189
fbaeb5931d10
Implemented addCollectionArtifact() and listCollectionArtifacts() of the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
132
diff
changeset
|
217 Document input, CallMeta callMeta) throws ArtifactDatabaseException; |
117
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
218 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
219 Document removeCollectionArtifact(String collectionId, String artifactId, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
220 CallMeta callMeta) throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
221 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
222 Document listCollectionArtifacts(String collectionId, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
223 CallMeta callMeta) throws ArtifactDatabaseException; |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
224 |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
225 DeferredOutput outCollection(String collectionId, |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
226 Document format, CallMeta callMeta) |
4d725248f8d1
Added external API for users and collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
227 throws ArtifactDatabaseException; |
1
11c82d3f125e
Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
228 } |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
229 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |