public final class Responses extends Object
Modifier and Type | Method and Description |
---|---|
static ActionResponse |
newActionResponse(JsonValue json)
Returns a new
JsonValue response with the provided JSON content. |
static QueryResponse |
newQueryResponse()
Creates a new query result with a
null paged results cookie and
no count of the total number of remaining results. |
static QueryResponse |
newQueryResponse(String pagedResultsCookie)
Creates a new query result with the provided paged results cookie and
no count.
|
static QueryResponse |
newQueryResponse(String pagedResultsCookie,
CountPolicy totalPagedResultsPolicy,
int totalPagedResults)
Creates a new query result with the provided paged results cookie and
a count of the total number of remaining results according to
totalPagedResultsPolicy.
|
static QueryResponse |
newRemainingResultsResponse(String pagedResultsCookie,
int remainingPagedResults)
Deprecated.
Use
Responses.newQueryResponse(String, CountPolicy, int) instead. |
static ResourceResponse |
newResourceResponse(String id,
String revision,
JsonValue content)
Returns a new
Resource response with the provided Resource as
content. |
public static ActionResponse newActionResponse(JsonValue json)
JsonValue
response with the provided JSON content.json
- The JSON content.ActionResponse
.public static ResourceResponse newResourceResponse(String id, String revision, JsonValue content)
Resource
response with the provided Resource as
content.id
- The resource ID if applicable otherwise null
.revision
- The resource version, if known.content
- The resource content.Resource
response.public static QueryResponse newQueryResponse()
null
paged results cookie and
no count of the total number of remaining results.QueryResponse
.public static QueryResponse newQueryResponse(String pagedResultsCookie)
pagedResultsCookie
- The opaque cookie which should be used with the next paged
results query request, or null
if paged results were
not requested, or if there are not more pages to be returned.QueryResponse
.public static QueryResponse newQueryResponse(String pagedResultsCookie, CountPolicy totalPagedResultsPolicy, int totalPagedResults)
pagedResultsCookie
- The opaque cookie which should be used with the next paged
results query request, or null
if paged results were
not requested, or if there are not more pages to be returned.totalPagedResultsPolicy
- The policy that was used to calculate totalPagedResultstotalPagedResults
- The total number of paged results requested in adherence to
the QueryRequest.getTotalPagedResultsPolicy()
in the request,
or QueryResponse.NO_COUNT
if paged results were not requested,
the count policy is NONE
, or if the total number of remaining
results is unknown.QueryResponse
.@Deprecated public static QueryResponse newRemainingResultsResponse(String pagedResultsCookie, int remainingPagedResults)
Responses.newQueryResponse(String, CountPolicy, int)
instead.pagedResultsCookie
- The opaque cookie which should be used with the next paged
results query request, or null
if paged results were
not requested, or if there are not more pages to be returned.remainingPagedResults
- An estimate of the total number of remaining results to be
returned in subsequent paged results query requests, or
-1
if paged results were not requested, or if the total
number of remaining results is unknown.QueryResponse
.Copyright © 2010-2018, ForgeRock All Rights Reserved.