com.bbn.openmap.image.wms
Class WmsRequestHandler

java.lang.Object
  extended by com.bbn.openmap.image.ImageServer
      extended by com.bbn.openmap.image.wms.WmsRequestHandler
All Implemented Interfaces:
ImageServerConstants, WMTConstants, PropertyConsumer
Direct Known Subclasses:
DynamicWmsRequestHandler

public class WmsRequestHandler
extends ImageServer
implements ImageServerConstants

Version:
$Header: /cvs/CVS_LEBA/external/openmap/openmap/src/openmap/com/bbn/openmap/wms/WmsRequestHandler.java,v 1.2 2006/03/27 10:51:13 tomrak Exp $
Author:
Adam Dawidowski, wachu, pitek

Field Summary
 
Fields inherited from class com.bbn.openmap.image.ImageServer
AntiAliasingProperty, background, BackgroundProperty, doAntiAliasing, formatter, imageFormatters, ImageFormattersProperty, ImageServerLayersProperty, layers, OpenMapPrefix, 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, GETMAP, HEIGHT, IMAGEFORMAT_GEOTIFF, IMAGEFORMAT_GIF, IMAGEFORMAT_JPEG, IMAGEFORMAT_PNG, IMAGEFORMAT_PPM, IMAGEFORMAT_SVG, IMAGEFORMAT_TIFF, IMAGEFORMAT_WBMP, INFO_FORMAT, MAP, QUERY_LAYERS, REQUEST, SERVICE, SRS, STYLES, TRANSPARENT, VERSION, WIDTH, WMTVER
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
WmsRequestHandler(java.lang.String wmsScheme, java.lang.String wmsHostName, int wmsPort, java.lang.String wmsUrlPath, java.util.Properties props)
          Creates a new WmsRequestHandler object.
 
Method Summary
protected  void createWmsLayers()
          For each layer managed by ImageServer create corresponding IWmsLayer which contains additional information for WMS service about given openmap layer.
protected  byte[] getFormattedImage(ImageFormatter formatter, int scaledWidth, int scaledHeight)
          Format the image that is contained in the ImageFormatter, scaling to a particular size if the scaledWidth and scaledHeight are greater than 0.
protected  IWmsLayer getLayerByName(java.lang.String wmsName)
           
protected  Layer getTopLayerByName(java.lang.String wmsName)
          Return the top OpenMap Layer for the given wms layer name.
 java.lang.String handleGetCapabilitiesRequest(java.util.Properties requestProperties)
           
 void handleGetCapabilitiesRequest(java.util.Properties requestProperties, IHttpResponse httpResponse)
           
 java.lang.String handleGetFeatureInfoRequest(java.util.Properties requestProperties)
           VERSION - checked REQUEST - checked EXCEPTIONS - checked all from GetMap except VERSION and REQUEST QUERY_LAYERS - specific INFO_FORMAT - specific FEATURE_COUNT - specific I,J - specific
 void handleGetFeatureInfoRequest(java.util.Properties requestProperties, IHttpResponse httpResponse)
           
 byte[] handleGetMapRequest(java.util.Properties requestProperties)
           
 void handleGetMapRequest(java.util.Properties requestProperties, IHttpResponse httpResponse)
           
 void handleRequest(java.util.Properties requestProperties, IHttpResponse httpResponse)
           
protected  void setRequestParametersOnLayers(java.util.Properties requestProperties)
          Set the request parameters on all the layers
 
Methods inherited from class com.bbn.openmap.image.ImageServer
calculateVisibleLayerMask, createGraphics, createImage, createImage, createImage, createImage, createImage, createImage, createImageFile, getBackground, getBackground, getDoAntiAliasing, getFormatter, getFormatters, getFormatters, getLayers, getLayers, getLayers, getMaskedLayers, getProperties, getPropertyInfo, getPropertyPrefix, main, setBackground, setDoAntiAliasing, setFormatter, setFormatter, setFormatters, setLayers, setProperties, setProperties, setProperties, setPropertyPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WmsRequestHandler

