Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java @ 88:69c84cf7c5d7
Added javadoc to the REST package of the artifact database (complete).
artifacts/trunk@840 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 26 Mar 2010 15:05:11 +0000 |
parents | 48d1a9a082c2 |
children | e27cf9c84eb8 |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Fri Mar 26 11:40:28 2010 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Fri Mar 26 15:05:11 2010 +0000 @@ -8,25 +8,48 @@ import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.rest.RestApp; - import org.apache.log4j.Logger; /** + * Starts an HTTP server bound to a RestApp. + * The server (binding interface and port) is configure via the + * global configuration. + * * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a> */ public class Standalone { private static Logger logger = Logger.getLogger(Standalone.class); + /** + * XPath to figure out the port where to listen from the + * global configuration. + */ public static final String REST_PORT = "/artifact-database/rest-server/port/text()"; + /** + * XPath to figure out from global configuration + * which network interface to use to bind the HTTP server. + */ public static final String LISTEN_INTERFACE = "/artifact-database/rest-server/listen/text()"; + /** + * The default port of the HTTP server: 8181 + */ public static final int DEFAULT_PORT = 8181; + /** + * Builds a RestApp wrapped around the given artifact database, + * and bind this application to HTTP server. The HTTP server + * is configured by the global configuration. If no port is + * given by the configuration the default port is used. If + * no interface is given the HTTP server is reachable from + * all interfaces. + * @param db The artifact database to be exposed via the + * REST application. + */ public static void startAsServer(ArtifactDatabase db) { String portString = Config.getStringXPath(REST_PORT); String listenString = Config.getStringXPath(LISTEN_INTERFACE); @@ -71,4 +94,4 @@ } } } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file