|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mailboxmanager.SearchQuery
public class SearchQuery
Models a query used to search for messages. A query is the logical
AND
of the contained criteria.
Each Criterion
is composed of an Operator
(combining value and operation) together with field information (optional
since the criteria type may imply a particular field). Factory methods are
provided for criteria.
Nested Class Summary | |
---|---|
static class |
SearchQuery.AllCriterion
Any message. |
static class |
SearchQuery.BooleanOperator
Boolean value search. |
static class |
SearchQuery.ConjunctionCriterion
Conjuction applying to the contained criteria. |
static class |
SearchQuery.ContainsOperator
Contained value search. |
static class |
SearchQuery.Criterion
Marker superclass for criteria. |
static class |
SearchQuery.CustomFlagCriterion
Filters on a custom flag valuation. |
static class |
SearchQuery.DateOperator
Operates on a date. |
static class |
SearchQuery.ExistsOperator
Existance search. |
static class |
SearchQuery.FlagCriterion
Filters on a standard flag. |
static class |
SearchQuery.HeaderCriterion
Header value content search. |
static interface |
SearchQuery.HeaderOperator
Marks operator as suitable for header value searching. |
static class |
SearchQuery.InOperator
Search for numbers within set of ranges. |
static class |
SearchQuery.InternalDateCriterion
Filters on the internal date. |
static class |
SearchQuery.NumericOperator
Searches numberic values. |
static class |
SearchQuery.NumericRange
Numbers within a particular range. |
static interface |
SearchQuery.Operator
Search operator. |
static class |
SearchQuery.SizeCriterion
Filters on the size of the message in octets. |
static class |
SearchQuery.TextCriterion
Message text. |
static class |
SearchQuery.UidCriterion
Filters on message identity. |
Constructor Summary | |
---|---|
SearchQuery()
|
Method Summary | |
---|---|
static SearchQuery.Criterion |
all()
Creates a filter matching all messages. |
static SearchQuery.Criterion |
and(java.util.List criteria)
Creates a filter composing the listed criteria. |
static SearchQuery.Criterion |
and(SearchQuery.Criterion one,
SearchQuery.Criterion two)
Creates a filter composing the two different criteria. |
void |
andCriteria(SearchQuery.Criterion crit)
|
static SearchQuery.Criterion |
bodyContains(java.lang.String value)
Creates a filter matching messages which contains the given text within the body. |
boolean |
equals(java.lang.Object obj)
|
static SearchQuery.Criterion |
flagIsSet(javax.mail.Flags.Flag flag)
Creates a filter on the given flag selecting messages where the given flag is selected. |
static SearchQuery.Criterion |
flagIsSet(java.lang.String flag)
Creates a filter on the given flag selecting messages where the given flag is selected. |
static SearchQuery.Criterion |
flagIsUnSet(javax.mail.Flags.Flag flag)
Creates a filter on the given flag selecting messages where the given flag is not selected. |
static SearchQuery.Criterion |
flagIsUnSet(java.lang.String flag)
Creates a filter on the given flag selecting messages where the given flag is not selected. |
static SearchQuery.Criterion |
flagSet(javax.mail.Flags.Flag flag,
boolean isSet)
Creates a filter on the given flag. |
static SearchQuery.Criterion |
flagSet(java.lang.String flag,
boolean isSet)
Creates a filter on the given flag. |
java.util.List |
getCriterias()
|
java.util.Set |
getRecentMessageUids()
Gets the UIDS of messages which are recent for this client session. |
int |
hashCode()
|
static SearchQuery.Criterion |
headerContains(java.lang.String headerName,
java.lang.String value)
Creates a filter matching messages whose header value contains the given value. |
static SearchQuery.Criterion |
headerDateAfter(java.lang.String headerName,
int day,
int month,
int year)
Creates a filter matching messages with the date of the given header after the given date. |
static SearchQuery.Criterion |
headerDateBefore(java.lang.String headerName,
int day,
int month,
int year)
Creates a filter matching messages with the date of the given header before the given date. |
static SearchQuery.Criterion |
headerDateOn(java.lang.String headerName,
int day,
int month,
int year)
Creates a filter matching messages with the date of the given header on the given date. |
static SearchQuery.Criterion |
headerExists(java.lang.String headerName)
Creates a filter matching messages with a header matching the given name. |
static SearchQuery.Criterion |
internalDateAfter(int day,
int month,
int year)
Creates a filter matching messages with internal date after the given date. |
static SearchQuery.Criterion |
internalDateBefore(int day,
int month,
int year)
Creates a filter matching messages with internal date before the given date. |
static SearchQuery.Criterion |
internalDateOn(int day,
int month,
int year)
Creates a filter matching messages with internal date on the given date. |
static SearchQuery.Criterion |
mailContains(java.lang.String value)
Creates a filter matching messages which contains the given text either within the body or in the headers. |
static SearchQuery.Criterion |
not(SearchQuery.Criterion criterion)
Creates a filter inverting the given criteria. |
static SearchQuery.Criterion |
or(SearchQuery.Criterion one,
SearchQuery.Criterion two)
Creates a filter composing the two different criteria. |
static SearchQuery.Criterion |
sizeEquals(long value)
Creates a filter for message size equal to the given value |
static SearchQuery.Criterion |
sizeGreaterThan(long value)
Creates a filter for message size greater than the given value |
static SearchQuery.Criterion |
sizeLessThan(long value)
Creates a filter for message size less than the given value |
java.lang.String |
toString()
|
static SearchQuery.Criterion |
uid(SearchQuery.NumericRange[] range)
Creates a filter matching messages within any of the given ranges. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SearchQuery()
Method Detail |
---|
public static final SearchQuery.Criterion sizeLessThan(long value)
value
- messages with size less than this value will be selected by
the returned criterion
Criterion
, not nullpublic static final SearchQuery.Criterion sizeGreaterThan(long value)
value
- messages with size greater than this value will be selected by
the returned criterion
Criterion
, not nullpublic static final SearchQuery.Criterion sizeEquals(long value)
value
- messages with size equal to this value will be selected by the
returned criterion
Criterion
, not nullpublic static final SearchQuery.Criterion internalDateAfter(int day, int month, int year)
day
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion internalDateOn(int day, int month, int year)
day
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion internalDateBefore(int day, int month, int year)
day
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion headerDateAfter(java.lang.String headerName, int day, int month, int year)
headerName
- name of the header whose value will be compared, not nullday
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion headerDateOn(java.lang.String headerName, int day, int month, int year)
headerName
- name of the header whose value will be compared, not nullday
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion headerDateBefore(java.lang.String headerName, int day, int month, int year)
headerName
- name of the header whose value will be compared, not nullday
- one based day of the monthmonth
- one based month of the yearyear
- year
Criterion
, not nullpublic static final SearchQuery.Criterion headerContains(java.lang.String headerName, java.lang.String value)
headerName
- name of the header whose value will be compared, not nullvalue
- when null or empty the existance of the header will be
checked, otherwise contained value
Criterion
, not nullpublic static final SearchQuery.Criterion headerExists(java.lang.String headerName)
headerName
- name of the header whose value will be compared, not null
Criterion
, not nullpublic static final SearchQuery.Criterion mailContains(java.lang.String value)
value
- search value
Criterion
, not nullpublic static final SearchQuery.Criterion bodyContains(java.lang.String value)
value
- search value
Criterion
, not nullpublic static final SearchQuery.Criterion uid(SearchQuery.NumericRange[] range)
range
- NumericRange
's, not null
Criterion
, not nullpublic static final SearchQuery.Criterion or(SearchQuery.Criterion one, SearchQuery.Criterion two)
one
- Criterion
, not nulltwo
- Criterion
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion and(SearchQuery.Criterion one, SearchQuery.Criterion two)
one
- Criterion
, not nulltwo
- Criterion
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion and(java.util.List criteria)
criteria
- List
of SearchQuery.Criterion
Criterion
, not nullpublic static final SearchQuery.Criterion not(SearchQuery.Criterion criterion)
criterion
- Criterion
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion flagSet(javax.mail.Flags.Flag flag, boolean isSet)
flag
- Flag
, not nullisSet
- true if the messages with the flag set should be matched,
false otherwise
Criterion
, not nullpublic static final SearchQuery.Criterion flagIsSet(javax.mail.Flags.Flag flag)
flag
- Flag
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion flagIsUnSet(javax.mail.Flags.Flag flag)
flag
- Flag
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion flagSet(java.lang.String flag, boolean isSet)
flag
- Flag
, not nullisSet
- true if the messages with the flag set should be matched,
false otherwise
Criterion
, not nullpublic static final SearchQuery.Criterion flagIsSet(java.lang.String flag)
flag
- Flag
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion flagIsUnSet(java.lang.String flag)
flag
- Flag
, not null
Criterion
, not nullpublic static final SearchQuery.Criterion all()
Criterion
, not nullpublic void andCriteria(SearchQuery.Criterion crit)
public java.util.List getCriterias()
public java.util.Set getRecentMessageUids()
Set
of Long
UIDSpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |