Compoze Software, Inc.

com.compoze.discussion
Class MessageFilter

java.lang.Object
  |
  +--com.compoze.ebusiness.AbstractFilter
        |
        +--com.compoze.discussion.MessageFilter
All Implemented Interfaces:
java.io.Serializable

public class MessageFilter
extends AbstractFilter
implements java.io.Serializable

This class represents a message filter. A message filter is used to restrict the messages that are returned as they are iterated over in a Messages collection. By setting properties in this filter, the messages that are returned include only those messages with properties that are the same. All string searches are a case-insensitive substring search.

See the Messages class for futher details and examples on how to filter messages.

See Also:
Serialized Form

Fields inherited from class com.compoze.ebusiness.AbstractFilter
m_rules, m_where
 
Constructor Summary
MessageFilter()
          Constructor.
 
Method Summary
 void appendFilter(MessageFilter filter, boolean bOr)
          Appends the filter to this filter.
 void clearFilters()
          Clears all filter that are appended to this filter.
 com.compoze.ejb.persistence.database.IFilterRule getFilterRule()
           
 java.util.List getFilters()
          Gets a unmodifiable list of message filters appended to this filter.
 long[] getForums()
          Gets the forums to filter by.
 void removeFilter(MessageFilter filter)
          Removes the filter from this filter.
 void setApprovalStatus(ApprovalStatus status)
          Sets the filtering by approval status.
 void setApprovalStatus(ApprovalStatus[] status)
          Sets the filtering by approval status.
 void setAuthor(java.lang.String sAuthor)
          Sets filtering by author.
 void setAuthor(java.lang.String[] authors)
          Sets filtering by author.
 void setAuthor(java.lang.String[] authors, boolean bExactMatch)
          Sets filtering by authors.
 void setAuthor(java.lang.String sAuthor, boolean bExactMatch)
          Sets filtering by author.
 void setBody(java.lang.String sBody)
          Sets filtering by body.
 void setBody(java.lang.String[] body)
          Sets filtering by body.
 void setBody(java.lang.String[] body, boolean bExactMatch)
          Sets filtering by body.
 void setBody(java.lang.String sBody, boolean bExactMatch)
          sets filtering by body.
 void setCustomNum1(long lCustomNum1)
          Sets filtering by the custom num1 field.
 void setCustomNum1(long[] customNum1s)
          Sets filtering by the custom num1 field.
 void setCustomNum1(long lCustomNum1, boolean bGreaterThan)
          Sets filtering by the custom num1 field.
 void setCustomNum1(long lFromCount, long lToCount)
          Sets filtering by custom num1 between the specified range.
 void setCustomNum2(long lCustomNum2)
          Sets filtering by the custom num2 field.
 void setCustomNum2(long[] customNum2s)
          Sets filtering by the custom num2 field.
 void setCustomNum2(long lCustomNum2, boolean bGreaterThan)
          Sets filtering by the custom num2 field.
 void setCustomNum2(long lFromCount, long lToCount)
          Sets filtering by custom num2 between the specified range.
 void setCustomNum3(long lCustomNum3)
          Sets filtering by the custom num3 field.
 void setCustomNum3(long[] customNum3s)
          Sets filtering by the custom num3 field.
 void setCustomNum3(long lCustomNum3, boolean bGreaterThan)
          Sets filtering by the custom num3 field.
 void setCustomNum3(long lFromCount, long lToCount)
          Sets filtering by custom num3 between the specified range.
 void setCustomNum4(long lCustomNum4)
          Sets filtering by the custom num4 field.
 void setCustomNum4(long[] customNum4s)
          Sets filtering by the custom num4 field.
 void setCustomNum4(long lCustomNum4, boolean bGreaterThan)
          Sets filtering by the custom num4 field.
 void setCustomNum4(long lFromCount, long lToCount)
          Sets filtering by custom num4 between the specified range.
 void setCustomStr1(java.lang.String sCustomStr1)
          Sets filtering by custom str1.
 void setCustomStr1(java.lang.String[] customString1s)
          Sets filtering by custom str1.
 void setCustomStr1(java.lang.String[] customString1s, boolean bExactMatch)
          Sets filtering by custom str1.
 void setCustomStr1(java.lang.String sCustomStr1, boolean bExactMatch)
          Sets filtering by custom str1.
 void setCustomStr2(java.lang.String sCustomStr2)
          Sets filtering by custom str2.
 void setCustomStr2(java.lang.String[] customString2s)
          Sets filtering by custom str2.
 void setCustomStr2(java.lang.String[] customString2s, boolean bExactMatch)
          Sets filtering by custom str2.
 void setCustomStr2(java.lang.String sCustomStr2, boolean bExactMatch)
          Sets filtering by custom str2.
 void setCustomStr3(java.lang.String sCustomStr3)
          Sets filtering by custom str3.
 void setCustomStr3(java.lang.String[] customString3s)
          Sets filtering by custom str3.
 void setCustomStr3(java.lang.String[] customString3s, boolean bExactMatch)
          Sets filtering by custom str3.
 void setCustomStr3(java.lang.String sCustomStr3, boolean bExactMatch)
          Sets filtering by custom str3.
 void setCustomStr4(java.lang.String sCustomStr4)
          Sets filtering by custom str4.
 void setCustomStr4(java.lang.String[] customString4s)
          Sets filtering by custom str4.
 void setCustomStr4(java.lang.String[] customString4s, boolean bExactMatch)
          Sets filtering by custom str4.
 void setCustomStr4(java.lang.String sCustomStr4, boolean bExactMatch)
          Sets filtering by custom str4.
 void setDateCreated(java.util.Date startDate, java.util.Date endDate)
          Sets filtering by a date created range.
 void setDateLastModified(java.util.Date startDate, java.util.Date endDate)
          Sets filtering by a date last modified range.
 void setForum(long lForumID)
          Sets the filtering by forum.
 void setForum(long[] forumIDs)
          Sets the filtering by multiple forums.
 void setKeywords(java.lang.String sKeywords)
          Sets filtering by keywords.
 void setKeywords(java.lang.String[] keywords)
          Sets filtering by keywords.
 void setKeywords(java.lang.String[] keywords, boolean bExactMatch)
          Sets filtering by keyword.
 void setKeywords(java.lang.String sKeywords, boolean bExactMatch)
          sets filtering by keywords.
 void setMessageCount(int iCount, boolean bGreaterThan)
          Sets filtering by message count.
 void setMessageCount(int iFromCount, int iToCount)
          Sets filtering by message count between the specified range.
 void setParentMessage(long lParentMessageID)
          Sets the filtering by parent message id.
 void setParentMessage(long[] parentMessageIDs)
          Sets the filtering by multiple parent messages.
 void setSubject(java.lang.String sSubject)
          Sets filtering by subject.
 void setSubject(java.lang.String[] subjects)
          Sets filtering by subject.
 void setSubject(java.lang.String[] subjects, boolean bExactMatch)
          Sets filtering by subject.
 void setSubject(java.lang.String sSubject, boolean bExactMatch)
          Sets filtering by subject.
 void setTopic(long lTopicID)
          Sets the filtering by topic.
 void setTopic(long[] topicIDs)
          Sets the filtering by multiple topics.
 void unsetApprovalStatus()
          Unsets the filtering by approval status.
 void unsetAuthor()
          Unsets filterting by author.
 void unsetBody()
          Unsets filterting by body.
 void unsetCustomNum1()
          Unsets filtering by custom num1.
 void unsetCustomNum2()
          Unsets filtering by custom num2.
 void unsetCustomNum3()
          Unsets filtering by custom num3.
 void unsetCustomNum4()
          Unsets filtering by custom num4.
 void unsetCustomStr1()
          Unsets filterting by custom str1.
 void unsetCustomStr2()
          Unsets filterting by custom str2.
 void unsetCustomStr3()
          Unsets filterting by custom str3.
 void unsetCustomStr4()
          Unsets filterting by custom str4.
 void unsetDateCreated()
          Unsets filtering by date created.
 void unsetDateLastModified()
          Unsets filtering by date last modified.
 void unsetForum()
          Unsets filtering by forum.
 void unsetKeyword()
          Unsets filterting by keyword.
 void unsetMessageCount()
          Unsets filtering by message count.
 void unsetParentMessage()
          Unsets filtering by parent message.
 void unsetSubject()
          Unsets filterting by subject.
 void unsetTopic()
          Unsets filtering by topic.
 
