de.malowa.suggestions.delay
Class OptimisticDelay

java.lang.Object
  extended by de.malowa.suggestions.delay.OptimisticDelay
All Implemented Interfaces:
DelayRule

public class OptimisticDelay
extends java.lang.Object
implements DelayRule

Subtracts 55 minutes of delay time. In combination with just DefaultDelayRule the delay time is reduced to 5 minutes. This is a good base for further delay rules.

Author:
Marcel Lohmann

Constructor Summary
OptimisticDelay()
           
 
Method Summary
 int getDelayTime(SMTPInformation mail)
          Returns the delay in minutes for the given SMTP mail header.
 int getDelayTimeWithHistory(SMTPInformation info, MailHistory history)
          Returns the delay in minutes for the given SMTP mail header.
 void update()
          Will be called regularly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimisticDelay

public OptimisticDelay()
Method Detail

getDelayTime

public int getDelayTime(SMTPInformation mail)
Description copied from interface: DelayRule
Returns the delay in minutes for the given SMTP mail header. Will be used for calculation of initial delay while inserting into greylist database.

Specified by:
getDelayTime in interface DelayRule
Parameters:
mail - SMTP information to utilize
Returns:
minutes to delay. May be zero or negative
See Also:
DelayRule.getDelayTime(de.malowa.greylister.SMTPInformation)

getDelayTimeWithHistory

public int getDelayTimeWithHistory(SMTPInformation info,
                                   MailHistory history)
Description copied from interface: DelayRule
Returns the delay in minutes for the given SMTP mail header. Will be used for calculation of further delay when SMTP header is already known to the greylist database. May delegate to DelayRule.getDelayTime(SMTPInformation) without considering history.

Specified by:
getDelayTimeWithHistory in interface DelayRule
Parameters:
info - SMTP information to utilize
history - the history of past delivery attempts to utilize
Returns:
minutes to delay. May be zero or negative
See Also:
DelayRule.getDelayTimeWithHistory(de.malowa.greylister.SMTPInformation, de.malowa.greylister.MailHistory)

update

public void update()
Description copied from interface: DelayRule
Will be called regularly. Can be used to reread any necessary data for calculation.

Specified by:
update in interface DelayRule
See Also:
DelayRule.update()