public class ClientHttpRequestConnection extends AbstractHttpSenderConnection
WebServiceConnection
interface that is based on the
Spring 3 ClientHttpRequest
and ClientHttpResponse
.Constructor and Description |
---|
ClientHttpRequestConnection(org.springframework.http.client.ClientHttpRequest request) |
Modifier and Type | Method and Description |
---|---|
void |
addRequestHeader(String name,
String value)
Adds a request header with the given name and value.
|
org.springframework.http.client.ClientHttpRequest |
getClientHttpRequest() |
org.springframework.http.client.ClientHttpResponse |
getClientHttpResponse() |
protected InputStream |
getRawResponseInputStream()
Returns the raw, possibly compressed input stream to read the response from.
|
protected OutputStream |
getRequestOutputStream()
Returns the output stream to write the request to.
|
protected int |
getResponseCode()
Returns the HTTP status code of the response.
|
protected long |
getResponseContentLength()
Returns the length of the response.
|
Iterator<String> |
getResponseHeaderNames()
Returns an iteration over all the header names this request contains.
|
Iterator<String> |
getResponseHeaders(String name)
Returns an iteration over all the string values of the specified header.
|
protected String |
getResponseMessage()
Returns the HTTP status message of the response.
|
URI |
getUri()
Returns the URI for this connection.
|
protected void |
onClose()
Template method invoked from
AbstractWebServiceConnection.close() . |
protected void |
onSendAfterWrite(WebServiceMessage message)
Called after the given message has been written to the
TransportOutputStream . |
getErrorMessage, getResponseInputStream, hasError, hasFault, hasResponse, setFault, setFaultCode
createTransportInputStream, createTransportOutputStream
close, onReceiveAfterRead, onReceiveBeforeRead, onSendBeforeWrite, receive, send
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, receive, send
public ClientHttpRequestConnection(org.springframework.http.client.ClientHttpRequest request)
public org.springframework.http.client.ClientHttpRequest getClientHttpRequest()
public org.springframework.http.client.ClientHttpResponse getClientHttpResponse()
public URI getUri() throws URISyntaxException
WebServiceConnection
URISyntaxException
public void addRequestHeader(String name, String value) throws IOException
HeadersAwareSenderWebServiceConnection
name
- the name of the headervalue
- the value of the headerIOException
protected OutputStream getRequestOutputStream() throws IOException
AbstractSenderConnection
getRequestOutputStream
in class AbstractSenderConnection
IOException
protected void onSendAfterWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnection
TransportOutputStream
. Called from AbstractWebServiceConnection.send(WebServiceMessage)
.
Default implementation does nothing.
onSendAfterWrite
in class AbstractWebServiceConnection
message
- the messageIOException
- when an I/O exception occursprotected long getResponseContentLength() throws IOException
AbstractHttpSenderConnection
getResponseContentLength
in class AbstractHttpSenderConnection
IOException
public Iterator<String> getResponseHeaderNames() throws IOException
HeadersAwareSenderWebServiceConnection
Iterator
if
there are no headers.IOException
public Iterator<String> getResponseHeaders(String name) throws IOException
HeadersAwareSenderWebServiceConnection
Iterator
if there are no headers of the specified name.IOException
protected int getResponseCode() throws IOException
AbstractHttpSenderConnection
getResponseCode
in class AbstractHttpSenderConnection
IOException
protected String getResponseMessage() throws IOException
AbstractHttpSenderConnection
getResponseMessage
in class AbstractHttpSenderConnection
IOException
protected InputStream getRawResponseInputStream() throws IOException
AbstractHttpSenderConnection
getRawResponseInputStream
in class AbstractHttpSenderConnection
IOException
protected void onClose() throws IOException
AbstractSenderConnection
AbstractWebServiceConnection.close()
. Default implementation is empty.onClose
in class AbstractSenderConnection
IOException
- if an I/O error occurs when closing this connectionCopyright © 2020 Pivotal Software. All rights reserved.