org.deegree_impl.enterprise
Class WMSServlet.WMS

java.lang.Object
  extended byorg.deegree_impl.enterprise.WMSServlet.WMS
All Implemented Interfaces:
OGCWebServiceClient
Enclosing class:
WMSServlet

private class WMSServlet.WMS
extends java.lang.Object
implements OGCWebServiceClient

Version:
$Revision: 1.55 $
Author:
Andreas Poth

Field Summary
private  java.awt.Color bgColor
           
private  java.lang.String exceptionFormat
           
private  java.lang.String format
           
private  int height
           
private  OGCWebServiceRequest request
           
private  HttpServletResponse resp
           
private  boolean transparent
           
private  int width
           
 
Constructor Summary
private WMSServlet.WMS(HttpServletRequest srequest, HttpServletResponse resp)
          Constructor of the inner class WMS.
 
Method Summary
private  java.lang.String getPostContent(HttpServletRequest request)
          returns the content of the http post request without its header
private  void handleDescribeLayerResponse(WMSDescribeLayerResponse response)
          handles the response to a describe layer request
private  void handleFeatureInfoResponse(WMSGetFeatureInfoResponse response)
          handles the response to a get featureinfo request
private  void handleGetCapabilitiesResponse(WMSGetCapabilitiesResponse response)
          handles the response to a get capabilities request
private  void handleGetLegendGraphicResponse(WMSGetLegendGraphicResponse response)
          handles the response to a get legend graphic request
private  void handleGetMapResponse(WMSGetMapResponse response)
          handles the response to a get map request
private  void handleGetScaleBarResponse(WMSGetScaleBarResponse response)
          handles the response to a get scalebar request
private  void handleGetStylesResponse(WMSGetStylesResponse response)
          handles the response to a get styles request
private  void handlePutStylesResponse(WMSPutStylesResponse response)
          handles the response to a put styles request
private  void performRequest(OGCWebServiceRequest request)
          performs the passed OGCWebServiceRequest by accessing service from the pool and passing the request to it
 void write(java.lang.Object result)
          The method implements the OGCWebServiceClient interface.
 void writeException(java.lang.String location, java.lang.String message)
          writes an excetion into the OutputStream back to the client.
private  void writeImage(java.lang.Object output, java.lang.String mime)
          writes the passed image to the response output stream.
 void writeServiceExceptionReport(java.lang.String code, java.lang.String report)
          writes an service exception report into the OutputStream back to the client. the method considers the format an exception shall be returned to the client as defined in the request.
private  java.lang.String xsltTransformGetFeature(java.lang.String capa, java.net.URL xslt)
          transforms the configuration/capabilities using to a OGC WMS conform capabilities document using a predefined xslt-stylesheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bgColor

private java.awt.Color bgColor

resp

private HttpServletResponse resp

request

private OGCWebServiceRequest request

exceptionFormat

private java.lang.String exceptionFormat

format

private java.lang.String format

transparent

private boolean transparent

height

private int height

width

private int width
Constructor Detail

WMSServlet.WMS

private WMSServlet.WMS(HttpServletRequest srequest,
                       HttpServletResponse resp)
Constructor of the inner class WMS. The constructor accesses a WMService instance from the WMServicePool an calls it doService(..) method.

If the request can't be performed an exception will be written to the output stream to the client. The exception format is taken from the request (default: application/vnd.ogc.se_xml). This constructor will be called if the request is received by the servlet with HTTP POST

Method Detail

performRequest

private void performRequest(OGCWebServiceRequest request)
performs the passed OGCWebServiceRequest by accessing service from the pool and passing the request to it


getPostContent

private java.lang.String getPostContent(HttpServletRequest request)
                                 throws java.lang.IllegalArgumentException,
                                        java.io.IOException
returns the content of the http post request without its header

Throws:
java.lang.IllegalArgumentException
java.io.IOException

write

public void write(java.lang.Object result)
Description copied from interface: OGCWebServiceClient
The method implements the OGCWebServiceClient interface. So a deegree OWS implementation accessed by this class is able to return the result of a request by calling the write-method.

It is hardly suggested that the submitted object shall be an instance of OGCWebServiceEvent. But it don't have to be.

Specified by:
write in interface OGCWebServiceClient
Parameters:
result -

handleGetCapabilitiesResponse

private void handleGetCapabilitiesResponse(WMSGetCapabilitiesResponse response)
                                    throws java.lang.Exception
handles the response to a get capabilities request

Parameters:
response -
Throws:
java.lang.Exception

handleGetMapResponse

private void handleGetMapResponse(WMSGetMapResponse response)
                           throws InvalidFormatException
handles the response to a get map request

Parameters:
response -
Throws:
InvalidFormatException

handleFeatureInfoResponse

private void handleFeatureInfoResponse(WMSGetFeatureInfoResponse response)
                                throws java.lang.Exception
handles the response to a get featureinfo request

Parameters:
response -
Throws:
java.lang.Exception

handleGetStylesResponse

private void handleGetStylesResponse(WMSGetStylesResponse response)
handles the response to a get styles request

Parameters:
response -

handlePutStylesResponse

private void handlePutStylesResponse(WMSPutStylesResponse response)
handles the response to a put styles request

Parameters:
response -

handleDescribeLayerResponse

private void handleDescribeLayerResponse(WMSDescribeLayerResponse response)
handles the response to a describe layer request

Parameters:
response -

handleGetLegendGraphicResponse

private void handleGetLegendGraphicResponse(WMSGetLegendGraphicResponse response)
                                     throws java.lang.Exception
handles the response to a get legend graphic request

Parameters:
response -
Throws:
java.lang.Exception

handleGetScaleBarResponse

private void handleGetScaleBarResponse(WMSGetScaleBarResponse response)
                                throws java.lang.Exception
handles the response to a get scalebar request

Parameters:
response -
Throws:
java.lang.Exception

writeException

public void writeException(java.lang.String location,
                           java.lang.String message)
writes an excetion into the OutputStream back to the client. the method considers the format an exception shall be returned to the client as defined in the request.

Parameters:
location - location where the exception occurs
message - message describing the exception

writeServiceExceptionReport

public void writeServiceExceptionReport(java.lang.String code,
                                        java.lang.String report)
writes an service exception report into the OutputStream back to the client. the method considers the format an exception shall be returned to the client as defined in the request.

Parameters:
code - code of te expetion as defined in the OGC WMS 1.1.1 spec and the WMS 1.1.1 test suite
report - detailed description of the exption

writeImage

private void writeImage(java.lang.Object output,
                        java.lang.String mime)
writes the passed image to the response output stream.

Parameters:
output -
mime -

xsltTransformGetFeature

private java.lang.String xsltTransformGetFeature(java.lang.String capa,
                                                 java.net.URL xslt)
transforms the configuration/capabilities using to a OGC WMS conform capabilities document using a predefined xslt-stylesheet