Methods inherited from class com.compoze.ebusiness.AbstractFilter
clearWhereClause, getBaseRule, getOr, getWhereClause, isEmpty, setBeginsRule, setGreaterThanRule, setLessThanRule, setNotRule, setOr, setRule, setRule, setRule, setRule, setRule, setRule, setRule, setRule, setRule, setRule, setWhereClause, toRule, toString, unsetBeginsRule, unsetNotRule
 
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

appendFilter

public void appendFilter(MessageFilter filter,
                         boolean bOr)
Appends the filter to this filter.
Parameters:
filter - the filter the append
bOr - true to append this filter with an 'or'; false to use 'and'

removeFilter

public void removeFilter(MessageFilter filter)
Removes the filter from this filter.
Parameters:
filter - the filter to remove

clearFilters

public void clearFilters()
Clears all filter that are appended to this filter.

getFilters

public java.util.List getFilters()
Gets a unmodifiable list of message filters appended to this filter.
Returns:
an unmodifiable list of MessageFilter objects

setSubject

public void setSubject(java.lang.String sSubject)
Sets filtering by subject. Checks the subject match as a substring of the subject.
Parameters:
sSubject - the subject
See Also:
setSubject(String, boolean)

setSubject

public void setSubject(java.lang.String sSubject,
                       boolean bExactMatch)
