Class JdkHttpClientConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.http.AbstractHttpSenderConnection
org.springframework.ws.transport.http.JdkHttpClientConnection
- All Implemented Interfaces:
AutoCloseable,FaultAwareWebServiceConnection,HeadersAwareSenderWebServiceConnection,WebServiceConnection
Implementation of the
WebServiceConnection interface that uses Java's built-in
HttpClient.- Since:
- 4.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJdkHttpClientConnection(HttpClient httpClient, URI uri, Duration requestTimeout) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestHeader(String name, String value) Adds a request header with the given name and value.protected InputStreamReturns the raw, possibly compressed input stream to read the response from.protected OutputStreamReturns the output stream to write the request to.protected intReturns the HTTP status code of the response.protected longReturns the length of the response.Returns an iteration over all the header names this request contains.getResponseHeaders(String name) Returns an iteration over all the string values of the specified header.protected StringReturns the HTTP status message of the response.getUri()Returns the URI for this connection.protected voidonClose()Template method invoked fromAbstractWebServiceConnection.close().protected voidonSendAfterWrite(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream.protected voidonSendBeforeWrite(WebServiceMessage message) Called before the given message has been written to theTransportOutputStream.Methods inherited from class org.springframework.ws.transport.http.AbstractHttpSenderConnection
getErrorMessage, getResponseInputStream, hasError, hasFault, hasResponse, setFault, setFaultCodeMethods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStreamMethods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, sendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ws.transport.WebServiceConnection
close, receive, send
-
Constructor Details
-
JdkHttpClientConnection
-
-
Method Details
-
getRequestOutputStream
Description copied from class:AbstractSenderConnectionReturns the output stream to write the request to.- Specified by:
getRequestOutputStreamin classAbstractSenderConnection- Throws:
IOException
-
getResponseHeaderNames
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturns an iteration over all the header names this request contains. Returns an emptyIteratorif there are no headers.- Throws:
IOException
-
getResponseHeaders
Description copied from interface:HeadersAwareSenderWebServiceConnectionReturns an iteration over all the string values of the specified header. Returns an emptyIteratorif there are no headers of the specified name.- Throws:
IOException
-
addRequestHeader
Description copied from interface:HeadersAwareSenderWebServiceConnectionAdds a request header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.- Parameters:
name- the name of the headervalue- the value of the header- Throws:
IOException
-
getUri
Description copied from interface:WebServiceConnectionReturns the URI for this connection.- Throws:
URISyntaxException
-
getResponseCode
Description copied from class:AbstractHttpSenderConnectionReturns the HTTP status code of the response.- Specified by:
getResponseCodein classAbstractHttpSenderConnection- Throws:
IOException
-
getResponseMessage
Description copied from class:AbstractHttpSenderConnectionReturns the HTTP status message of the response.- Specified by:
getResponseMessagein classAbstractHttpSenderConnection- Throws:
IOException
-
getResponseContentLength
Description copied from class:AbstractHttpSenderConnectionReturns the length of the response.- Specified by:
getResponseContentLengthin classAbstractHttpSenderConnection- Throws:
IOException
-
getRawResponseInputStream
Description copied from class:AbstractHttpSenderConnectionReturns the raw, possibly compressed input stream to read the response from.- Specified by:
getRawResponseInputStreamin classAbstractHttpSenderConnection- Throws:
IOException
-
onSendBeforeWrite
Description copied from class:AbstractWebServiceConnectionCalled before the given message has been written to theTransportOutputStream. Called fromAbstractWebServiceConnection.send(WebServiceMessage).Default implementation does nothing.
- Overrides:
onSendBeforeWritein classAbstractWebServiceConnection- Parameters:
message- the message- Throws:
IOException- when an I/O exception occurs
-
onSendAfterWrite
Description copied from class:AbstractWebServiceConnectionCalled after the given message has been written to theTransportOutputStream. Called fromAbstractWebServiceConnection.send(WebServiceMessage).Default implementation does nothing.
- Overrides:
onSendAfterWritein classAbstractWebServiceConnection- Parameters:
message- the message- Throws:
IOException- when an I/O exception occurs
-
onClose
Description copied from class:AbstractSenderConnectionTemplate method invoked fromAbstractWebServiceConnection.close(). Default implementation is empty.- Overrides:
onClosein classAbstractSenderConnection- Throws:
IOException- if an I/O error occurs when closing this connection
-