org.apache.mailet.base
Class GenericRecipientMatcher

java.lang.Object
  extended by org.apache.mailet.base.GenericMatcher
      extended by org.apache.mailet.base.GenericRecipientMatcher
All Implemented Interfaces:
Matcher, MatcherConfig
Direct Known Subclasses:
CommandForListserv, CommandListservMatcher, HostIs, HostIsLocal, RecipientIs, RecipientIsLocal, RecipientIsRegex, UserIs

public abstract class GenericRecipientMatcher
extends GenericMatcher

GenericMatcher makes writing recipient based matchers easier. It provides simple versions of the lifecycle methods init and destroy and of the methods in the MatcherConfig interface. GenericMatcher also implements the log method, declared in the MatcherContext interface.

Version:
1.0.0, 24/04/1999

Constructor Summary
GenericRecipientMatcher()
           
 
Method Summary
 Collection<MailAddress> match(Mail mail)
          Matches each recipient one by one through matchRecipient(MailAddress recipient) method.
abstract  boolean matchRecipient(MailAddress recipient)
          Simple check to match exclusively on the email address (not message information).
 
Methods inherited from class org.apache.mailet.base.GenericMatcher
destroy, getCondition, getMailetContext, getMatcherConfig, getMatcherInfo, getMatcherName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericRecipientMatcher

public GenericRecipientMatcher()
Method Detail

match

public final Collection<MailAddress> match(Mail mail)
                                    throws javax.mail.MessagingException
Matches each recipient one by one through matchRecipient(MailAddress recipient) method. Handles splitting the recipients Collection as appropriate.

Specified by:
match in interface Matcher
Specified by:
match in class GenericMatcher
Parameters:
mail - - the message and routing information to determine whether to match
Returns:
Collection the Collection of MailAddress objects that have been matched
Throws:
javax.mail.MessagingException - if any error occurs which prevents the Mail matching from completing successfully

matchRecipient

public abstract boolean matchRecipient(MailAddress recipient)
                                throws javax.mail.MessagingException
Simple check to match exclusively on the email address (not message information).

Parameters:
recipient - - the address to determine whether to match
Returns:
boolean whether the recipient is a match
Throws:
javax.mail.MessagingException


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.