Compoze Software, Inc.

com.compoze.mail
Class MessageFilter

java.lang.Object
  |
  +--com.compoze.mail.AbstractMessageFilter
        |
        +--com.compoze.mail.MessageFilter
All Implemented Interfaces:
java.io.Serializable

public class MessageFilter
extends AbstractMessageFilter
implements java.io.Serializable

See Also:
Serialized Form

Fields inherited from class com.compoze.mail.AbstractMessageFilter
m_bFilterOr, m_bOr, m_filter
 
Constructor Summary
MessageFilter()
          Constructor.
 
Method Summary
 boolean accepts(IMessage message)
          Checks if the filter accepts specified message.
 void clearReceivedDate()
          Clears the sent date filter.
 void clearSentDate()
          Clears the sent date filter.
 void clearSubject()
          Clears the subject filter.
 com.compoze.ejb.persistence.database.IFilterRule getFilterRule()
          Gets the filter rule associated with this message filter.
 javax.mail.search.SearchTerm getSearchTerm()
          Gets the search term associated with this message filter.
 java.util.Date getSentDateEnd()
          Gets the sent date end filter (if set).
 java.util.Date getSentDateStart()
          Gets the sent date start filter (if set).
 java.lang.String getSubject()
          Gets the subject filter (if set).
 boolean isReceivedDateSet()
          Checks if the the received date filter is set.
 boolean isSentDateSet()
          Checks if the the sent date filter is set.
 boolean isSubjectExact()
          Checks if the subject exact filter is set.
 boolean isSubjectSet()
          Checks if the subject filter is set.
 void setReceivedDate(java.util.Date startDate, java.util.Date endDate)
          Sets the received date filter to the specified date range.
 void setSentDate(java.util.Date startDate, java.util.Date endDate)
          Sets the sent date filter to the specified date range.
 void setSubject(java.lang.String sSubject)
          Sets the subject filter.
 void setSubject(java.lang.String sSubject, boolean bCaseSensitive, boolean bExact)
          Sets the subject filter.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class com.compoze.mail.AbstractMessageFilter
acceptMessages, addFilter, compareDate, compareString, compareStringStartsWith, getFilter, setOr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageFilter

public MessageFilter()
Constructor.
Method Detail

setSubject

public void setSubject(java.lang.String sSubject)
Sets the subject filter. The search is not exact and case insensitive.
Parameters:
sSubject - the string to filter by

setSubject

public void setSubject(java.lang.String sSubject,
                       boolean bCaseSensitive,
                       boolean bExact)
Sets the subject filter.
Parameters:
sSubject - the string to filter by
bCaseSensitive - true to be case sensitive; false otherwise
bExact - true to be an exact match; false for contains

clearSubject

public void clearSubject()
Clears the subject filter.

isSubjectSet

public boolean isSubjectSet()
Checks if the subject filter is set.
Returns:
true if the subject is set; false otherwise

isSubjectExact

public boolean isSubjectExact()
Checks if the subject exact filter is set.
Returns:
true if the subject is exact; false otherwise

getSubject

public java.lang.String getSubject()
Gets the subject filter (if set).
Returns:
the subject filter or null if not set

setSentDate

public void setSentDate(java.util.Date startDate,
                        java.util.Date endDate)
Sets the sent date filter to the specified date range. A message with an empty sent date is considered a match.
Parameters:
startDate - the start date (exclusive) (may not be null)
endDate - the end date (exclusive) (may not be null)

clearSentDate

public void clearSentDate()
Clears the sent date filter.

isSentDateSet

public boolean isSentDateSet()
Checks if the the sent date filter is set.
Returns:
true if the filter is set; false otherwise

getSentDateStart

public java.util.Date getSentDateStart()
Gets the sent date start filter (if set).
Returns:
the sent date filter or null if not set

getSentDateEnd

public java.util.Date getSentDateEnd()
Gets the sent date end filter (if set).
Returns:
the sent date filter or null if not set

setReceivedDate

public void setReceivedDate(java.util.Date startDate,
                            java.util.Date endDate)
Sets the received date filter to the specified date range. A message with an empty received date is considered a match.
Parameters:
startDate - the start date (exclusive) (may not be null)
endDate - the end date (exclusive) (may not be null)

clearReceivedDate

public void clearReceivedDate()
Clears the sent date filter.

isReceivedDateSet

public boolean isReceivedDateSet()
Checks if the the received date filter is set.
Returns:
true if the filter is set; false otherwise

accepts

public boolean accepts(IMessage message)
                throws MailException
Description copied from class: AbstractMessageFilter
Checks if the filter accepts specified message.
Overrides:
accepts in class AbstractMessageFilter
Following copied from class: com.compoze.mail.AbstractMessageFilter
Parameters:
message - the message to check
Returns:
true if the filter accepts the message; false otherwise

getSearchTerm

public javax.mail.search.SearchTerm getSearchTerm()
Gets the search term associated with this message filter.
Returns:
the search term or null for no filtering

getFilterRule

public com.compoze.ejb.persistence.database.IFilterRule getFilterRule()
Description copied from class: AbstractMessageFilter
Gets the filter rule associated with this message filter.
Overrides:
getFilterRule in class AbstractMessageFilter
Following copied from class: com.compoze.mail.AbstractMessageFilter
Returns:
the filter rule or null for no filtering

toString

public java.lang.String toString()
Returns the string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.