public WmsRequestHandler(java.lang.String wmsScheme,
                         java.lang.String wmsHostName,
                         int wmsPort,
                         java.lang.String wmsUrlPath,
                         java.util.Properties props)
                  throws java.io.IOException,
                         WMSException
Creates a new WmsRequestHandler object.

Parameters:
port -
props - Properties from openmap.properties
mapLayerHandler -
wmsLayersMap -
Throws:
java.io.IOException
WMSException
Method Detail

createWmsLayers

protected void createWmsLayers()
For each layer managed by ImageServer create corresponding IWmsLayer which contains additional information for WMS service about given openmap layer. For Layers that already implement IWmsLayer, the instances will be the same.


setRequestParametersOnLayers

protected void setRequestParametersOnLayers(java.util.Properties requestProperties)
Set the request parameters on all the layers

Parameters:
requestProperties -
See Also:
IWmsLayer.setRequestParameters(Properties)

getLayerByName

protected IWmsLayer getLayerByName(java.lang.String wmsName)

getTopLayerByName

protected Layer getTopLayerByName(java.lang.String wmsName)
Return the top OpenMap Layer for the given wms layer name.

Parameters:
name -
Returns:

handleRequest

public void handleRequest(java.util.Properties requestProperties,
                          IHttpResponse httpResponse)
                   throws java.io.IOException,
                          MapRequestFormatException
Parameters:
request -
out -
Throws:
java.io.IOException
MapRequestFormatException

handleGetMapRequest

public void handleGetMapRequest(java.util.Properties requestProperties,
                                IHttpResponse httpResponse)
                         throws java.io.IOException,
                                MapRequestFormatException,
                                WMSException
Parameters:
requestProperties -
out -
Throws:
java.io.IOException
MapRequestFormatException
WMSException

handleGetMapRequest

public byte[] handleGetMapRequest(java.util.Properties requestProperties)
                           throws java.io.IOException,
                                  MapRequestFormatException,
                                  WMSException
Parameters:
requestProperties -
Returns:
Throws:
java.io.IOException
MapRequestFormatException
WMSException

handleGetCapabilitiesRequest

public void handleGetCapabilitiesRequest(java.util.Properties requestProperties,
                                         IHttpResponse httpResponse)
                                  throws java.io.IOException,
                                         MapRequestFormatException,
                                         WMSException
Parameters:
requestProperties -
out -
Throws:
java.io.IOException
MapRequestFormatException
WMSException

handleGetCapabilitiesRequest

public java.lang.String handleGetCapabilitiesRequest(java.util.Properties requestProperties)
                                              throws java.io.IOException,
                                                     MapRequestFormatException,
                                                     WMSException
Parameters:
requestProperties -
Returns:
Throws:
java.io.IOException
MapRequestFormatException
WMSException

handleGetFeatureInfoRequest

public void handleGetFeatureInfoRequest(java.util.Properties requestProperties,
                                        IHttpResponse httpResponse)
                                 throws java.io.IOException,
                                        MapRequestFormatException,
                                        WMSException
Parameters:
requestProperties -
out -
Throws:
java.io.IOException
MapRequestFormatException
WMSException

handleGetFeatureInfoRequest

public java.lang.String handleGetFeatureInfoRequest(java.util.Properties requestProperties)
                                             throws java.io.IOException,
                                                    MapRequestFormatException,
                                                    WMSException

Parameters:
requestProperties -
Returns:
Throws:
java.io.IOException
MapRequestFormatException
WMSException

getFormattedImage

protected byte[] getFormattedImage(ImageFormatter formatter,
                                   int scaledWidth,
                                   int scaledHeight)
Description copied from class: ImageServer
Format the image that is contained in the ImageFormatter, scaling to a particular size if the scaledWidth and scaledHeight are greater than 0.

Overrides:
getFormattedImage in class ImageServer
Parameters:
formatter -
scaledWidth -
scaledHeight -
Returns:


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