# HG changeset patch # User Sascha L. Teichmann # Date 1254219953 0 # Node ID 86d2a843e5888690fc5bd76a9578b92c7e47f707 # Parent b8516aa3d8a10ec2ad107cbb670f9e4bb36ad7c0 Allow REST server to bind to configurable interface. artifacts/trunk@151 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r b8516aa3d8a1 -r 86d2a843e588 Changelog --- a/Changelog Thu Sep 24 09:15:56 2009 +0000 +++ b/Changelog Tue Sep 29 10:25:53 2009 +0000 @@ -1,3 +1,15 @@ +2009-09-29 Sascha L. Teichmann + + * pom.xml, artifacts/pom.xml, artifact-database/pom.xml: + Set source encoding to UTF-8. + + * artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java: + If '/artifact-database/rest-server/listen/text()' is given in conf.xml + the value is used to bind REST server to that interface. + + * artifact-database/doc/example-conf/conf.xml: Added 'listen' to + demo configuration. + 2009-09-24 Sascha L. Teichmann * artifact-database/src/main/resources/sql/org-h2-driver.properties: diff -r b8516aa3d8a1 -r 86d2a843e588 artifact-database/doc/example-conf/conf.xml --- a/artifact-database/doc/example-conf/conf.xml Thu Sep 24 09:15:56 2009 +0000 +++ b/artifact-database/doc/example-conf/conf.xml Tue Sep 29 10:25:53 2009 +0000 @@ -17,6 +17,7 @@ 8181 + localhost diff -r b8516aa3d8a1 -r 86d2a843e588 artifact-database/pom.xml --- a/artifact-database/pom.xml Thu Sep 24 09:15:56 2009 +0000 +++ b/artifact-database/pom.xml Tue Sep 29 10:25:53 2009 +0000 @@ -5,6 +5,9 @@ de.intevation.bsh 1.0-SNAPSHOT + + UTF-8 + 4.0.0 de.intevation.bsh.artifact-database artifact-database diff -r b8516aa3d8a1 -r 86d2a843e588 artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Thu Sep 24 09:15:56 2009 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Tue Sep 29 10:25:53 2009 +0000 @@ -22,10 +22,14 @@ public static final String REST_PORT = "/artifact-database/rest-server/port/text()"; + public static final String LISTEN_INTERFACE = + "/artifact-database/rest-server/listen/text()"; + public static final int DEFAULT_PORT = 8181; public static void startAsServer(ArtifactDatabase db) { - String portString = Config.getStringXPath(REST_PORT); + String portString = Config.getStringXPath(REST_PORT); + String listenString = Config.getStringXPath(LISTEN_INTERFACE); int port = DEFAULT_PORT; @@ -46,7 +50,12 @@ Component component = new Component(); - component.getServers().add(Protocol.HTTP, port); + if (listenString != null) { + component.getServers().add(Protocol.HTTP, listenString, port); + } + else { + component.getServers().add(Protocol.HTTP, port); + } component.getDefaultHost().attach(app); diff -r b8516aa3d8a1 -r 86d2a843e588 artifacts/pom.xml --- a/artifacts/pom.xml Thu Sep 24 09:15:56 2009 +0000 +++ b/artifacts/pom.xml Tue Sep 29 10:25:53 2009 +0000 @@ -1,5 +1,5 @@ - + + 4.0.0 de.intevation.bsh.artifacts artifacts @@ -7,6 +7,9 @@ 1.0-SNAPSHOT artifacts http://maven.apache.org + + UTF-8 + diff -r b8516aa3d8a1 -r 86d2a843e588 pom.xml --- a/pom.xml Thu Sep 24 09:15:56 2009 +0000 +++ b/pom.xml Tue Sep 29 10:25:53 2009 +0000 @@ -7,6 +7,9 @@ 1.0-SNAPSHOT artifact-system http://maven.apache.org + + UTF-8 + @@ -26,10 +29,10 @@ - - maven-restlet - Public online Restlet repository - http://maven.restlet.org + + maven-restlet + Public online Restlet repository + http://maven.restlet.org