Class AbstractHttpSenderConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractSenderConnection
org.springframework.ws.transport.http.AbstractHttpSenderConnection
- All Implemented Interfaces:
AutoCloseable,FaultAwareWebServiceConnection,HeadersAwareSenderWebServiceConnection,WebServiceConnection
- Direct Known Subclasses:
ClientHttpRequestConnection,CommonsHttpConnection,HttpComponents5Connection,HttpComponentsConnection,HttpUrlConnection,JdkHttpClientConnection
public abstract class AbstractHttpSenderConnection
extends AbstractSenderConnection
implements FaultAwareWebServiceConnection
Abstract base class for
WebServiceConnection implementations that send request over HTTP.- Since:
- 1.0.0
- Author:
- Arjen Poutsma, Andreas Veithen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the error message.protected abstract InputStreamReturns the raw, possibly compressed input stream to read the response from.protected abstract intReturns the HTTP status code of the response.protected abstract longReturns the length of the response.protected final InputStreamReturns the input stream to read the response from.protected abstract StringReturns the HTTP status message of the response.final booleanhasError()Indicates whether this connection has an error.final booleanhasFault()Indicates whether this connection received a fault.protected final booleanIndicates whether this connection has a response.final voidsetFault(boolean fault) Deprecated.final voidsetFaultCode(QName faultCode) Sets a specific fault code.Methods inherited from class org.springframework.ws.transport.AbstractSenderConnection
createTransportInputStream, createTransportOutputStream, getRequestOutputStream, onCloseMethods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, onSendAfterWrite, onSendBeforeWrite, 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.HeadersAwareSenderWebServiceConnection
addRequestHeader, getResponseHeaderNames, getResponseHeadersMethods inherited from interface org.springframework.ws.transport.WebServiceConnection
close, getUri, receive, send
-
Constructor Details
-
AbstractHttpSenderConnection
public AbstractHttpSenderConnection()
-
-
Method Details
-
hasError
Description copied from interface:WebServiceConnectionIndicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.- Specified by:
hasErrorin interfaceWebServiceConnection- Returns:
trueif this connection has an error;falseotherwise.- Throws:
IOException
-
getErrorMessage
Description copied from interface:WebServiceConnectionReturns the error message.- Specified by:
getErrorMessagein interfaceWebServiceConnection- Returns:
- the connection error message, if any; returns
nullwhen no error is present - Throws:
IOException- See Also:
-
hasResponse
Description copied from class:AbstractSenderConnectionIndicates whether this connection has a response.- Specified by:
hasResponsein classAbstractSenderConnection- Throws:
IOException
-
getResponseInputStream
Description copied from class:AbstractSenderConnectionReturns the input stream to read the response from.- Specified by:
getResponseInputStreamin classAbstractSenderConnection- Throws:
IOException
-
getResponseCode
Returns the HTTP status code of the response.- Throws:
IOException
-
getResponseMessage
Returns the HTTP status message of the response.- Throws:
IOException
-
getResponseContentLength
Returns the length of the response.- Throws:
IOException
-
getRawResponseInputStream
Returns the raw, possibly compressed input stream to read the response from.- Throws:
IOException
-
hasFault
Description copied from interface:FaultAwareWebServiceConnectionIndicates whether this connection received a fault.Typically implemented by looking at an HTTP status code.
- Specified by:
hasFaultin interfaceFaultAwareWebServiceConnection- Returns:
trueif this connection received a fault;falseotherwise.- Throws:
IOException- in case of I/O errors
-
setFault
Deprecated.Description copied from interface:FaultAwareWebServiceConnectionSets whether this connection will send a fault.Typically implemented by setting an HTTP status code.
- Specified by:
setFaultin interfaceFaultAwareWebServiceConnection- Parameters:
fault-trueif this will send a fault;falseotherwise.
-
setFaultCode
Description copied from interface:FaultAwareWebServiceConnectionSets a specific fault code.Typically implemented by setting an HTTP status code.
- Specified by:
setFaultCodein interfaceFaultAwareWebServiceConnection- Parameters:
faultCode- the fault code to be set on the connection, ornullfor no fault.- Throws:
IOException- in case of I/O errors
-