Sets filtering by subject.
Parameters:
sSubject - the subject
bExactMatch - true for an exact match of the string subject; false to match as substring subject

setSubject

public void setSubject(java.lang.String[] subjects)
Sets filtering by subject. Checks the subject match as a substring of the subject.
Parameters:
subjects - the subjects
See Also:
setSubject(String[], boolean)

setSubject

public void setSubject(java.lang.String[] subjects,
                       boolean bExactMatch)
Sets filtering by subject.
Parameters:
subjects - the subjects
exact - true for an exact match of the subjects; false to match a substring

unsetSubject

public void unsetSubject()
Unsets filterting by subject.

setBody

public void setBody(java.lang.String sBody)
Sets filtering by body. Checks the body match as a substring of the body.
Parameters:
sBody - the body
See Also:
setBody(String, boolean)

setBody

public void setBody(java.lang.String sBody,
                    boolean bExactMatch)
sets filtering by body.
Parameters:
sBody - the body
bExactMatch - true for an exact match of the string body; false to match as substring body

setBody

public void setBody(java.lang.String[] body)
Sets filtering by body. Checks the body match as a substring of the body.
Parameters:
body - the body
See Also:
setBody(String[], boolean)

setBody

public void setBody(java.lang.String[] body,
                    boolean bExactMatch)
Sets filtering by body.
Parameters:
body - the body
exact - true for an exact match of the body; false to match a substring

unsetBody

public void unsetBody()
Unsets filterting by body.

setKeywords

public void setKeywords(java.lang.String sKeywords)
Sets filtering by keywords. Checks the keywords match as a substring of the keywords.
Parameters:
sKeywords - the keywords
See Also:
setKeywords(String, boolean)

setKeywords

public void setKeywords(java.lang.String sKeywords,
                        boolean bExactMatch)
sets filtering by keywords.
Parameters:
sKeywords - the keywords
bExactMatch - true for an exact match of the string keywords; false to match as substring keywords

setKeywords

public void setKeywords(java.lang.String[] keywords)
Sets filtering by keywords. Checks the keywords match as a substring of the keywords.
Parameters:
keywords - the keywords
See Also:
setKeywords(String[], boolean)

setKeywords

public void setKeywords(java.lang.String[] keywords,
                        boolean bExactMatch)
Sets filtering by keyword.
Parameters:
keywords - the keywords
exact - true for an exact match of the body; false to match a substring

unsetKeyword

public void unsetKeyword()
Unsets filterting by keyword.

setAuthor

public void setAuthor(java.lang.String sAuthor)
Sets filtering by author. Checks the author match as a substring of the author.
Parameters:
sAuthor - the author
See Also:
setAuthor(String, boolean)

