Package net.messagevortex.transport.smtp
Class SmtpSender
java.lang.Object
net.messagevortex.transport.AbstractConnection
net.messagevortex.transport.ClientConnection
net.messagevortex.transport.smtp.SmtpSender
- All Implemented Interfaces:
RunningDaemon,TransportSender
-
Constructor Summary
ConstructorsConstructorDescriptionSmtpSender(String senderAddress, String server, int port, Credentials creds, SecurityContext context) Creates an SMTP sending daemon transfering messages to a smart relay. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(String address, InputStream is) sends a message on the transport layer.voidShuts this class down.voidInitializes and starts all threads required to run the daemon.voidStopps all daemon threads and frees all temporary resources.Methods inherited from class net.messagevortex.transport.ClientConnection
shutdownMethods inherited from class net.messagevortex.transport.AbstractConnection
closeConnection, connect, do_handshake, do_teardown, enlargeApplicationBuffer, enlargeBuffer, enlargePacketBuffer, getDefaultTimeout, getEngine, getHostName, getPort, getProtocol, getSecurityContext, getSocketChannel, getTimeout, handleBufferUnderflow, handleEndOfStream, isShutdown, isTls, read, read, readln, readln, setDefaultTimeout, setEngine, setProtocol, setSecurityContext, setSocketChannel, setTimeout, startTls, startTls, write, write, writeln, writeln
-
Constructor Details
-
SmtpSender
public SmtpSender(String senderAddress, String server, int port, Credentials creds, SecurityContext context) throws IOException Creates an SMTP sending daemon transfering messages to a smart relay.
- Parameters:
senderAddress- the sending email address to be usedserver- the server fully qualified domain nameport- the server port to send the messages tocreds- the credentials to be usedcontext- the security context to be used- Throws:
IOException- if failing to connect to the server
-
-
Method Details
-
sendMessage
Description copied from interface:TransportSendersends a message on the transport layer.
This method is called by the blender layer to send a message.
- Specified by:
sendMessagein interfaceTransportSender- Parameters:
address- the string representation of the target address on the transport layeris- the outputstream providing the message- Throws:
IOException- if transport layer was unable to satisfy the request
-
shutdownDaemon
public void shutdownDaemon()Description copied from interface:RunningDaemonShuts this class down.
This frees all resources and ends all threads for an application or layer shutdown. It is not possible to call start() after running shutdown().
- Specified by:
shutdownDaemonin interfaceRunningDaemon
-
startDaemon
public void startDaemon()Description copied from interface:RunningDaemonInitializes and starts all threads required to run the daemon.
- Specified by:
startDaemonin interfaceRunningDaemon
-
stopDaemon
public void stopDaemon()Description copied from interface:RunningDaemonStopps all daemon threads and frees all temporary resources.
- Specified by:
stopDaemonin interfaceRunningDaemon
-