Package mireka.transmission.immediate
Class DirectImmediateSender
- Object
-
- mireka.transmission.immediate.DirectImmediateSender
-
- All Implemented Interfaces:
ImmediateSender
public class DirectImmediateSender extends Object implements ImmediateSender
DirectImmediateSender synchronously sends a mail directly to an SMTP server of a single remote domain, which may include attempting delivery to more than one MX hosts of the domain until a working one is found.The remote domain is specified by the remote part of the recipient addresses, which must be the same for all recipients in case of this implementation.
The receiving SMTP servers are usually specified by the MX records of the remote domain, except if the remote part is a literal address, or the domain has an implicit MX record only.
If it cannot transmit the mail to any of the MX hosts of the domain, then it throws an exception, it does not retry later.
TODO: if a recipient is rejected because of a transient failure, then it should be retried on another host.
-
-
Constructor Summary
Constructors Constructor Description DirectImmediateSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressLookupgetAddressLookup()ClientFactorygetClientFactory()MailToHostTransmittergetMailToHostTransmitter()MxLookupgetMxLookup()voidsend(Mail mail)Transmits mail to a single domain.voidsetAddressLookup(AddressLookup addressLookup)voidsetClientFactory(ClientFactory clientFactory)voidsetMailToHostTransmitter(MailToHostTransmitter mailToHostTransmitter)voidsetMxLookup(MxLookup mxLookup)booleansingleDomainOnly()Returns true if the createdImmediateSenderrequires that all recipients of the mail to be sent have the same remote-part.
-
-
-
Method Detail
-
singleDomainOnly
public boolean singleDomainOnly()
Description copied from interface:ImmediateSenderReturns true if the createdImmediateSenderrequires that all recipients of the mail to be sent have the same remote-part.- Specified by:
singleDomainOnlyin interfaceImmediateSender
-
send
public void send(Mail mail) throws SendException, RecipientsWereRejectedException, IllegalArgumentException, PostponeException
Transmits mail to a single domain.- Specified by:
sendin interfaceImmediateSender- Throws:
IllegalArgumentException- if the domains of the recipients are not the same, or if the recipient is the special global postmaster address, which has no absolute domain.PostponeException- if transmission to all of the hosts must be postponed, because all of them are assumed to be busy at this moment.SendExceptionRecipientsWereRejectedException
-
getMxLookup
public MxLookup getMxLookup()
- Category:
- GETSET
-
setMxLookup
public void setMxLookup(MxLookup mxLookup)
- Category:
- GETSET
-
getAddressLookup
public AddressLookup getAddressLookup()
- Category:
- GETSET
-
setAddressLookup
public void setAddressLookup(AddressLookup addressLookup)
- Category:
- GETSET
-
getClientFactory
public ClientFactory getClientFactory()
- Category:
- GETSET
-
setClientFactory
@Inject public void setClientFactory(ClientFactory clientFactory)
- Category:
- GETSET
-
getMailToHostTransmitter
public MailToHostTransmitter getMailToHostTransmitter()
- Category:
- GETSET
-
setMailToHostTransmitter
public void setMailToHostTransmitter(MailToHostTransmitter mailToHostTransmitter)
- Category:
- GETSET
-
-