changeset 44:f5e9a9b93ccb

dummy merge for repo head
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:15:15 +0200
parents 04b2df3d5484 (diff) 863c7301b7f5 (current diff)
children a3e87eb441be
files
diffstat 7 files changed, 94 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Sep 19 14:38:23 2011 +0000
+++ b/ChangeLog	Fri Sep 28 12:15:15 2012 +0200
@@ -1,3 +1,48 @@
+2012-09-17  Ingo Weinzierl <ingo@intevation.de>
+
+	Taggd RELEASE 2.9.1
+
+2012-09-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* pom.xml: Java 1.5 -> 1.6
+
+2012-09-07  Ingo Weinzierl <ingo@intevation.de>
+
+	Taggd RELEASE 2.9
+
+2012-08-24	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java,
+	  src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java:
+	  Added new method findUser. With the new method it is possible to get a
+	  user document by an account name.
+
+2012-07-27  Ingo Weinzierl <ingo@intevation.de>
+
+	Taggd RELEASE 2.8.1
+
+2012-07-16  Ingo Weinzierl <ingo@intevation.de>
+
+	Taggd RELEASE 2.8
+
+2012-07-13	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java
+	  src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java:
+	  Implemented a createUser method for HttpClient.
+	  With the new method its possible to create new users via the HttpClient.
+
+2012-04-16	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/artifacts/httpclient/http/response/StringResponseHandler.java,
+	  src/main/java/de/intevation/artifacts/httpclient/http/response/StreamResponseHandler.java,
+	  src/main/java/de/intevation/artifacts/httpclient/http/response/DocumentResponseHandler.java:
+	  Added Override annotations.
+
+2011-09-19  Ingo Weinzierl <ingo@intevation.de>
+
+	Tagged pre2.7-2012-03-16
+
 2011-09-19  Ingo Weinzierl <ingo@intevation.de>
 
 	Taggd RELEASE 0.5
--- a/pom.xml	Mon Sep 19 14:38:23 2011 +0000
+++ b/pom.xml	Fri Sep 28 12:15:15 2012 +0200
@@ -21,8 +21,8 @@
         <artifactId>maven-compiler-plugin</artifactId>
         <version>2.0.2</version>
         <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
+          <source>1.6</source>
+          <target>1.6</target>
         </configuration>
       </plugin>
     </plugins>
--- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java	Mon Sep 19 14:38:23 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java	Fri Sep 28 12:15:15 2012 +0200
@@ -106,5 +106,11 @@
 
     Document listUserCollections(String userid)
     throws ConnectionException;
+
+    Document createUser(Document doc)
+    throws ConnectionException;
+
+    Document findUser(Document doc)
+    throws ConnectionException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
--- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java	Mon Sep 19 14:38:23 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java	Fri Sep 28 12:15:15 2012 +0200
@@ -54,6 +54,12 @@
      * user.*/
     public static final String PATH_USER_COLLECTIONS = "/list-collections";
 
+    /** The URL part og the resource to create a new user on the server.*/
+    public static final String PATH_CREATE_USER = "/create-user";
+
+    /** The URL part og the resource to find an existing user on the server.*/
+    public static final String PATH_FIND_USER = "/find-user";
+
     /** The URL part of the resource to call a specific service.*/
     public static final String PATH_SERVICE = "/service";
 
@@ -535,5 +541,37 @@
             throw new ConnectionException(ioe.getMessage(), ioe);
         }
     }
+
+    @Override
+    public Document createUser(Document doc)
+    throws ConnectionException {
+        ResponseHandler handler = new DocumentResponseHandler();
+
+        String url = this.serverUrl + PATH_CREATE_USER;
+
+        try {
+            return (Document) handler.handle(doPost(url, doc));
+        }
+        catch (IOException ioe) {
+            throw new ConnectionException(
+                "Connection to server failed: " + ioe.getMessage());
+        }
+    }
+
+    @Override
+    public Document findUser(Document doc)
+    throws ConnectionException {
+        ResponseHandler handler = new DocumentResponseHandler();
+
+        String url = this.serverUrl + PATH_FIND_USER;
+
+        try {
+            return (Document) handler.handle(doPost(url, doc));
+        }
+        catch (IOException ioe) {
+            throw new ConnectionException(
+                "Connection to server failed: " + ioe.getMessage());
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
--- a/src/main/java/de/intevation/artifacts/httpclient/http/response/DocumentResponseHandler.java	Mon Sep 19 14:38:23 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/response/DocumentResponseHandler.java	Fri Sep 28 12:15:15 2012 +0200
@@ -23,6 +23,7 @@
     public DocumentResponseHandler() {
     }
 
+    @Override
     public Object handle(Response response) throws IOException {
         Representation output = response.getEntity();
         return XMLUtils.readDocument(output.getStream());
--- a/src/main/java/de/intevation/artifacts/httpclient/http/response/StreamResponseHandler.java	Mon Sep 19 14:38:23 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/response/StreamResponseHandler.java	Fri Sep 28 12:15:15 2012 +0200
@@ -21,6 +21,7 @@
     public StreamResponseHandler() {
     }
 
+    @Override
     public Object handle(Response response) throws IOException {
         Representation output = response.getEntity();
         return output.getStream();
--- a/src/main/java/de/intevation/artifacts/httpclient/http/response/StringResponseHandler.java	Mon Sep 19 14:38:23 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/response/StringResponseHandler.java	Fri Sep 28 12:15:15 2012 +0200
@@ -22,6 +22,7 @@
     public StringResponseHandler() {
     }
 
+    @Override
     public Object handle(Response response) throws IOException {
         InputStream  in  = (InputStream) super.handle(response);
         OutputStream out = new ByteArrayOutputStream();

http://dive4elements.wald.intevation.org