org.peabody.emailprocessor
Class RegexMessageHook
java.lang.Object
org.peabody.emailprocessor.AbstractMessageHook
org.peabody.emailprocessor.RegexMessageHook
- All Implemented Interfaces:
- MessageHook
- Direct Known Subclasses:
- BounceMessageHook
public abstract class RegexMessageHook
- extends AbstractMessageHook
This is a MessageHook that uses a regular expression matched against
the entire message (including headers and body). Most simple text-search
based message hooks will want to extend from this class.
This class also implements full-text caching of the content of messages
so that each Message object is converted to plain text only once, instead
of again for each RegexMessageHook.
NOTE: Regular expressions must match the entire message,
this means that you will probably want to surround your regex with something
like: .*MAIN_REGEX_HERE.*
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CACHE_REFRESH_PERIOD
public static int CACHE_REFRESH_PERIOD
generalCacheAdministrator
protected static com.opensymphony.oscache.general.GeneralCacheAdministrator generalCacheAdministrator
pattern
protected java.util.regex.Pattern pattern
RegexMessageHook
public RegexMessageHook(java.lang.String aRegex,
int aFlags)
RegexMessageHook
public RegexMessageHook(java.lang.String aRegex)
- Creates a new instance of RegexMessageHook
getPattern
protected java.util.regex.Pattern getPattern()
setPattern
protected void setPattern(java.util.regex.Pattern aPattern)
getMatch
public MessageMatch getMatch(javax.mail.Message aMessage)
createMessageMatch
protected abstract MessageMatch createMessageMatch(javax.mail.Message aMessage,
java.lang.String aMessageText,
java.util.regex.Matcher aMatcher)