setAuthor

public void setAuthor(java.lang.String sAuthor,
                      boolean bExactMatch)
Sets filtering by author.
Parameters:
sAuthor - the author
bExactMatch - true for an exact match of the string author; false to match as substring author

setAuthor

public void setAuthor(java.lang.String[] authors)
Sets filtering by author. Checks the author match as a substring of the author.
Parameters:
authors - the authors
See Also:
setAuthor(String[], boolean)

setAuthor

public void setAuthor(java.lang.String[] authors,
                      boolean bExactMatch)
Sets filtering by authors.
Parameters:
authors - the authors
bExactMatch - true for an exact match of the authors; false to match a substring

unsetAuthor

public void unsetAuthor()
Unsets filterting by author.

setApprovalStatus

public void setApprovalStatus(ApprovalStatus status)
Sets the filtering by approval status. This method is only effective if the caller is a moderator for the forum that owns the message.
Parameters:
status - the status to filter by (may not be null)

setApprovalStatus

public void setApprovalStatus(ApprovalStatus[] status)
Sets the filtering by approval status. This method is only effective if the caller is a moderator for the forum that owns the message.
Parameters:
status - an array of approval status to filter by (may not be null)

unsetApprovalStatus

public void unsetApprovalStatus()
Unsets the filtering by approval status.

setForum

public void setForum(long lForumID)
Sets the filtering by forum.
Parameters:
lForumID - the forum id to filter by

setForum

public void setForum(long[] forumIDs)
Sets the filtering by multiple forums.
Parameters:
forumIDs - an array of forum ids to filter by

unsetForum

public void unsetForum()
Unsets filtering by forum.

getForums

public long[] getForums()
Gets the forums to filter by.
Returns:
the forum to filter by or null if not set

setTopic

public void setTopic(long lTopicID)
Sets the filtering by topic.
Parameters:
lTopicID - the topic id to filter by

setTopic

public void setTopic(long[] topicIDs)
Sets the filtering by multiple topics.
Parameters:
topicIDs - an array of topic ids to filter by

unsetTopic

public void unsetTopic()
Unsets filtering by topic.

setParentMessage

public void setParentMessage(long lParentMessageID)
Sets the filtering by parent message id.
Parameters:
lParentMessageID - the parent message id to filter by

setParentMessage

public void setParentMessage(long[] parentMessageIDs)
Sets the filtering by multiple parent messages.
Parameters:
parentMessageIDs - an array of parent message ids to filter by

unsetParentMessage

public void unsetParentMessage()
Unsets filtering by parent message.

setMessageCount

public void setMessageCount(int iCount,
                            boolean bGreaterThan)
Sets filtering by message count.
Parameters:
iCount - the message count
bGreaterThan - true for message count greater than specified count; false for message count less than specified count
See Also:
setMessageCount(int,int)

setMessageCount

public void setMessageCount(int iFromCount,
                            int iToCount)
Sets filtering by message count between the specified range. The iFromCount must be less than the iToCount.
Parameters:
iFromCount - the message count low range
iToCount - the message count high range

unsetMessageCount

public void unsetMessageCount()
Unsets filtering by message count.

setDateCreated

public void setDateCreated(java.util.Date startDate,
                           java.util.Date endDate)
Sets filtering by a date created range.
Parameters:
startDate - the date created start range
endDate - the date created end range

unsetDateCreated

public void unsetDateCreated()
Unsets filtering by date created.

setDateLastModified

public void setDateLastModified(java.util.Date startDate,
                                java.util.Date endDate)
Sets filtering by a date last modified range.
Parameters:
startDate - the date last modified start range
endDate - the date last modified end range

unsetDateLastModified

public void unsetDateLastModified()
Unsets filtering by date last modified.

setCustomNum1

public void setCustomNum1(long[] customNum1s)
Sets filtering by the custom num1 field.
Parameters:
lCustomNum1 - the custom num1

setCustomNum1

public void setCustomNum1(long lCustomNum1)
Sets filtering by the custom num1 field.
Parameters:
lCustomNum1 - the custom num1

setCustomNum1

public void setCustomNum1(long lCustomNum1,
                          boolean bGreaterThan)
