# HG changeset patch # User Bjoern Ricks # Date 1345816752 0 # Node ID 874c25363dc9252ede49c4af2a0bd8a9070abe4f # Parent 60f50a2f0168e49d018dfc34151d3e08d77ebcb3 Added new method findUser to HttpClient With the new method it is possible to get a document by an account name. http-client/trunk@5259 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 60f50a2f0168 -r 874c25363dc9 ChangeLog --- a/ChangeLog Fri Jul 27 06:41:57 2012 +0000 +++ b/ChangeLog Fri Aug 24 13:59:12 2012 +0000 @@ -1,3 +1,10 @@ +2012-08-24 Björn Ricks + + * 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 Taggd RELEASE 2.8.1 diff -r 60f50a2f0168 -r 874c25363dc9 src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Fri Jul 27 06:41:57 2012 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Fri Aug 24 13:59:12 2012 +0000 @@ -109,5 +109,8 @@ 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: diff -r 60f50a2f0168 -r 874c25363dc9 src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Fri Jul 27 06:41:57 2012 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Fri Aug 24 13:59:12 2012 +0000 @@ -57,6 +57,9 @@ /** 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"; @@ -554,5 +557,21 @@ "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: