QueryResultClass - Type of individual query result. Must be ReferenceType or a type derived
from QueryResultRecordType.public static interface VcdClient.Query<QueryResultClass>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_PAGE_SIZE |
| Modifier and Type | Method and Description |
|---|---|
ListIterator<VcdClient.QueryListPage<QueryResultClass>> |
execute()
Executes the query and returns an iterator over list of pages of results.
|
QueryResultClass |
findUnique()
Convenience wrapper over
execute() for the case where exactly one match
is expected. |
static org.apache.cxf.jaxrs.ext.search.client.SearchConditionBuilder |
getFilterBuilder()
Return a
SearchConditionBuilder - Apache CXF's FIQL Query builder configured for
use as per URL query format requirements |
VcdClient.Query<QueryResultClass> |
setEqualityFilter(String attributeName,
String attributeValue)
Sets equality filter to query that the specified attribute name has the specified value.
|
VcdClient.Query<QueryResultClass> |
setFields(Collection<String> fields)
Sets query fields.
|
VcdClient.Query<QueryResultClass> |
setFilter(String filter)
Sets query filter.
|
VcdClient.Query<QueryResultClass> |
setIncludeLinks(boolean includeLinks)
Sets flag for including links in query results.
|
VcdClient.Query<QueryResultClass> |
setPage(int page)
Sets page number to retrieve.
|
VcdClient.Query<QueryResultClass> |
setPageSize(int pageSize)
Sets page size.
|
VcdClient.Query<QueryResultClass> |
setQueryResultFormat(QueryResultFormat queryResultFormat)
Sets query result format.
|
VcdClient.Query<QueryResultClass> |
setSortAsc(String fieldName)
Sets ascending sort order by specified field.
|
VcdClient.Query<QueryResultClass> |
setSortDesc(String fieldName)
Sets descending sort order by specified field.
|
Stream<QueryResultClass> |
stream()
Executes the query and returns an
Stream of all results over all pages |
static final int DEFAULT_MAX_PAGE_SIZE
VcdClient.Query<QueryResultClass> setQueryResultFormat(QueryResultFormat queryResultFormat)
By default, query result format is set to QueryResultFormat.RECORDS if
QueryResultClass is derived from QueryResultRecordType and
QueryResultFormat.REFERENCES if QueryResultClass is ReferenceType.
When QueryResultClass is derived from QueryResultRecordType this method
can be used to override result format with QueryResultFormat.ID_RECORDS.
queryResultFormat - Desired query result formatthis instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setPage(int page)
By default query execution retrieves first page.
page - page number; must be >= 1this instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setPageSize(int pageSize)
By default, page size configured in VCD is used.
pageSize - number of records per page; must be >= 1this instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setFilter(String filter)
This expects specified filter to be URL encoded. Call to this method will replace an existing filter.
filter - query filterthis instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setFields(Collection<String> fields)
Comma-separated list of attribute names or metadata key names to return.
fields - query fieldsthis instance to enable chaining of method invocationsstatic org.apache.cxf.jaxrs.ext.search.client.SearchConditionBuilder getFilterBuilder()
SearchConditionBuilder - Apache CXF's FIQL Query builder configured for
use as per URL query format requirementsSearchConditionBuilder FIQL query builderVcdClient.Query<QueryResultClass> setEqualityFilter(String attributeName, String attributeValue)
This URL encodes the specified attribute value. Call to this method will append the specified filter to an existing query filter.
attributeName - name of the attribute whose value is to be queries.attributeValue - value of the attribute being queried.this instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setSortDesc(String fieldName)
fieldName - field to sort bythis instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setSortAsc(String fieldName)
fieldName - field to sort bythis instance to enable chaining of method invocationsVcdClient.Query<QueryResultClass> setIncludeLinks(boolean includeLinks)
includeLinks - boolean indicating whether to include links in queries or notthis instance to enable chaining of method
invocationsListIterator<VcdClient.QueryListPage<QueryResultClass>> execute()
next() returns the
requested page.
The returned iterator doesn't support mutating operations: add, set, and
remove. Invoking corresponding methods will result in
UnsupportedOperationException.
Stream<QueryResultClass> stream()
Stream of all results over all pages
QueryResultClass findUnique()
execute() for the case where exactly one match
is expected.MissingRecordException - if the number of matches is zeroMultipleRecordsException - if the number of matches is greatr than 1Copyright © 2019 VMware. All rights reserved.