comparison artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java @ 32:c2d53bd30ab8

Re-factored artifact API for better integration of background processing. artifacts/trunk@78 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 13 Sep 2009 14:50:53 +0000
parents 13a12b607baf
children 41c225c8bd41
comparison
equal deleted inserted replaced
31:c4d85a8532d1 32:c2d53bd30ab8
1 package de.intevation.artifacts; 1 package de.intevation.artifacts;
2
3 import org.w3c.dom.Document;
4
5 import java.io.OutputStream;
6 import java.io.IOException;
2 7
3 /** 8 /**
4 * Interface of an artifact managing database. 9 * Interface of an artifact managing database.
5 * 10 *
6 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) 11 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
7 */ 12 */
8 public interface ArtifactDatabase 13 public interface ArtifactDatabase
9 { 14 {
15 public interface DeferredOutput {
16
17 void write(OutputStream output) throws IOException;
18
19 } // interface DeferredOut
20
10 /** 21 /**
11 * List of artifact factories names accessible through the database. 22 * List of artifact factories names accessible through the database.
12 * @return names of the factories. 23 * @return pairs of names and descriptions of the factories.
13 */ 24 */
14 String [] getArtifactFactoryNames(); 25 String [][] artifactFactoryNamesAndDescriptions();
15 26
16 /** 27 Document createArtifactWithFactory(String factory)
17 * Look up an artifact by its identifier. 28 throws ArtifactDatabaseException;
18 * @return the artifact. null if the artifact is not found.
19 */
20 Artifact getArtifact(String identifier);
21 29
22 /** 30 Document describe(String artifact)
23 * Creates new artifact with a certain factory. 31 throws ArtifactDatabaseException;
24 * @param factoryName the name of the factory. Name out of {@link #getArtifactFactoryNames() getArtifactFactoryNames()}.
25 */
26 Artifact createArtifactWithFactory(String factoryName);
27 32
33 Document advance(String artifact, Document target)
34 throws ArtifactDatabaseException;
28 35
29 /** 36 Document feed(String artifact, Document data)
30 * Returns the global artifact runtime context. 37 throws ArtifactDatabaseException;
31 * @return the runtime context 38
32 */ 39 DeferredOutput out(String artifact, Document format)
33 Object getArtifactContext(); 40 throws ArtifactDatabaseException;
41
34 } 42 }
35 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: 43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org