Class MailReceiverConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractReceiverConnection
org.springframework.ws.transport.mail.MailReceiverConnection
- All Implemented Interfaces:
AutoCloseable,HeadersAwareReceiverWebServiceConnection,WebServiceConnection
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, Greg Turnquist
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMailReceiverConnection(jakarta.mail.Message requestMessage, jakarta.mail.Session session) Constructs a new Mail connection with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponseHeader(String name, String value) Adds a response header with the given name and value.Returns the error message.Returns an iteration over all the header names this request contains.getRequestHeaders(String name) Returns an iteration over all the string values of the specified header.protected InputStreamReturns the input stream to read the response from.jakarta.mail.MessageReturns the request message for this connection.jakarta.mail.MessageReturns the response message, if any, for this connection.protected OutputStreamReturns the output stream to write the request to.getUri()Returns the URI for this connection.booleanhasError()Indicates whether this connection has an error.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.AbstractReceiverConnection
createTransportInputStream, createTransportOutputStream, onCloseMethods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, send
-
Constructor Details
-
MailReceiverConnection
protected MailReceiverConnection(jakarta.mail.Message requestMessage, jakarta.mail.Session session) Constructs a new Mail connection with the given parameters.
-
-
Method Details
-
getRequestMessage
public jakarta.mail.Message getRequestMessage()Returns the request message for this connection. -
getResponseMessage
public jakarta.mail.Message getResponseMessage()Returns the response message, if any, for this connection. -
getUri
Description copied from interface:WebServiceConnectionReturns the URI for this connection.- Throws:
URISyntaxException
-
getErrorMessage
Description copied from interface:WebServiceConnectionReturns the error message.- Returns:
- the connection error message, if any; returns
nullwhen no error is present - Throws:
IOException- See Also:
-
hasError
Description copied from interface:WebServiceConnectionIndicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.- Returns:
trueif this connection has an error;falseotherwise.- Throws:
IOException
-
getRequestHeaderNames
Description copied from interface:HeadersAwareReceiverWebServiceConnectionReturns an iteration over all the header names this request contains. Returns an emptyIteratorif there are no headers.- Throws:
IOException
-
getRequestHeaders
Description copied from interface:HeadersAwareReceiverWebServiceConnectionReturns an iteration over all the string values of the specified header. Returns an emptyIteratorif there are no headers of the specified name.- Throws:
IOException
-
getRequestInputStream
Description copied from class:AbstractReceiverConnectionReturns the input stream to read the response from.- Specified by:
getRequestInputStreamin classAbstractReceiverConnection- Throws:
IOException
-
addResponseHeader
Description copied from interface:HeadersAwareReceiverWebServiceConnectionAdds a response 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
-
getResponseOutputStream
Description copied from class:AbstractReceiverConnectionReturns the output stream to write the request to.- Specified by:
getResponseOutputStreamin classAbstractReceiverConnection- 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
-