Spring Web Services Framework

org.springframework.ws.transport.http
Class AbstractHttpSenderConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractSenderConnection
          extended by org.springframework.ws.transport.http.AbstractHttpSenderConnection
All Implemented Interfaces:
FaultAwareWebServiceConnection, WebServiceConnection
Direct Known Subclasses:
CommonsHttpConnection, HttpComponentsConnection, HttpUrlConnection

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

Constructor Summary
AbstractHttpSenderConnection()
           
 
Method Summary
 String getErrorMessage()
          Returns the error message.
protected abstract  InputStream getRawResponseInputStream()
          Returns the raw, possibly compressed input stream to read the response from.
protected abstract  int getResponseCode()
          Returns the HTTP status code of the response.
protected abstract  long getResponseContentLength()
          Returns the length of the response.
protected  InputStream getResponseInputStream()
          Returns the input stream to read the response from.
protected abstract  String getResponseMessage()
          Returns the HTTP status message of the response.
 boolean hasError()
          Indicates whether this connection has an error.
 boolean hasFault()
          Indicates whether this connection received a fault.
protected  boolean hasResponse()
          Indicates whether this connection has a response.
 void setFault(boolean fault)
          Sets whether this connection will send a fault.
 
Methods inherited from class org.springframework.ws.transport.AbstractSenderConnection
addRequestHeader, createTransportInputStream, createTransportOutputStream, getRequestOutputStream, getResponseHeaderNames, getResponseHeaders, onClose
 
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, onSendAfterWrite, onSendBeforeWrite, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.ws.transport.WebServiceConnection
close, getUri, receive, send
 

Constructor Detail

AbstractHttpSenderConnection

public AbstractHttpSenderConnection()
Method Detail

hasError

public final boolean hasError()
                       throws IOException
Description copied from interface: WebServiceConnection
Indicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.

Specified by:
hasError in interface WebServiceConnection
Returns:
true if this connection has an error; false otherwise.
Throws:
IOException

getErrorMessage

public final String getErrorMessage()
                             throws IOException
Description copied from interface: WebServiceConnection
Returns the error message.

Specified by:
getErrorMessage in interface WebServiceConnection
Returns:
the connection error message, if any; returns null when no error is present
Throws:
IOException
See Also:
WebServiceConnection.hasError()

hasResponse

protected final boolean hasResponse()
                             throws IOException
Description copied from class: AbstractSenderConnection
Indicates whether this connection has a response.

Specified by:
hasResponse in class AbstractSenderConnection
Throws:
IOException

getResponseInputStream

protected final InputStream getResponseInputStream()
                                            throws IOException
Description copied from class: AbstractSenderConnection
Returns the input stream to read the response from.

Specified by:
getResponseInputStream in class AbstractSenderConnection
Throws:
IOException

getResponseCode

protected abstract int getResponseCode()
                                throws IOException
Returns the HTTP status code of the response.

Throws:
IOException

getResponseMessage

protected abstract String getResponseMessage()
                                      throws IOException
Returns the HTTP status message of the response.

Throws:
IOException

getResponseContentLength

protected abstract long getResponseContentLength()
                                          throws IOException
Returns the length of the response.

Throws:
IOException

getRawResponseInputStream

protected abstract InputStream getRawResponseInputStream()
                                                  throws IOException
Returns the raw, possibly compressed input stream to read the response from.

Throws:
IOException

hasFault

public final boolean hasFault()
                       throws IOException
Description copied from interface: FaultAwareWebServiceConnection
Indicates whether this connection received a fault.

Typically implemented by looking at an HTTP status code.

Specified by:
hasFault in interface FaultAwareWebServiceConnection
Returns:
true if this connection received a fault; false otherwise.
Throws:
IOException - in case of I/O errors

setFault

public final void setFault(boolean fault)
Description copied from interface: FaultAwareWebServiceConnection
Sets whether this connection will send a fault.

Typically implemented by setting an HTTP status code.

Specified by:
setFault in interface FaultAwareWebServiceConnection
Parameters:
fault - true if this will send a fault; false otherwise.

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.