SimpleHttpImageServer (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.image
Class SimpleHttpImageServer

    java.lang.Object
      com.bbn.openmap.image.SimpleHttpImageServer

All Implemented Interfaces:
  HttpRequestListener, java.util.EventListener

    public class SimpleHttpImageServer

extends java.lang.Object
implements HttpRequestListener

The SimpleHttpImageServer is an ImageServer extended into a simple Http server that creates images based on arguments within the request. The Request has been modeled after the OpenGIS WMT map request, although it has to be noted that this server is not yet a OGC WMT-compliant server.

To see the parameters available to run this class, launch the server with:

      java com.bbn.openmap.image.SimpleHttpImageServer -help

The 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).

See Also:
  `ImageServer`

Field Summary
`static java.lang.String` | `ErrorMessage`
`protected HttpServer` | `httpd`
`protected MapRequestHandler` | `iServer`
`static char` | `queryChar`

Constructor Summary
`SimpleHttpImageServer(int port, boolean asDeamon, java.util.Properties props)`
`SimpleHttpImageServer(java.util.Properties props)`

Method Summary
`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()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### httpd

    protected HttpServer httpd

### iServer

    protected MapRequestHandler iServer

### ErrorMessage

    public static final java.lang.String ErrorMessage

See Also:
  Constant Field Values

### queryChar

    public static final char queryChar

See Also:
  Constant Field Values

Constructor Detail

### SimpleHttpImageServer

    public SimpleHttpImageServer(java.util.Properties props)
                          throws java.io.IOException

Throws:
  `java.io.IOException`

### SimpleHttpImageServer

    public SimpleHttpImageServer(int port,
                                 boolean asDeamon,
                                 java.util.Properties props)
                          throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### start

    public void start()

### getMapRequestHandler

    public MapRequestHandler getMapRequestHandler()

  Get the MapRequestHandler that is handling map image requests.

### setMapRequestHandler

    public void setMapRequestHandler(MapRequestHandler mrh)

  If you want to configure the MapRequestHandler and set it in the SHIS, you can use this method. This will cause the SHIS to assume that the MapRequestHandler is ready to go.

### httpRequest

    public void httpRequest(HttpRequestEvent e)
                     throws java.io.IOException

  Invoked when an http request is received.

  Specified by:
    `httpRequest` in interface `HttpRequestListener`
  Throws:
    `java.io.IOException`

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details