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

java.lang.Object
  extended byorg.vfny.geoserver.responses.wms.map.GetMapDelegate
All Implemented Interfaces:
Response
Direct Known Subclasses:
JAIMapResponse, SVGMapResponse

public abstract class GetMapDelegate
extends java.lang.Object
implements Response

Base class for delegates who creates a map based on a GetMap request. Subclasses should implement one or more output format


Constructor Summary
GetMapDelegate()
          Creates a new GetMapDelegate object.
 
Method Summary
protected  org.geotools.styling.Style[] buildStyles(java.util.List styleNames, GeoServer gs)
           
abstract  boolean canProduce(java.lang.String mapFormat)
          Evaluates if this Map producer can generate the map format specified by mapFormat
protected abstract  void execute(FeatureTypeInfo[] requestedLayers, org.geotools.data.FeatureResults[] resultLayers, org.geotools.styling.Style[] styles)
          Execute method for concrete children to implement.
protected  void execute(GetMapRequest request)
          Executes a GetMapRequest.
 void execute(Request request)
          Executes a Request, which must be a GetMapRequest.
protected  GetMapRequest getRequest()
          Gets the map request.
abstract  java.util.List getSupportedFormats()
          Gets A list of the formats this delegate supports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.vfny.geoserver.responses.Response
abort, getContentType, writeTo
 

Constructor Detail

GetMapDelegate

public GetMapDelegate()
Creates a new GetMapDelegate object.

Method Detail

execute

public void execute(Request request)
             throws ServiceException
Executes a Request, which must be a GetMapRequest. Any other will cause a class cast exception.

Specified by:
execute in interface Response
Parameters:
request - A valid GetMapRequest.
Throws:
ServiceException - If the request can not be executed.

execute

protected void execute(GetMapRequest request)
                throws WmsException
Executes a GetMapRequest. Builds the proper objects from the request names.

Parameters:
request - A valid GetMapRequest.
Throws:
WmsException - If anything goes wrong.

execute

protected abstract void execute(FeatureTypeInfo[] requestedLayers,
                                org.geotools.data.FeatureResults[] resultLayers,
                                org.geotools.styling.Style[] styles)
                         throws WmsException
Execute method for concrete children to implement. Each param is an array in the order things should be processed.

Parameters:
requestedLayers - Array of config information of the FeatureTypes to be processed.
resultLayers - Matching array of results from the queries of the requested layers.
styles - Matching array of the styles to process the results with.
Throws:
WmsException - For any problems executing.

buildStyles

protected org.geotools.styling.Style[] buildStyles(java.util.List styleNames,
                                                   GeoServer gs)
                                            throws WmsException
Throws:
WmsException

getRequest

protected GetMapRequest getRequest()
Gets the map request. Used by delegate children to find out more information about the request.

Returns:
The request to be processed.

canProduce

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

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 abstract java.util.List getSupportedFormats()
Gets A list of the formats this delegate supports.

Returns:
A list of strings of the formats supported.