public class MailReceiverConnection extends AbstractReceiverConnection
WebServiceConnection that is used for server-side Mail access. Exposes a Message
request and response message.| Modifier | Constructor and Description |
|---|---|
protected |
MailReceiverConnection(javax.mail.Message requestMessage,
javax.mail.Session session)
Constructs a new Mail connection with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addResponseHeader(String name,
String value)
Adds a response header with the given name and value.
|
String |
getErrorMessage()
Returns the error message.
|
Iterator<String> |
getRequestHeaderNames()
Returns an iteration over all the header names this request contains.
|
Iterator<String> |
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.
|
javax.mail.Message |
getRequestMessage()
Returns the request message for this connection.
|
javax.mail.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. |
createTransportInputStream, createTransportOutputStream, onCloseclose, onReceiveAfterRead, onReceiveBeforeRead, receive, sendprotected MailReceiverConnection(javax.mail.Message requestMessage,
javax.mail.Session session)
public javax.mail.Message getRequestMessage()
public javax.mail.Message getResponseMessage()
public URI getUri() throws URISyntaxException
WebServiceConnectionURISyntaxExceptionpublic String getErrorMessage() throws IOException
WebServiceConnectionnull when no error is presentIOExceptionWebServiceConnection.hasError()public boolean hasError()
throws IOException
WebServiceConnectiontrue if this connection has an error; false otherwise.IOExceptionpublic Iterator<String> getRequestHeaderNames() throws IOException
HeadersAwareReceiverWebServiceConnectionIterator if there
are no headers.IOExceptionpublic Iterator<String> getRequestHeaders(String name) throws IOException
HeadersAwareReceiverWebServiceConnectionIterator if there
are no headers of the specified name.IOExceptionprotected InputStream getRequestInputStream() throws IOException
AbstractReceiverConnectiongetRequestInputStream in class AbstractReceiverConnectionIOExceptionpublic void addResponseHeader(String name, String value) throws IOException
HeadersAwareReceiverWebServiceConnectionname - the name of the headervalue - the value of the headerIOExceptionprotected OutputStream getResponseOutputStream() throws IOException
AbstractReceiverConnectiongetResponseOutputStream in class AbstractReceiverConnectionIOExceptionprotected void onSendBeforeWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnectionTransportOutputStream. Called from
AbstractWebServiceConnection.send(WebServiceMessage).
Default implementation does nothing.
onSendBeforeWrite in class AbstractWebServiceConnectionmessage - the messageIOException - when an I/O exception occursprotected void onSendAfterWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnectionTransportOutputStream. Called from
AbstractWebServiceConnection.send(WebServiceMessage).
Default implementation does nothing.
onSendAfterWrite in class AbstractWebServiceConnectionmessage - the messageIOException - when an I/O exception occursCopyright © 2023 VMware, Inc.. All rights reserved.