public class SimpleHttpImageServer extends java.lang.Object implements HttpRequestListener
To see the parameters available to run this class, launch the server with:
java com.bbn.openmap.image.SimpleHttpImageServer -helpThe server takes two main arguments, a properties file, and a port number to run on. The properties file is a standard ImageServer openmap.properties file, and its format is described in the ImageServer documentation.
The request format can be seen by pointing a browser at the port and host that the server is running on. It basically follows the format:
http://host:port/openmap?REQUEST=map&PROJTYPE=projtype&SCALE=XXXXXXXX&(etc)
This SimpleHttpImageServer is expecting a properties file containing the "layers" and "formatters" properties, both without a prefix. i.e:
layers=markername1 markername2 markername3 formatters=formatter1 formatter2 markername1.class # other markername1 properties follow... formatter1.class # other formatter1 properties follow...
If the 'layers' property is not defined the openmap.properties file, then the 'openmap.layers' property will be used, and the 'openmap.startUpLayers' property will be used to define the default set of layers. This lets there be more layers available to the client than would be sent by default (if the client doesn't specify layers).
ImageServer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ErrorMessage |
protected HttpServer |
httpd |
protected MapRequestHandler |
iServer |
static char |
queryChar |
Constructor and Description |
---|
SimpleHttpImageServer(int port,
boolean asDeamon,
java.util.Properties props) |
SimpleHttpImageServer(java.util.Properties props) |
Modifier and Type | Method and Description |
---|---|
MapRequestHandler |
getMapRequestHandler()
Get the MapRequestHandler that is handling map image requests.
|
void |
httpRequest(HttpRequestEvent e)
Invoked when an http request is received.
|
static void |
main(java.lang.String[] args) |
void |
setMapRequestHandler(MapRequestHandler mrh)
If you want to configure the MapRequestHandler and set it in
the SHIS, you can use this method.
|
void |
start() |
protected HttpServer httpd
protected MapRequestHandler iServer
public static final java.lang.String ErrorMessage
public static final char queryChar
public SimpleHttpImageServer(java.util.Properties props) throws java.io.IOException
java.io.IOException
public SimpleHttpImageServer(int port, boolean asDeamon, java.util.Properties props) throws java.io.IOException
java.io.IOException
public void start()
public MapRequestHandler getMapRequestHandler()
public void setMapRequestHandler(MapRequestHandler mrh)
public void httpRequest(HttpRequestEvent e) throws java.io.IOException
httpRequest
in interface HttpRequestListener
java.io.IOException
public static void main(java.lang.String[] args)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details