Sets filtering by the custom num1 field.
Parameters:
lCustomNum1 - the custom num1
bGreaterThan - true for custom num1 greater than specified number; false for custom num1 less than specified number

setCustomNum1

public void setCustomNum1(long lFromCount,
                          long lToCount)
Sets filtering by custom num1 between the specified range. The lFromCount must be less than the lToCount.
Parameters:
lFromCount - the custom num1 low range
lToCount - the custom num1 high range

unsetCustomNum1

public void unsetCustomNum1()
Unsets filtering by custom num1.

setCustomNum2

public void setCustomNum2(long[] customNum2s)
Sets filtering by the custom num2 field.
Parameters:
lCustomNum2 - the custom num2

setCustomNum2

public void setCustomNum2(long lCustomNum2)
Sets filtering by the custom num2 field.
Parameters:
lCustomNum2 - the custom num2

setCustomNum2

public void setCustomNum2(long lCustomNum2,
                          boolean bGreaterThan)
Sets filtering by the custom num2 field.
Parameters:
lCustomNum2 - the custom num2
bGreaterThan - true for custom num2 greater than specified number; false for custom num2 less than specified number

setCustomNum2

public void setCustomNum2(long lFromCount,
                          long lToCount)
Sets filtering by custom num2 between the specified range. The lFromCount must be less than the lToCount.
Parameters:
lFromCount - the custom num2 low range
lToCount - the custom num2 high range

unsetCustomNum2

public void unsetCustomNum2()
Unsets filtering by custom num2.

setCustomNum3

public void setCustomNum3(long[] customNum3s)
Sets filtering by the custom num3 field.
Parameters:
lCustomNum3 - the custom num3

setCustomNum3

public void setCustomNum3(long lCustomNum3)
Sets filtering by the custom num3 field.
Parameters:
lCustomNum3 - the custom num3

setCustomNum3

public void setCustomNum3(long lCustomNum3,
                          boolean bGreaterThan)
Sets filtering by the custom num3 field.
Parameters:
lCustomNum3 - the custom num3
bGreaterThan - true for custom num3 greater than specified number; false for custom num3 less than specified number

setCustomNum3

public void setCustomNum3(long lFromCount,
                          long lToCount)
Sets filtering by custom num3 between the specified range. The lFromCount must be less than the lToCount.
Parameters:
lFromCount - the custom num1 low range
lToCount - the custom num1 high range

unsetCustomNum3

public void unsetCustomNum3()
Unsets filtering by custom num3.

setCustomNum4

public void setCustomNum4(long[] customNum4s)
Sets filtering by the custom num4 field.
Parameters:
lCustomNum4 - the custom num4

setCustomNum4

public void setCustomNum4(long lCustomNum4)
Sets filtering by the custom num4 field.
Parameters:
lCustomNum4 - the custom num4

setCustomNum4

public void setCustomNum4(long lCustomNum4,
                          boolean bGreaterThan)
Sets filtering by the custom num4 field.
Parameters:
lCustomNum4 - the custom num4
bGreaterThan - true for custom num4 greater than specified number; false for custom num4 less than specified number

setCustomNum4

public void setCustomNum4(long lFromCount,
                          long lToCount)
Sets filtering by custom num4 between the specified range. The lFromCount must be less than the lToCount.
Parameters:
lFromCount - the custom num1 low range
lToCount - the custom num1 high range

unsetCustomNum4

public void unsetCustomNum4()
Unsets filtering by custom num4.

setCustomStr1

public void setCustomStr1(java.lang.String sCustomStr1)
Sets filtering by custom str1. Checks the custom str1 match as a substring of the custom str1.
Parameters:
sCustomStr1 - the Custom String1
See Also:
setCustomStr1(String, boolean)

setCustomStr1

public void setCustomStr1(java.lang.String sCustomStr1,
                          boolean bExactMatch)
Sets filtering by custom str1.
Parameters:
sCustomStr1 - the custom str1
bExactMatch - true for an exact match of the string custom str1; false to match as substring custom str1

setCustomStr1

