talx x1.0.5

talx.model.filters
Class ReceiverFilterAdapter

java.lang.Object
  extended bytalx.model.filters.ReceiverFilterAdapter
All Implemented Interfaces:
java.util.EventListener, ReceiverFilter, ReceiverFilterListener, TALFeature
Direct Known Subclasses:
CommandFilter, HelpDesk, InboxCountMonitor, InboxDateMonitor, MultiRecipientFilter, OutboxCountMonitor, OutboxDateMonitor, RemoteReceiver, SpyFilter, Survey, TrashDateMonitor

public abstract class ReceiverFilterAdapter
extends java.lang.Object
implements ReceiverFilter

Adapter class for objects in the incoming filter stack. Subclasses will drop or keep messages based on the return value of filterMessage.


Constructor Summary
ReceiverFilterAdapter()
           
 
Method Summary
 void addFilterListener(ReceiverFilterListener l)
           
 void filterActivated(TALMailEvent ev)
          This method is called when the previous filter dropped a message.
protected abstract  boolean filterMessage(javax.mail.internet.MimeMessage msg)
          This method is called by NewMailArrived and OldMailArrived to decide whether to pass the message along.
protected  void fireFilterActivated(TALMailEvent ev)
          This method is called when we wish to send out a event that signifies that we have filtered an email message.
protected  void fireNewMailEvent(TALMailEvent ev)
          This method is called when we wish to send out a event that signifies that a new VALID mail has arrived to this email client.
 void newMailArrived(TALMailEvent ev)
          This method is called when mail arrives that has never been in the system before.
 void release()
          Destroys the listeners list.
 java.lang.String toString()
          Returns the classname of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReceiverFilterAdapter

public ReceiverFilterAdapter()
Method Detail

filterActivated

public void filterActivated(TALMailEvent ev)
This method is called when the previous filter dropped a message. This filter simply passes the filterActivated event on to its listeners.

Specified by:
filterActivated in interface ReceiverFilterListener

newMailArrived

public void newMailArrived(TALMailEvent ev)
This method is called when mail arrives that has never been in the system before. It calls filterMessage to decide whether to pass the message event through the newMailArrived pipeline or shunt it to the filterActivated pipe.

Specified by:
newMailArrived in interface ReceiverFilterListener

addFilterListener

public void addFilterListener(ReceiverFilterListener l)
Specified by:
addFilterListener in interface ReceiverFilter

fireNewMailEvent

protected void fireNewMailEvent(TALMailEvent ev)
This method is called when we wish to send out a event that signifies that a new VALID mail has arrived to this email client. This method is automatically invokes for messages that return true from a call to filterMessage. The protected access is for subclasses that want to initiate new messages for some reason.


fireFilterActivated

protected void fireFilterActivated(TALMailEvent ev)
This method is called when we wish to send out a event that signifies that we have filtered an email message. This method is automatically invokes for messages that return false from a call to filterMessage. The protected access is for subclasses that want to initiate new messages for some reason.


filterMessage

protected abstract boolean filterMessage(javax.mail.internet.MimeMessage msg)
This method is called by NewMailArrived and OldMailArrived to decide whether to pass the message along. Subclasses may wish to have side effects occur in this method as well as the return value.

Parameters:
msg - The message to be filtered by this method.
Returns:
true if the message should be passed along, false if the message should be dropped.

release

public void release()
Destroys the listeners list. Subclasses that override this method to do their own clean-up must also call super.release().

Specified by:
release in interface TALFeature

toString

public java.lang.String toString()
Returns the classname of this filter.


talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.