Package org.xwiki.eventstream.query
Class SimpleEventQuery
- java.lang.Object
-
- org.xwiki.eventstream.query.QueryCondition
-
- org.xwiki.eventstream.query.GroupQueryCondition
-
- org.xwiki.eventstream.query.SimpleEventQuery
-
- All Implemented Interfaces:
EventQuery
,PageableEventQuery
,SortableEventQuery
public class SimpleEventQuery extends GroupQueryCondition implements PageableEventQuery, SortableEventQuery
A very basic implementation ofEventQuery
.- Since:
- 12.4RC1
- Version:
- $Id: 8e61dd15e69e99bb5fbc59a9c365944da423ffe5 $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.xwiki.eventstream.query.SortableEventQuery
SortableEventQuery.SortClause
-
-
Field Summary
-
Fields inherited from class org.xwiki.eventstream.query.GroupQueryCondition
conditions, or, virtual
-
-
Constructor Summary
Constructors Constructor Description SimpleEventQuery()
An empty query.SimpleEventQuery(long offset, long limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SimpleEventQuery
addSort(String property, SortableEventQuery.SortClause.Order order)
Adds a single sort clause to the end of the current sort information.SimpleEventQuery
after(Date date)
SimpleEventQuery
and()
Group together the previous and next condition in a AND group.SimpleEventQuery
before(Date date)
SimpleEventQuery
close()
Stop the current group of conditions.SimpleEventQuery
contains(String property, Object value)
SimpleEventQuery
custom()
Next call will be about custom event parameters.SimpleEventQuery
custom(Type type)
Next call will be about custom event parameters.SimpleEventQuery
endsWith(String property, Object value)
SimpleEventQuery
eq(String property, Object value)
boolean
equals(Object obj)
long
getLimit()
long
getOffset()
List<SortableEventQuery.SortClause>
getSorts()
SimpleEventQuery
greater(String property, Object value)
SimpleEventQuery
greaterOrEq(String property, Object value)
int
hashCode()
SimpleEventQuery
in(String property, Object... values)
SimpleEventQuery
in(String property, List<?> values)
SimpleEventQuery
less(String property, Object value)
SimpleEventQuery
lessOrEq(String property, Object value)
SimpleEventQuery
not()
Reverse the following filter.SimpleEventQuery
open()
Start a new group of conditions.SimpleEventQuery
or()
Group together the previous and next condition in a OR group.SimpleEventQuery
parameter()
Deprecated.usecustom()
insteadSimpleEventQuery
setLimit(long limit)
SimpleEventQuery
setOffset(long offset)
SimpleEventQuery
startsWith(String property, Object value)
String
toString()
SimpleEventQuery
withMail(String entityId)
Select events associated for which the passed entity should receive mails.SimpleEventQuery
withStatus(boolean read)
Select only event associated with the passed status entity.SimpleEventQuery
withStatus(String entityId)
Select only event associated with the passed status entity.SimpleEventQuery
withStatus(String entityId, boolean read)
Select only event associated with the passed status entity.-
Methods inherited from class org.xwiki.eventstream.query.GroupQueryCondition
getConditions, isOr
-
Methods inherited from class org.xwiki.eventstream.query.QueryCondition
isReversed
-
-
-
-
Method Detail
-
getLimit
public long getLimit()
- Specified by:
getLimit
in interfacePageableEventQuery
- Returns:
- limit the maximum number of events to return, -1 for no limit (0 return no results)
- See Also:
setLimit(long)
-
setLimit
public SimpleEventQuery setLimit(long limit)
- Parameters:
limit
- the maximum number of events to return, -1 for no limit (0 return no results)- Returns:
- this query.
-
getOffset
public long getOffset()
- Specified by:
getOffset
in interfacePageableEventQuery
- Returns:
- offset the index where to start returning events
- See Also:
setOffset(long)
-
setOffset
public SimpleEventQuery setOffset(long offset)
- Parameters:
offset
- the index where to start returning events- Returns:
- this query.
-
not
public SimpleEventQuery not()
Reverse the following filter.- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
or
public SimpleEventQuery or()
Group together the previous and next condition in a OR group.- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
and
public SimpleEventQuery and()
Group together the previous and next condition in a AND group.- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
parameter
@Deprecated(since="14.2RC1") public SimpleEventQuery parameter()
Deprecated.usecustom()
insteadNext call will be about custom event parameters.- Returns:
- this
SimpleEventQuery
- Since:
- 13.9RC1
-
custom
public SimpleEventQuery custom()
Next call will be about custom event parameters.- Returns:
- this
SimpleEventQuery
- Since:
- 14.2RC1
-
custom
public SimpleEventQuery custom(Type type)
Next call will be about custom event parameters.- Parameters:
type
- the type in which that property was stored- Returns:
- this
SimpleEventQuery
- Since:
- 14.2RC1
-
open
public SimpleEventQuery open()
Start a new group of conditions.- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
close
public SimpleEventQuery close()
Stop the current group of conditions.- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
eq
public SimpleEventQuery eq(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should be equal to- Returns:
- this
SimpleEventQuery
-
less
public SimpleEventQuery less(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should be equal to- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
lessOrEq
public SimpleEventQuery lessOrEq(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should be equal to- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
greater
public SimpleEventQuery greater(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should be equal to- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
greaterOrEq
public SimpleEventQuery greaterOrEq(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should be equal to- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
startsWith
public SimpleEventQuery startsWith(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should starts with- Returns:
- this
SimpleEventQuery
- Since:
- 14.0RC1
-
endsWith
public SimpleEventQuery endsWith(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should ends with- Returns:
- this
SimpleEventQuery
- Since:
- 14.0RC1
-
contains
@Unstable public SimpleEventQuery contains(String property, Object value)
- Parameters:
property
- the name of the propertyvalue
- the value the property should contain- Returns:
- this
SimpleEventQuery
- Since:
- 14.4RC1
-
before
public SimpleEventQuery before(Date date)
- Parameters:
date
- the date before which events should be selected- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
after
public SimpleEventQuery after(Date date)
- Parameters:
date
- the date after which the events should be selected- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
in
public SimpleEventQuery in(String property, List<?> values)
- Parameters:
property
- the name of the propertyvalues
- the values to compare to the property- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
in
public SimpleEventQuery in(String property, Object... values)
- Parameters:
property
- the name of the propertyvalues
- the values to compare to the property- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
withStatus
public SimpleEventQuery withStatus(String entityId)
Select only event associated with the passed status entity.- Parameters:
entityId
- event status entity id- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
withStatus
public SimpleEventQuery withStatus(String entityId, boolean read)
Select only event associated with the passed status entity.- Parameters:
entityId
- event status entity idread
- indicate if read or unread statues should selected, null for all- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
withStatus
public SimpleEventQuery withStatus(boolean read)
Select only event associated with the passed status entity.- Parameters:
read
- indicate if read or unread events should be selected, null if disabled- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
withMail
public SimpleEventQuery withMail(String entityId)
Select events associated for which the passed entity should receive mails.- Parameters:
entityId
- the identifier of the entity that should receive the mail- Returns:
- this
SimpleEventQuery
- Since:
- 12.6
-
getSorts
public List<SortableEventQuery.SortClause> getSorts()
- Specified by:
getSorts
in interfaceSortableEventQuery
- Returns:
- the sort clauses
-
addSort
public SimpleEventQuery addSort(String property, SortableEventQuery.SortClause.Order order)
Adds a single sort clause to the end of the current sort information.- Parameters:
property
- the property nameorder
- the sort order- Returns:
- this
SimpleEventQuery
- Since:
- 12.5RC1
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGroupQueryCondition
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classGroupQueryCondition
-
toString
public String toString()
- Overrides:
toString
in classGroupQueryCondition
-
-