Mercurial > dive4elements > framework
diff 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 |
line wrap: on
line diff
--- a/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java Sat Sep 12 10:45:28 2009 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java Sun Sep 13 14:50:53 2009 +0000 @@ -1,5 +1,10 @@ package de.intevation.artifacts; +import org.w3c.dom.Document; + +import java.io.OutputStream; +import java.io.IOException; + /** * Interface of an artifact managing database. * @@ -7,29 +12,32 @@ */ public interface ArtifactDatabase { - /** - * List of artifact factories names accessible through the database. - * @return names of the factories. - */ - String [] getArtifactFactoryNames(); + public interface DeferredOutput { - /** - * Look up an artifact by its identifier. - * @return the artifact. null if the artifact is not found. - */ - Artifact getArtifact(String identifier); + void write(OutputStream output) throws IOException; + + } // interface DeferredOut /** - * Creates new artifact with a certain factory. - * @param factoryName the name of the factory. Name out of {@link #getArtifactFactoryNames() getArtifactFactoryNames()}. + * List of artifact factories names accessible through the database. + * @return pairs of names and descriptions of the factories. */ - Artifact createArtifactWithFactory(String factoryName); + String [][] artifactFactoryNamesAndDescriptions(); + Document createArtifactWithFactory(String factory) + throws ArtifactDatabaseException; - /** - * Returns the global artifact runtime context. - * @return the runtime context - */ - Object getArtifactContext(); + Document describe(String artifact) + throws ArtifactDatabaseException; + + Document advance(String artifact, Document target) + throws ArtifactDatabaseException; + + Document feed(String artifact, Document data) + throws ArtifactDatabaseException; + + DeferredOutput out(String artifact, Document format) + throws ArtifactDatabaseException; + } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: