changeset 68:541814404822

Added interfaces for XML processing services. TODO: Implement them! artifacts/trunk@593 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 22 Jan 2010 09:48:18 +0000
parents ed03cc0e5800
children 498bb84334d0
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java artifacts/src/main/java/de/intevation/artifacts/Service.java artifacts/src/main/java/de/intevation/artifacts/ServiceFactory.java
diffstat 5 files changed, 66 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 17 14:00:06 2010 +0000
+++ b/ChangeLog	Fri Jan 22 09:48:18 2010 +0000
@@ -1,4 +1,21 @@
-2010-01-177	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+2010-01-17	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* artifacts/src/main/java/de/intevation/artifacts/Service.java: New.
+	  Interface to describe a service. It takes XML documents and produces
+	  XML documents.
+
+	* artifacts/src/main/java/de/intevation/artifacts/ServiceFactory.java:
+	  Factory to create services. Setup at startup.
+
+	* artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java:
+	  Added methods to describe the available services and call them.
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java:
+	  Implemented new ArtifactDatabase interface trivial. TODO:
+	  Setting it up from configuration, do the processing, register
+	  urls in REST server and so on.
+
+2010-01-17	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/XMLUtils.java:
 	  Added method 'toStream()' to copy a document into an output stream.
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Sun Jan 17 14:00:06 2010 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Fri Jan 22 09:48:18 2010 +0000
@@ -382,5 +382,13 @@
 
         return new DeferredOutputImpl(artifact, format, callMeta);
     }
+
+    public String [][] serviceNamesAndDescriptions() {
+        throw new IllegalArgumentException("Describing services is not implemented yet");
+    }
+
+    public Document process(String service, Document input, CallMeta callMeta) {
+        throw new IllegalArgumentException("Service processing is not implemented yet");
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
--- a/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java	Sun Jan 17 14:00:06 2010 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java	Fri Jan 22 09:48:18 2010 +0000
@@ -41,5 +41,9 @@
     DeferredOutput out(String artifact, Document format, CallMeta callMeta)
         throws ArtifactDatabaseException;
 
+    String [][] serviceNamesAndDescriptions();
+
+    Document process(String service, Document input, CallMeta callMeta);
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/Service.java	Fri Jan 22 09:48:18 2010 +0000
@@ -0,0 +1,15 @@
+package de.intevation.artifacts;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+
+/**
+ * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
+ */
+public interface Service
+extends          Serializable
+{
+    Document process(Document data, Object globalContext, CallMeta callMeta);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/ServiceFactory.java	Fri Jan 22 09:48:18 2010 +0000
@@ -0,0 +1,21 @@
+package de.intevation.artifacts;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+/**
+ * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
+ */
+public interface ServiceFactory
+extends         Serializable
+{
+    String getName();
+
+    String getDescription();
+
+    Service createService(Object globalContext);
+
+    void setup(Document config, Node factoryNode);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org