Package org.forgerock.json.resource
Interface QueryResponse
- 
- All Superinterfaces:
- Response
 
 public interface QueryResponse extends Response The final result of a query request returned after all resources matching the request have been returned. In addition to indicating that no more resources are to be returned by the query, the query result will contain page results state information if result paging has been enabled for the query.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringFIELD_ERRORThe name of the field which contains the error in the JSON representation.static StringFIELD_PAGED_RESULTS_COOKIEThe name of the field which contains the paged results cookie in the JSON representation.static StringFIELD_REMAINING_PAGED_RESULTSThe name of the field which contains the remaining paged results in the JSON representation.static StringFIELD_RESULTThe name of the field which contains the array of matching resources in the JSON representation.static StringFIELD_RESULT_COUNTThe name of the field which contains the result count in the JSON representation.static StringFIELD_TOTAL_PAGED_RESULTSThe name of the field which contains the total paged results in the JSON representation.static StringFIELD_TOTAL_PAGED_RESULTS_POLICYThe name of the field which contains the policy used for calculating the total number of paged results in the JSON representation.static intNO_COUNTThe value provided when no count is known or can reasonably be supplied.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Promise<QueryResponse,ResourceException>asPromise()Return this response as a result Promise.StringgetPagedResultsCookie()Returns the opaque cookie which can be used for the next cookie-based paged request.intgetRemainingPagedResults()Returns an estimate of the total number of remaining results to be returned in subsequent paged results query requests.intgetTotalPagedResults()Returns the total number of paged results in adherence with theQueryRequest.getTotalPagedResultsPolicy()in the request orNO_COUNTif paged results were not requested, the count policy isNONE, or the total number of paged results is unknown.CountPolicygetTotalPagedResultsPolicy()Returns the policy that was used to calculate the totalPagedResults.default QueryResponsesetCacheControl(ResponseCacheControl cacheControl)Sets the cache control for this response.- 
Methods inherited from interface org.forgerock.json.resource.ResponsegetCacheControl, getResourceApiVersion, setResourceApiVersion
 
- 
 
- 
- 
- 
Field Detail- 
FIELD_ERRORstatic final String FIELD_ERROR The name of the field which contains the error in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_PAGED_RESULTS_COOKIEstatic final String FIELD_PAGED_RESULTS_COOKIE The name of the field which contains the paged results cookie in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_TOTAL_PAGED_RESULTS_POLICYstatic final String FIELD_TOTAL_PAGED_RESULTS_POLICY The name of the field which contains the policy used for calculating the total number of paged results in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_TOTAL_PAGED_RESULTSstatic final String FIELD_TOTAL_PAGED_RESULTS The name of the field which contains the total paged results in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_REMAINING_PAGED_RESULTSstatic final String FIELD_REMAINING_PAGED_RESULTS The name of the field which contains the remaining paged results in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_RESULT_COUNTstatic final String FIELD_RESULT_COUNT The name of the field which contains the result count in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_RESULTstatic final String FIELD_RESULT The name of the field which contains the array of matching resources in the JSON representation.- See Also:
- Constant Field Values
 
 - 
NO_COUNTstatic final int NO_COUNT The value provided when no count is known or can reasonably be supplied.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getTotalPagedResultsPolicyCountPolicy getTotalPagedResultsPolicy() Returns the policy that was used to calculate the totalPagedResults.- Returns:
- The count policy.
- See Also:
- getTotalPagedResults()
 
 - 
getPagedResultsCookieString getPagedResultsCookie() Returns the opaque cookie which can be used for the next cookie-based paged request. A cookie will only be returned if paged results have been requested via a non-zeropageSize. Cookies are only guaranteed forQueryFilter-based queries. Implicit sorting may be supported by the resource provider but it is not required. Given the arbitrary nature of query expressions (and expression-backed queryIds) there can be no guarantee made of cookie support for these queries.Note:Cookies have a limited lifespan. They should not be stored long-term. Cookies should only be used on immediate subsequent requests or behavior is undefined. - Returns:
- The opaque cookie which should be used with the next cookie-based paged
         results query request, or nullif paged results were not requested, there are no more pages to be returned, or cookies are not supported for this query.
- See Also:
- QueryRequest.getPagedResultsCookie(),- QueryRequest.setPagedResultsCookie(String),- QueryRequest.addSortKey(SortKey...),- QueryRequest.addSortKey(String...)
 
 - 
getTotalPagedResultsint getTotalPagedResults() Returns the total number of paged results in adherence with theQueryRequest.getTotalPagedResultsPolicy()in the request orNO_COUNTif paged results were not requested, the count policy isNONE, or the total number of paged results is unknown.- Returns:
- A count of the total number of paged results to be
         returned in subsequent paged results query requests, or
         NO_COUNTif paged results were not requested, or if the total number of paged results is unknown.
 
 - 
getRemainingPagedResultsint getRemainingPagedResults() Returns an estimate of the total number of remaining results to be returned in subsequent paged results query requests.- Returns:
- An estimate of the total number of remaining results to be
         returned in subsequent paged results query requests, or
         -1if paged results were not requested, or if the total number of remaining results is unknown.
 
 - 
asPromisePromise<QueryResponse,ResourceException> asPromise() Return this response as a result Promise.- Returns:
- A Promise whose result is this QueryResponse object.
 
 - 
setCacheControldefault QueryResponse setCacheControl(ResponseCacheControl cacheControl) Sets the cache control for this response.- Parameters:
- cacheControl- the cache controls to apply to this response.
- Returns:
- this query response.
 
 
- 
 
-