public void setCustomStr1(java.lang.String[] customString1s)
Sets filtering by custom str1. Checks the custom str1 match as a substring of the custom str1.
Parameters:
customString1s - the custom string1s
See Also:
setCustomStr1(String[], boolean)

setCustomStr1

public void setCustomStr1(java.lang.String[] customString1s,
                          boolean bExactMatch)
Sets filtering by custom str1.
Parameters:
customString1s - the custom string1s
exact - true for an exact match of the custom string1s; false to match a substring

unsetCustomStr1

public void unsetCustomStr1()
Unsets filterting by custom str1.

setCustomStr2

public void setCustomStr2(java.lang.String sCustomStr2)
Sets filtering by custom str2. Checks the custom str2 match as a substring of the custom str2.
Parameters:
sCustomStr2 - the Custom String2
See Also:
setCustomStr2(String, boolean)

setCustomStr2

public void setCustomStr2(java.lang.String sCustomStr2,
                          boolean bExactMatch)
Sets filtering by custom str2.
Parameters:
sCustomStr2 - the custom str2
bExactMatch - true for an exact match of the string custom str2; false to match as substring custom str2

setCustomStr2

public void setCustomStr2(java.lang.String[] customString2s)
Sets filtering by custom str2. Checks the custom str2 match as a substring of the custom str2.
Parameters:
customString2s - the custom string2s
See Also:
setCustomStr2(String[], boolean)

setCustomStr2

public void setCustomStr2(java.lang.String[] customString2s,
                          boolean bExactMatch)
Sets filtering by custom str2.
Parameters:
customString2s - the custom string2s
exact - true for an exact match of the custom string2s; false to match a substring

unsetCustomStr2

public void unsetCustomStr2()
Unsets filterting by custom str2.

setCustomStr3

public void setCustomStr3(java.lang.String sCustomStr3)
Sets filtering by custom str3. Checks the custom str3 match as a substring of the custom str3.
Parameters:
sCustomStr3 - the Custom String3
See Also:
setCustomStr3(String, boolean)

setCustomStr3

public void setCustomStr3(java.lang.String sCustomStr3,
                          boolean bExactMatch)
Sets filtering by custom str3.
Parameters:
sCustomStr3 - the custom str3
bExactMatch - true for an exact match of the string custom str3; false to match as substring custom str3

setCustomStr3

public void setCustomStr3(java.lang.String[] customString3s)
Sets filtering by custom str3. Checks the custom str3 match as a substring of the custom str3.
Parameters:
customString3s - the custom string3s
See Also:
setCustomStr3(String[], boolean)

setCustomStr3

public void setCustomStr3(java.lang.String[] customString3s,
                          boolean bExactMatch)
Sets filtering by custom str3.
Parameters:
customString3s - the custom string3s
exact - true for an exact match of the custom string3s; false to match a substring

unsetCustomStr3

public void unsetCustomStr3()
Unsets filterting by custom str3.

setCustomStr4

public void setCustomStr4(java.lang.String sCustomStr4)
Sets filtering by custom str4. Checks the custom str4 match as a substring of the custom str4.
Parameters:
sCustomStr4 - the Custom String4
See Also:
setCustomStr4(String, boolean)

setCustomStr4

public void setCustomStr4(java.lang.String sCustomStr4,
                          boolean bExactMatch)
Sets filtering by custom str4.
Parameters:
sCustomStr4 - the custom str4
bExactMatch - true for an exact match of the string custom str4; false to match as substring custom str4

setCustomStr4

public void setCustomStr4(java.lang.String[] customString4s)
Sets filtering by custom str4. Checks the custom str4 match as a substring of the custom str4.
Parameters:
customString4s - the custom string4s
See Also:
setCustomStr4(String[], boolean)

setCustomStr4

public void setCustomStr4(java.lang.String[] customString4s,
                          boolean bExactMatch)
Sets filtering by custom str4.
Parameters:
customString4s - the custom string4s
exact - true for an exact match of the custom string4s; false to match a substring

unsetCustomStr4

public void unsetCustomStr4()
Unsets filterting by custom str4.

getFilterRule

public com.compoze.ejb.persistence.database.IFilterRule getFilterRule()
Overrides:
getFilterRule in class AbstractFilter

Compoze Software, Inc.

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