|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.services.OWSResponse
public class OWSResponse
Sink for producing the HTTP response to an OWS request.
This is similar to HttpServletResponse, but reduces potential pitfalls and offers specific functionality
that's common for OWS implementations.
Special functionality:
commit() is called.
This allows to set headers (e.g 'Content-length') even after the response data has been produced and to rollback the
response (e.g. in order to generate an ExceptionReport response after a partial response has already been written).
Alternatively, buffering can be disabled by calling disableBuffering() to turn of buffering overhead.XMLStreamWriter.
| Constructor Summary | |
|---|---|
OWSResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates a new OWSResponse instance. |
|
| Method Summary | ||
|---|---|---|
void |
commit()
Commits the response so it gets sent to the client. |
|
void |
disableBuffering()
Disables buffering of the output. |
|
OutputStream |
getOutputStream(String contentType)
Returns an OutputStream for writing a response. |
|
XMLStreamWriter |
getXMLWriter(String contentType)
Returns an XMLStreamWriter for writing an XML response. |
|
|
sendException(String contentType,
Map<String,String> additionalHeaders,
int httpStatusCode,
ExceptionSerializer<T> serializer,
T exception)
Sends an OWSException to the client. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OWSResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
OWSResponse instance.
request - response -
IOException| Method Detail |
|---|
public void disableBuffering()
This method may only be called, if neither #getOutputStream(String)) nor #getXMLStream(String))
has been called before.
public OutputStream getOutputStream(String contentType)
throws IOException
OutputStream for writing a response.
contentType - mime type of the response content, can be null
IOException
IllegalStateException
public XMLStreamWriter getXMLWriter(String contentType)
throws IOException,
XMLStreamException
XMLStreamWriter for writing an XML response.
contentType - mime type of the response content, can be null
IOException
XMLStreamException
IllegalStateException
public void commit()
throws IOException
OWS implementation should never call this, as it is called by the OGCFrontController.
IOException
public <T extends OWSException> void sendException(String contentType,
Map<String,String> additionalHeaders,
int httpStatusCode,
ExceptionSerializer<T> serializer,
T exception)
OWSException to the client.
T - contentType - encoding - additionalHeaders - httpStatusCode - serializer - exception -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||