public class HttpServletConnection extends AbstractReceiverConnection implements EndpointAwareWebServiceConnection, FaultAwareWebServiceConnection
WebServiceConnection that is based on the Servlet API.| Modifier | Constructor and Description |
|---|---|
protected |
HttpServletConnection(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Constructs a new servlet connection with the given
HttpServletRequest and
HttpServletResponse. |
| Modifier and Type | Method and Description |
|---|---|
void |
addResponseHeader(String name,
String value)
Adds a response header with the given name and value.
|
void |
endpointNotFound()
Called when an endpoint is not found.
|
String |
getErrorMessage()
Returns the error message.
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the
HttpServletRequest for this connection. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the
HttpServletResponse for this connection. |
Iterator<String> |
getRequestHeaderNames()
Returns an iteration over all the header names this request contains.
|
Iterator<String> |
getRequestHeaders(String name)
Returns an iteration over all the string values of the specified header.
|
protected InputStream |
getRequestInputStream()
Returns the input stream to read the response from.
|
protected OutputStream |
getResponseOutputStream()
Returns the output stream to write the request to.
|
URI |
getUri()
Returns the URI for this connection.
|
boolean |
hasError()
Indicates whether this connection has an error.
|
boolean |
hasFault()
Indicates whether this connection received a fault.
|
void |
onClose()
Template method invoked from
AbstractWebServiceConnection.close(). |
protected void |
onSendAfterWrite(WebServiceMessage message)
Called after the given message has been written to the
TransportOutputStream. |
void |
setFault(boolean fault)
Deprecated.
|
void |
setFaultCode(QName faultCode)
Sets a specific fault code.
|
createTransportInputStream, createTransportOutputStreamclose, onReceiveAfterRead, onReceiveBeforeRead, onSendBeforeWrite, receive, sendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, receive, sendprotected HttpServletConnection(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
HttpServletRequest and
HttpServletResponse.public javax.servlet.http.HttpServletRequest getHttpServletRequest()
HttpServletRequest for this connection.public javax.servlet.http.HttpServletResponse getHttpServletResponse()
HttpServletResponse for this connection.public void endpointNotFound()
EndpointAwareWebServiceConnectionendpointNotFound in interface EndpointAwareWebServiceConnectionpublic boolean hasError()
throws IOException
WebServiceConnectionhasError in interface WebServiceConnectiontrue if this connection has an error; false otherwise.IOExceptionpublic String getErrorMessage() throws IOException
WebServiceConnectiongetErrorMessage in interface WebServiceConnectionnull when no error is presentIOExceptionWebServiceConnection.hasError()public URI getUri() throws URISyntaxException
WebServiceConnectiongetUri in interface WebServiceConnectionURISyntaxExceptionpublic Iterator<String> getRequestHeaderNames() throws IOException
HeadersAwareReceiverWebServiceConnectionIterator if
there are no headers.getRequestHeaderNames in interface HeadersAwareReceiverWebServiceConnectionIOExceptionpublic Iterator<String> getRequestHeaders(String name) throws IOException
HeadersAwareReceiverWebServiceConnectionIterator
if there are no headers of the specified name.getRequestHeaders in interface HeadersAwareReceiverWebServiceConnectionIOExceptionprotected InputStream getRequestInputStream() throws IOException
AbstractReceiverConnectiongetRequestInputStream in class AbstractReceiverConnectionIOExceptionpublic void addResponseHeader(String name, String value) throws IOException
HeadersAwareReceiverWebServiceConnectionaddResponseHeader in interface HeadersAwareReceiverWebServiceConnectionname - the name of the headervalue - the value of the headerIOExceptionprotected OutputStream getResponseOutputStream() throws IOException
AbstractReceiverConnectiongetResponseOutputStream in class AbstractReceiverConnectionIOExceptionprotected void onSendAfterWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnectionTransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).
Default implementation does nothing.
onSendAfterWrite in class AbstractWebServiceConnectionmessage - the messageIOException - when an I/O exception occurspublic void onClose()
throws IOException
AbstractReceiverConnectionAbstractWebServiceConnection.close(). Default implementation is empty.onClose in class AbstractReceiverConnectionIOException - if an I/O error occurs when closing this connectionpublic boolean hasFault()
throws IOException
FaultAwareWebServiceConnectionTypically implemented by looking at an HTTP status code.
hasFault in interface FaultAwareWebServiceConnectiontrue if this connection received a fault; false otherwise.IOException - in case of I/O errors@Deprecated public void setFault(boolean fault) throws IOException
FaultAwareWebServiceConnectionTypically implemented by setting an HTTP status code.
setFault in interface FaultAwareWebServiceConnectionfault - true if this will send a fault; false otherwise.IOException - in case of I/O errorspublic void setFaultCode(QName faultCode) throws IOException
FaultAwareWebServiceConnectionTypically implemented by setting an HTTP status code.
setFaultCode in interface FaultAwareWebServiceConnectionfaultCode - the fault code to be set on the connection, or null for no fault.IOException - in case of I/O errorsCopyright © 2017 Pivotal Software. All rights reserved.