|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.image.ImageServer com.bbn.openmap.image.MapRequestHandler
public class MapRequestHandler
The MapRequestHandler is the front end for String requests to the ImageServer. It's goal is to be able to handle OpenGIS WMT mapserver requests, so the String request format is in the same format. We've included some OpenMap extensions to that format, so an OpenMap projection can be defined.
The MapRequestHandler should be able to handle map requests, resulting in a map image, and capabilities requests, so a client can find out what layers, projection types and image formats are available.
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).
The MapRequestHandler assumes that the ProjectionFactory shared instance has ProjectionLoaders added to it to let it know how to handle different projection names. A call to ProjectionFactory.loadDefaultProjections() will take care of this requirement if you just want the standard projections loaded.
Field Summary | |
---|---|
protected java.lang.String |
defaultLayers
Comma-separated list of layer scoping prefixes that specify what layers, and their order, should be used for default images where layers are not specified in the request. |
static java.lang.String |
defaultLayersProperty
|
static java.lang.String |
DefaultLayersProperty
The real new property for doing this. |
protected Projection |
defaultProjection
The default projection that provides projection parameters that are missing from the request. |
static java.lang.String |
hexSeparator
|
protected boolean |
useVisibility
The layers' visibility will be set to true at initialization if this property is set, and the layers' visibility will determine if a layer will be part of the image. |
static java.lang.String |
UseVisibilityProperty
The property for using visibility of the layers to mark the default layers. |
static java.lang.String |
valueSeparator
|
Fields inherited from class com.bbn.openmap.image.ImageServer |
---|
AntiAliasingProperty, background, BackgroundProperty, doAntiAliasing, formatter, imageFormatters, ImageFormattersProperty, ImageServerLayersProperty, layers, logger, OpenMapPrefix, projectionFactory, propertiesPrefix |
Fields inherited from interface com.bbn.openmap.image.ImageServerConstants |
---|
AZIMUTH, LAT, LAYERMASK, LAYERS, LON, PAN, PROJTYPE, QUERY, RECENTER, SCALE, X, Y |
Fields inherited from interface com.bbn.openmap.image.WMTConstants |
---|
BBOX, BGCOLOR, CAPABILITIES, CRS, EXCEPTIONS, FORMAT, GETCAPABILITIES, GETFEATUREINFO, GETLEGENDGRAPHIC, GETMAP, HEIGHT, IMAGEFORMAT_GEOTIFF, IMAGEFORMAT_GIF, IMAGEFORMAT_JPEG, IMAGEFORMAT_PNG, IMAGEFORMAT_PPM, IMAGEFORMAT_SVG, IMAGEFORMAT_TIFF, IMAGEFORMAT_WBMP, INFO_FORMAT, LAYER, MAP, QUERY_LAYERS, REQUEST, SERVICE, SRS, STYLE, STYLES, TRANSPARENT, VERSION, WIDTH, WMTVER |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
MapRequestHandler(java.util.Properties props)
|
|
MapRequestHandler(java.lang.String prefix,
java.util.Properties props)
|
Method Summary | |
---|---|
protected java.util.Properties |
convertRequestToProps(java.lang.String request)
|
java.lang.String |
getAllLayerNames()
Get a list of all the layer identifiers that can be used in a request, for the current configuration of the MapRequestHandler. |
java.lang.String |
getDefaultLayers()
|
Projection |
getDefaultProjection()
Get the Projection being used for parameters in case some parameters are missing from request strings. |
java.lang.String |
getFormatterContentType(ImageFormatter formatter)
Given an ImageFormatter, get the HttpConnection content type that matches it. |
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Part of the PropertyConsumer interface. |
boolean |
getUseVisibility()
|
void |
handleCapabilitiesRequest(java.util.Properties requestProperties,
java.io.OutputStream out)
Handle a capabilities request. |
byte[] |
handleMapRequest(java.util.Properties requestProperties)
Handle a map request, and create and image for it. |
void |
handleMapRequest(java.util.Properties requestProperties,
java.io.OutputStream out)
Handle a Map Request. |
void |
handlePanRequest(java.util.Properties requestProperties,
java.io.OutputStream out)
Handle a Pan Request. |
void |
handleRecenterRequest(java.util.Properties requestProperties,
java.io.OutputStream out)
Handle a Recenter Request. |
byte[] |
handleRequest(java.lang.String request)
Given a general request, parse it and handle it. |
void |
handleRequest(java.lang.String request,
java.io.OutputStream out)
Given a general request, parse it and handle it. |
protected Projection |
initProjection(java.util.Properties props)
Set up the default projection, which parts are used if any parts of a projection are missing on an image request. |
protected void |
loadProjections(java.util.Properties props)
Method called from initProjection to initialize the ProjectionFactory. |
void |
setDefaultLayers(java.lang.String dLayers)
Set the default layers that will be used for requests that don't specify layers. |
void |
setDefaultProjection(Projection proj)
Set the default projection to grab parameters from in case some projection terms are missing from the request string. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Set the layers and image type in the properties. |
void |
setUseVisibility(boolean value)
Set whether the layer visibility is used in order to determine default layers for the image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String valueSeparator
public static final java.lang.String hexSeparator
public static final java.lang.String defaultLayersProperty
public static final java.lang.String DefaultLayersProperty
public static final java.lang.String UseVisibilityProperty
protected java.lang.String defaultLayers
protected Projection defaultProjection
protected boolean useVisibility
Constructor Detail |
---|
public MapRequestHandler(java.util.Properties props) throws java.io.IOException
java.io.IOException
public MapRequestHandler(java.lang.String prefix, java.util.Properties props) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void setProperties(java.lang.String prefix, java.util.Properties props)
ImageServer
setProperties
in interface PropertyConsumer
setProperties
in class ImageServer
prefix
- a String used by the PropertyConsumer to prepend
to each property value it wants to look up -
setList.getProperty(prefix.propertyKey). If the prefix
had already been set, then the prefix passed in should
replace that previous value.props
- a Properties object that the PropertyConsumer
can use to retrieve expected properties it can use for
configuration.public java.util.Properties getPropertyInfo(java.util.Properties props)
ImageServer
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class ImageServer
props
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public void setUseVisibility(boolean value)
public boolean getUseVisibility()
protected Projection initProjection(java.util.Properties props)
props
- the properties to look for openmap projection parameters.
protected void loadProjections(java.util.Properties props)
props
- Properties that can be used to figure out what to do. This
implementation of the method doesn't use the Properties.public void setDefaultProjection(Projection proj)
public Projection getDefaultProjection()
public void setDefaultLayers(java.lang.String dLayers)
public java.lang.String getDefaultLayers()
public java.lang.String getAllLayerNames()
protected java.util.Properties convertRequestToProps(java.lang.String request) throws MapRequestFormatException
MapRequestFormatException
public byte[] handleRequest(java.lang.String request) throws java.io.IOException, MapRequestFormatException
request
- the request string of key value pairs.
java.io.IOException
MapRequestFormatException
public void handleRequest(java.lang.String request, java.io.OutputStream out) throws java.io.IOException, MapRequestFormatException
request
- the request string of key value pairs.out
- OutputStream to reply on.
java.io.IOException
MapRequestFormatException
public byte[] handleMapRequest(java.util.Properties requestProperties) throws java.io.IOException, MapRequestFormatException
requestProperties
- the request in properties format.
java.io.IOException
MapRequestFormatException
public void handleMapRequest(java.util.Properties requestProperties, java.io.OutputStream out) throws java.io.IOException, MapRequestFormatException
java.io.IOException
MapRequestFormatException
public void handlePanRequest(java.util.Properties requestProperties, java.io.OutputStream out) throws java.io.IOException, MapRequestFormatException
java.io.IOException
MapRequestFormatException
public void handleRecenterRequest(java.util.Properties requestProperties, java.io.OutputStream out) throws java.io.IOException, MapRequestFormatException
java.io.IOException
MapRequestFormatException
public java.lang.String getFormatterContentType(ImageFormatter formatter)
public void handleCapabilitiesRequest(java.util.Properties requestProperties, java.io.OutputStream out) throws java.io.IOException, MapRequestFormatException
java.io.IOException
MapRequestFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |