com.atlassian.crowd.search.query.entity
Class EntityQuery<T>

java.lang.Object
  extended by com.atlassian.crowd.search.query.entity.EntityQuery<T>
All Implemented Interfaces:
Query<T>
Direct Known Subclasses:
AliasQuery, ApplicationQuery, DirectoryQuery, GroupQuery, TokenQuery, UserQuery

public abstract class EntityQuery<T>
extends Object
implements Query<T>


Field Summary
static int ALL_RESULTS
          Flag to indicate that an EntityQuery should retrieve all results.
static int MAX_MAX_RESULTS
          This is the recommended maximum number of 'max' results the system will allow you to return.
 
Constructor Summary
EntityQuery(Class<T> returnType, EntityDescriptor entityDescriptor, SearchRestriction searchRestriction, int startIndex, int maxResults)
           
EntityQuery(EntityQuery<T> query, int startIndex, int maxResults)
           
EntityQuery(EntityQuery query, Class<T> returnType)
           
 
Method Summary
 boolean equals(Object o)
           
 EntityDescriptor getEntityDescriptor()
           
 int getMaxResults()
          The maximum number of elements to return.
 Class<T> getReturnType()
          The type of elements to return.
 SearchRestriction getSearchRestriction()
          Restrictions to apply to the query.
 int getStartIndex()
          The index of the first element to return.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_MAX_RESULTS

public static final int MAX_MAX_RESULTS
This is the recommended maximum number of 'max' results the system will allow you to return. This value is NOT enforced. ApplicationServiceGeneric often retrieves (startIndex + maxResults) number of results which breaks this MAX_MAX_RESULTS.

See Also:
Constant Field Values

ALL_RESULTS

public static final int ALL_RESULTS
Flag to indicate that an EntityQuery should retrieve all results.

WARNING: using this flag could retrieve thousands or millions of entities. Misuse can cause massive performance problems. This flag should only ever be used in exceptional circumstances.

If you need to find "all" entities, then consider making multiple successive calls to Crowd to receive partial results. That way, the entire result set is never stored in memory on the Crowd server at any one time.

See Also:
Constant Field Values
Constructor Detail

EntityQuery

public EntityQuery(Class<T> returnType,
                   EntityDescriptor entityDescriptor,
                   SearchRestriction searchRestriction,
                   int startIndex,
                   int maxResults)

EntityQuery

public EntityQuery(EntityQuery query,
                   Class<T> returnType)

EntityQuery

public EntityQuery(EntityQuery<T> query,
                   int startIndex,
                   int maxResults)
Method Detail

getEntityDescriptor

public EntityDescriptor getEntityDescriptor()

getSearchRestriction

public SearchRestriction getSearchRestriction()
Description copied from interface: Query
Restrictions to apply to the query. Typically finding users of a given name, etc.

Specified by:
getSearchRestriction in interface Query<T>
Returns:
the search resctiction to apply to this query.

getStartIndex

public int getStartIndex()
Description copied from interface: Query
The index of the first element to return.

Specified by:
getStartIndex in interface Query<T>
Returns:
a positive index value.

getMaxResults

public int getMaxResults()
Description copied from interface: Query
The maximum number of elements to return.

Specified by:
getMaxResults in interface Query<T>
Returns:
a number of elements.

getReturnType

public Class<T> getReturnType()
Description copied from interface: Query
The type of elements to return.

Specified by:
getReturnType in interface Query<T>
Returns:
the expected type of elements to be returned by the search.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Atlassian. All Rights Reserved.