|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.mail.smtp.proc.MailFilter SK.gnome.dwarf.mail.smtp.proc.filter.RecipientFilter
Provides generic recipient-based filter.
The abstract filterRecipient(Recipient)
method must be implemented by any
subclass. It decides whether the given recipient will be passed through the filter or not.
If the checkOriginal
attribute is set to true, the original recipient address
taken from the ORCPT parameter of SMTP protocol will be tested only. If it is not present,
the filter will behave as with this feature disabled. This feature may be used to test
the original address of recipient if it was expanded from an alias name.
Field Summary | |
protected boolean |
checkOriginal
Whether to check the original recipient address. |
Fields inherited from class SK.gnome.dwarf.mail.smtp.proc.MailFilter |
condition, context |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
RecipientFilter(java.lang.String name)
|
Method Summary | |
protected java.util.Collection |
filter(MailAgentMessage message,
java.util.Collection recipients)
Filters the given message. |
protected abstract boolean |
filterRecipient(Recipient recipient)
Decides whether the recipient will be passed through the filter. |
void |
setCheckOriginal(boolean enable)
|
Methods inherited from class SK.gnome.dwarf.mail.smtp.proc.MailFilter |
destroy, init, setCondition |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, init, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, shutdown, start, stop, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean checkOriginal
Constructor Detail |
public RecipientFilter(java.lang.String name)
Method Detail |
public void setCheckOriginal(boolean enable)
protected java.util.Collection filter(MailAgentMessage message, java.util.Collection recipients) throws MailException
MailFilter
Matches the message and its recipients with the given MailFilter.condition
. If the matching
process fails, an empty collection is returned. Otherwise, the method returns a collection
of recipients which meets the given condition. If the condition is not based on the message
recipients, the returned collection will contain all message recipients. If the matching is
based on the recipients, the collection will contain only those ones, which actually meets
the recipient-based condition.
Method must return a new Collection object each time it is called.
filter
in class MailFilter
message
- the queued messagerecipients
- the input collection of recipients
MailException
- if an error occuredprotected abstract boolean filterRecipient(Recipient recipient) throws MailException
recipient
- the particular recipient
MailException
- if an error occured
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |