org.vfny.geoserver.responses.wfs
Class DescribeResponse

java.lang.Object
  extended byorg.vfny.geoserver.responses.wfs.DescribeResponse
All Implemented Interfaces:
Response

public class DescribeResponse
extends java.lang.Object
implements Response

Handles a DescribeFeatureType request and creates a DescribeFeatureType response GML string.


Constructor Summary
DescribeResponse()
           
 
Method Summary
 void abort(GeoServer gs)
          Called when things go horriably wrong.
 boolean allSameType(java.util.Collection featureTypeNames, Request request)
          Checks that the collection of featureTypeNames all have the same prefix.
 void execute(Request request)
          Constructor with request.
 java.lang.String getContentType(GeoServer gs)
          DOCUMENT ME!
 java.lang.String writeFile(java.lang.String inputFileName)
          Adds a feature type object to the final output buffer
 void writeTo(java.io.OutputStream out)
          Writes the describe response to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescribeResponse

public DescribeResponse()
Method Detail

execute

public void execute(Request request)
             throws WfsException
Constructor with request.

Specified by:
execute in interface Response
Parameters:
request - The DescribeFeatureType request object.
Throws:
WfsException - For any problems making the xml response.

getContentType

public java.lang.String getContentType(GeoServer gs)
DOCUMENT ME!

Specified by:
getContentType in interface Response
Parameters:
gs - DOCUMENT ME!
Returns:
DOCUMENT ME!

writeTo

public void writeTo(java.io.OutputStream out)
             throws WfsException
Writes the describe response to the output stream.

Specified by:
writeTo in interface Response
Parameters:
out - Where to write to.
Throws:
WfsException - For any io exceptions. Needs to be a buffer or file strategy, if on SPEED it's already too late at this point and the client is going to get some odd errors.

writeFile

public java.lang.String writeFile(java.lang.String inputFileName)
                           throws WfsException
Adds a feature type object to the final output buffer

Parameters:
inputFileName - The name of the feature type.
Returns:
The string representation of the file containing the schema.
Throws:
WfsException - For io problems reading the file.

allSameType

public boolean allSameType(java.util.Collection featureTypeNames,
                           Request request)
                    throws WfsException
Checks that the collection of featureTypeNames all have the same prefix. Used to determine if their schemas are all in the same namespace or if imports need to be done.

Parameters:
featureTypeNames - list of featureTypes, generally from a DescribeFeatureType request.
request - DOCUMENT ME!
Returns:
true if all the typenames in the collection have the same prefix.
Throws:
WfsException - if any of the names do not exist in this repository.

abort

public void abort(GeoServer gs)
Description copied from interface: Response
Called when things go horriably wrong.

Used try and restore application state when things go wrong. This is called by AbstractAction to try and recover when sending out a ServiceException.

Allows a Response a chance to clean up after its self when AbstractionAction is error handling.

Specified by:
abort in interface Response