Spring Web Services Framework

org.springframework.ws.transport.mail
Class MailReceiverConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractReceiverConnection
          extended by org.springframework.ws.transport.mail.MailReceiverConnection
All Implemented Interfaces:
WebServiceConnection

public class MailReceiverConnection
extends AbstractReceiverConnection

Implementation of WebServiceConnection that is used for server-side Mail access. Exposes a Message request and response message.

Since:
1.5.0
Author:
Arjen Poutsma

Constructor Summary
protected MailReceiverConnection(Message requestMessage, Session session)
          Constructs a new Mail connection with the given parameters.
 
Method Summary
protected  void addResponseHeader(String name, String value)
          Adds a response header with the given name and value.
 String getErrorMessage()
          Returns the error message.
protected  Iterator getRequestHeaderNames()
          Returns an iteration over all the header names this request contains.
protected  Iterator 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.
 Message getRequestMessage()
          Returns the request message for this connection.
 Message getResponseMessage()
          Returns the response message, if any, for this connection.
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.
protected  void onSendAfterWrite(WebServiceMessage message)
          Called after the given message has been written to the TransportOutputStream.
protected  void onSendBeforeWrite(WebServiceMessage message)
          Called before the given message has been written to the TransportOutputStream.
 
Methods inherited from class org.springframework.ws.transport.AbstractReceiverConnection
createTransportInputStream, createTransportOutputStream, onClose
 
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailReceiverConnection

protected MailReceiverConnection(Message requestMessage,
                                 Session session)
Constructs a new Mail connection with the given parameters.

Method Detail

getRequestMessage

public Message getRequestMessage()
Returns the request message for this connection.


getResponseMessage

public Message getResponseMessage()
Returns the response message, if any, for this connection.


getUri

public URI getUri()
           throws URISyntaxException
Description copied from interface: WebServiceConnection
Returns the URI for this connection.

Throws:
URISyntaxException

getErrorMessage

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

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

hasError

public 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.

Returns:
true if this connection has an error; false otherwise.
Throws:
IOException

getRequestHeaderNames

protected Iterator getRequestHeaderNames()
                                  throws IOException
Description copied from class: AbstractReceiverConnection
Returns an iteration over all the header names this request contains. Returns an empty Iterator if there areno headers.

Specified by:
getRequestHeaderNames in class AbstractReceiverConnection
Throws:
IOException

getRequestHeaders

protected Iterator getRequestHeaders(String name)
                              throws IOException
Description copied from class: AbstractReceiverConnection
Returns an iteration over all the string values of the specified header. Returns an empty Iterator if there are no headers of the specified name.

Specified by:
getRequestHeaders in class AbstractReceiverConnection
Throws:
IOException

getRequestInputStream

protected InputStream getRequestInputStream()
                                     throws IOException
Description copied from class: AbstractReceiverConnection
Returns the input stream to read the response from.

Specified by:
getRequestInputStream in class AbstractReceiverConnection
Throws:
IOException

addResponseHeader

protected void addResponseHeader(String name,
                                 String value)
                          throws IOException
Description copied from class: AbstractReceiverConnection
Adds a response header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.

Specified by:
addResponseHeader in class AbstractReceiverConnection
Parameters:
name - the name of the header
value - the value of the header
Throws:
IOException

getResponseOutputStream

protected OutputStream getResponseOutputStream()
                                        throws IOException
Description copied from class: AbstractReceiverConnection
Returns the output stream to write the request to.

Specified by:
getResponseOutputStream in class AbstractReceiverConnection
Throws:
IOException

onSendBeforeWrite

protected void onSendBeforeWrite(WebServiceMessage message)
                          throws IOException
Description copied from class: AbstractWebServiceConnection
Called before the given message has been written to the TransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).

Default implementation does nothing.

Overrides:
onSendBeforeWrite in class AbstractWebServiceConnection
Parameters:
message - the message
Throws:
IOException - when an I/O exception occurs

onSendAfterWrite

protected void onSendAfterWrite(WebServiceMessage message)
                         throws IOException
Description copied from class: AbstractWebServiceConnection
Called after the given message has been written to the TransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).

Default implementation does nothing.

Overrides:
onSendAfterWrite in class AbstractWebServiceConnection
Parameters:
message - the message
Throws:
IOException - when an I/O exception occurs

Spring Web Services Framework

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