com.goldeninnovations.smp.messagefilter
Class MessageFilterChain

java.lang.Object
  extended by com.goldeninnovations.smp.messagefilter.MessageFilterChain
All Implemented Interfaces:
MessageFilter

public class MessageFilterChain
extends Object
implements MessageFilter

Allows multiple MessageFilters to be chained together. All filters must return true for a message to be accepted.


Constructor Summary
MessageFilterChain()
           
 
Method Summary
 boolean acceptMessage(EmailAddress recipient, InetAddress senderAddress, EmailAddress sender)
          Checks with the MessageFilters and returns true only if they all accept the message
 void addMessageFilter(MessageFilter filter)
          Adds a new MessageFilter to the chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFilterChain

public MessageFilterChain()
Method Detail

acceptMessage

public boolean acceptMessage(EmailAddress recipient,
                             InetAddress senderAddress,
                             EmailAddress sender)
Checks with the MessageFilters and returns true only if they all accept the message

Specified by:
acceptMessage in interface MessageFilter
Parameters:
recipient - the recipient to test. The email address specified in the RCPT TO command.
senderAddress - the Internet Address of the SMTP client.
sender - The email address specified in the MAIL FROM command.
Returns:
true if the message should be accepted, false otherwise.

addMessageFilter

public void addMessageFilter(MessageFilter filter)
Adds a new MessageFilter to the chain.

Parameters:
filter - the messageFilter to add.


Copyright © 2010 Eric Daugherty. All Rights Reserved.