| java.lang.Object org.apache.mailet.GenericMatcher
All known Subclasses: org.apache.james.transport.matchers.SMTPAuthUserIs, org.apache.james.transport.matchers.CompareNumericHeaderValue, org.apache.james.transport.matchers.smime.IsSMIMEEncrypted, org.apache.james.transport.matchers.FetchedFrom, org.apache.james.transport.matchers.SubjectStartsWith, org.apache.james.transport.matchers.AbstractQuotaMatcher, org.apache.james.transport.matchers.HasMailAttribute, org.apache.james.transport.matchers.HasMailAttributeWithValue, org.apache.james.transport.matchers.GenericRegexMatcher, org.apache.mailet.GenericRecipientMatcher, org.apache.james.transport.matchers.SenderIsNull, org.apache.james.transport.matchers.IsInWhiteList, org.apache.james.transport.matchers.SMTPAuthSuccessful, org.apache.james.transport.matchers.SubjectIs, org.apache.james.transport.matchers.HasHabeasWarrantMark, org.apache.james.transport.matchers.HasAttachment, org.apache.james.transport.matchers.InSpammerBlacklist, org.apache.james.transport.matchers.HasMailAttributeWithValueRegex, org.apache.james.transport.matchers.smime.IsSMIMESigned, org.apache.james.transport.matchers.All, org.apache.james.transport.matchers.AttachmentFileNameIs, org.apache.james.transport.matchers.SenderIsRegex, org.apache.james.transport.matchers.SenderIs, org.apache.james.transport.matchers.SenderHostIs, org.apache.james.transport.matchers.smime.IsX509CertificateSubject, org.apache.james.transport.matchers.RelayLimit, org.apache.james.transport.matchers.AbstractNetworkMatcher, org.apache.james.transport.matchers.HasHeader, org.apache.james.transport.matchers.SizeGreaterThan, org.apache.james.transport.matchers.IsSingleRecipient,
GenericMatcher | abstract public class GenericMatcher implements Matcher,MatcherConfig(Code) | | GenericMatcher implements the Matcher and MatcherConfig interfaces.
GenericMatcher makes writing 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.
To write a generic matcher, you need only override the abstract match method.
version: 1.0.0, 24/04/1999 |
Method Summary | |
public void | destroy() Called by the mailet container to indicate to a matcher that the
matcher is being taken out of service. | public String | getCondition() Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
This method is supplied for convenience. | public MailetContext | getMailetContext() Returns a reference to the MailetContext in which this matcher is
running. | public MatcherConfig | getMatcherConfig() Returns this matcher's MatcherConfig object. | public String | getMatcherInfo() Returns information about the matcher, such as author, version, and
copyright. | public String | getMatcherName() Returns the name of this matcher instance. | public void | init(MatcherConfig newConfig) Called by the matcher container to indicate to a matcher that the
matcher is being placed into service.
This implementation stores the MatcherConfig object it receives from
the matcher container for alter use. | public void | init() A convenience method which can be overridden so that there's no
need to call super.init(config).
Instead of overriding init(MatcherConfig), simply override this
method and it will be called by GenericMatcher.init(MatcherConfig config). | public void | log(String message) Writes the specified message to a matcher log file, prepended by
the matcher's name. | public void | log(String message, Throwable t) Writes an explanatory message and a stack trace for a given Throwable
exception to the matcher log file, prepended by the matcher's name. | abstract public Collection | match(Mail mail) |
destroy | public void destroy()(Code) | | Called by the mailet container to indicate to a matcher that the
matcher is being taken out of service.
|
getCondition | public String getCondition()(Code) | | Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
This method is supplied for convenience. It gets the value of the
named parameter from the matcher's MatcherConfig object.
String a String containing the value of the initalization parameter |
getMailetContext | public MailetContext getMailetContext()(Code) | | Returns a reference to the MailetContext in which this matcher is
running.
MailetContext the MailetContext object passed to this matcher by the init method |
getMatcherConfig | public MatcherConfig getMatcherConfig()(Code) | | Returns this matcher's MatcherConfig object.
MatcherConfig the MatcherConfig object that initialized this matcher |
getMatcherInfo | public String getMatcherInfo()(Code) | | Returns information about the matcher, such as author, version, and
copyright. By default, this method returns an empty string. Override
this method to have it return a meaningful value.
String information about this matcher, by default an empty string |
getMatcherName | public String getMatcherName()(Code) | | Returns the name of this matcher instance.
the name of this matcher instance |
init | public void init(MatcherConfig newConfig) throws MessagingException(Code) | | Called by the matcher container to indicate to a matcher that the
matcher is being placed into service.
This implementation stores the MatcherConfig object it receives from
the matcher container for alter use. When overriding this form of the
method, call super.init(config).
Parameters: MatcherConfig - config - the MatcherConfig object that containsconfigutation information for this matcher throws: MessagingException - if an exception occurs that interrupts the matcher's normal operation |
init | public void init() throws MessagingException(Code) | | A convenience method which can be overridden so that there's no
need to call super.init(config).
Instead of overriding init(MatcherConfig), simply override this
method and it will be called by GenericMatcher.init(MatcherConfig config).
The MatcherConfig object can still be retrieved via getMatcherConfig().
throws: MatcherException - if an exception occurs that interrupts the matcher's normal operation |
log | public void log(String message)(Code) | | Writes the specified message to a matcher log file, prepended by
the matcher's name.
Parameters: msg - - a String specifying the message to be written to the log file |
log | public void log(String message, Throwable t)(Code) | | Writes an explanatory message and a stack trace for a given Throwable
exception to the matcher log file, prepended by the matcher's name.
Parameters: message - - a String that describes the error or exception Parameters: t - - the java.lang.Throwable error or exception |
match | abstract public Collection match(Mail mail) throws MessagingException(Code) | | Called by the matcher container to allow the matcher to process a
message.
This method is declared abstract so subclasses must override it.
Parameters: mail - - the Mail object that contains the MimeMessage androuting information java.util.Collection - the recipients that the mailet container should have themailet affect. throws: javax.mail.MessagingException - - if an exception occurs that interferes with the mailet's normal operationoccurred |
|
|