org.vfny.geoserver.responses.wms.map
Class JAIMapResponse

java.lang.Object
  extended byorg.vfny.geoserver.responses.wms.map.GetMapDelegate
      extended byorg.vfny.geoserver.responses.wms.map.JAIMapResponse
All Implemented Interfaces:
Response

public class JAIMapResponse
extends GetMapDelegate

Generates a map using the geotools jai rendering classes. Currently does a fairly poor job of taking advantage of the streaming architecture, but I'm not sure there's a better way to handle it.


Constructor Summary
JAIMapResponse()
           
 
Method Summary
 void abort(GeoServer gs)
          Halts the loading.
 boolean canProduce(java.lang.String mapFormat)
          Evaluates if this Map producer can generate the map format specified by mapFormat
protected  void execute(FeatureTypeInfo[] requestedLayers, org.geotools.data.FeatureResults[] resultLayers, org.geotools.styling.Style[] styles)
          Performs the execute request using geotools rendering.
 void formatImageOutputStream(java.lang.String format, java.awt.image.BufferedImage image, java.io.OutputStream outStream)
          Transforms the rendered image into the appropriate format, streaming to the output stream.
 java.lang.String getContentType(GeoServer gs)
          Gets the content type.
 java.util.List getSupportedFormats()
          The formats this delegate supports.
 void writeTo(java.io.OutputStream out)
          Writes the image to the client.
 
Methods inherited from class org.vfny.geoserver.responses.wms.map.GetMapDelegate
buildStyles, execute, execute, getRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAIMapResponse

public JAIMapResponse()
Method Detail

canProduce

public boolean canProduce(java.lang.String mapFormat)
Evaluates if this Map producer can generate the map format specified by mapFormat

Specified by:
canProduce in class GetMapDelegate
Parameters:
mapFormat - the mime type of the output map format requiered
Returns:
true if class can produce a map in the passed format

getSupportedFormats

public java.util.List getSupportedFormats()
The formats this delegate supports. Includes png, x-portable-graymap, jpeg, jpeg2000, x-png, tiff, vnd.wap.wbmp, x-portable-pixmap, x-portable-bitmap, bmp and x-portable-anymap.

Specified by:
getSupportedFormats in class GetMapDelegate
Returns:
The list of the supported formats.

writeTo

public void writeTo(java.io.OutputStream out)
             throws ServiceException,
                    java.io.IOException
Writes the image to the client.

Parameters:
out - The output stream to write to.
Throws:
ServiceException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!

formatImageOutputStream

public void formatImageOutputStream(java.lang.String format,
                                    java.awt.image.BufferedImage image,
                                    java.io.OutputStream outStream)
                             throws WmsException,
                                    java.io.IOException
Transforms the rendered image into the appropriate format, streaming to the output stream.

Parameters:
format - The name of the format
image - The image to be formatted.
outStream - The stream to write to.
Throws:
WmsException
java.io.IOException - DOCUMENT ME!

abort

public void abort(GeoServer gs)
Halts the loading. Right now unimplemented.

Parameters:
gs - DOCUMENT ME!

getContentType

public java.lang.String getContentType(GeoServer gs)
                                throws java.lang.IllegalStateException
Gets the content type. This is set by the request, should only be called after execute. GetMapResponse should handle this though.

Parameters:
gs - DOCUMENT ME!
Returns:
The mime type that this response will generate.
Throws:
java.lang.IllegalStateException - DOCUMENT ME!

execute

protected void execute(FeatureTypeInfo[] requestedLayers,
                       org.geotools.data.FeatureResults[] resultLayers,
                       org.geotools.styling.Style[] styles)
                throws WmsException
Performs the execute request using geotools rendering.

Specified by:
execute in class GetMapDelegate
Parameters:
requestedLayers - The information on the types requested.
resultLayers - The results of the queries to generate maps with.
styles - The styles to be used on the results.
Throws:
WmsException - For any problems.