# HG changeset patch # User Ingo Weinzierl # Date 1299505353 0 # Node ID 19b3ba7f2568375a930e56fa3c7dd68e91311bd3 # Parent 19a617578b88dce12c9553be586d16e9a67ac6ef Added a method to the http client to list the existing users of the artifact database. http-client/trunk@1412 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 19a617578b88 -r 19b3ba7f2568 ChangeLog --- a/ChangeLog Fri Mar 04 11:49:49 2011 +0000 +++ b/ChangeLog Mon Mar 07 13:42:33 2011 +0000 @@ -1,3 +1,9 @@ +2011-03-07 Ingo Weinzierl + + * src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java, + src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java: + Added a method to list the existing users of the artifact server. + 2011-03-04 Ingo Weinzierl * src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java, diff -r 19a617578b88 -r 19b3ba7f2568 src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Fri Mar 04 11:49:49 2011 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Mon Mar 07 13:42:33 2011 +0000 @@ -28,12 +28,6 @@ Object create(Document createDocument, ArtifactCreator creator) throws ConnectionException; - Object createCollection( - Document createDocument, - String ownerId, - ResponseHandler handler) - throws ConnectionException; - Object describe( Artifact artifact, Document describeDocument, @@ -55,5 +49,22 @@ String target, OutputStream out) throws ConnectionException; + + + /******************************* + * Collections API + *******************************/ + Object createCollection( + Document createDocument, + String ownerId, + ResponseHandler handler) + throws ConnectionException; + + + /******************************* + * Users API + *******************************/ + Document listUsers() + throws ConnectionException; } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 19a617578b88 -r 19b3ba7f2568 src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Fri Mar 04 11:49:49 2011 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Mon Mar 07 13:42:33 2011 +0000 @@ -42,6 +42,9 @@ private static final Logger logger = Logger.getLogger(HttpClient.class); + /** The URL part of the resource to list the existing users of the server.*/ + public static final String PATH_LIST_USERS = "/list-users"; + /** The URL path of the resource to create new artifact collections.*/ public static final String PATH_CREATE_COLLECTION = "/create-collection"; @@ -254,5 +257,23 @@ return response; } + + + /******************************* + * Users API + *******************************/ + public Document listUsers() + throws ConnectionException + { + ResponseHandler handler = new DocumentResponseHandler(); + String url = serverUrl + PATH_LIST_USERS; + + try { + return (Document) handler.handle(doGet(url)); + } + catch (IOException ioe) { + throw new ConnectionException(ioe.getMessage(), ioe); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: