Package org.forgerock.json.resource
Class Responses
- java.lang.Object
- 
- org.forgerock.json.resource.Responses
 
- 
 public final class Responses extends Object A utility class containing various factory methods for creating and manipulating responses.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ActionResponsenewActionResponse(JsonValue json)Returns a newJsonValueresponse with the provided JSON content.static QueryResponsenewQueryResponse()Creates a new query result with anullpaged results cookie and no count of the total number of remaining results.static QueryResponsenewQueryResponse(String pagedResultsCookie)Creates a new query result with the provided paged results cookie and no count.static QueryResponsenewQueryResponse(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 QueryResponsenewRemainingResultsResponse(String pagedResultsCookie, int remainingPagedResults)Deprecated.UsenewQueryResponse(String, CountPolicy, int)instead.static ResourceResponsenewResourceResponse(String id, String revision, JsonValue content)Returns a newResourceresponse with the provided Resource as content.
 
- 
- 
- 
Method Detail- 
newActionResponsepublic static ActionResponse newActionResponse(JsonValue json) Returns a newJsonValueresponse with the provided JSON content.- Parameters:
- json- The JSON content.
- Returns:
- The new ActionResponse.
 
 - 
newResourceResponsepublic static ResourceResponse newResourceResponse(String id, String revision, JsonValue content) Returns a newResourceresponse with the provided Resource as content.- Parameters:
- id- The resource ID if applicable otherwise- null.
- revision- The resource version, if known.
- content- The resource content.
- Returns:
- The new Resourceresponse.
 
 - 
newQueryResponsepublic static QueryResponse newQueryResponse() Creates a new query result with anullpaged results cookie and no count of the total number of remaining results.- Returns:
- The new QueryResponse.
 
 - 
newQueryResponsepublic static QueryResponse newQueryResponse(String pagedResultsCookie) Creates a new query result with the provided paged results cookie and no count.- Parameters:
- pagedResultsCookie- The opaque cookie which should be used with the next paged results query request, or- nullif paged results were not requested, or if there are not more pages to be returned.
- Returns:
- The new QueryResponse.
 
 - 
newQueryResponsepublic 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.- Parameters:
- pagedResultsCookie- The opaque cookie which should be used with the next paged results query request, or- nullif paged results were not requested, or if there are not more pages to be returned.
- totalPagedResultsPolicy- The policy that was used to calculate totalPagedResults
- totalPagedResults- The total number of paged results requested in adherence to the- QueryRequest.getTotalPagedResultsPolicy()in the request, or- QueryResponse.NO_COUNTif paged results were not requested, the count policy is- NONE, or if the total number of remaining results is unknown.
- Returns:
- The new QueryResponse.
 
 - 
newRemainingResultsResponse@Deprecated public static QueryResponse newRemainingResultsResponse(String pagedResultsCookie, int remainingPagedResults) Deprecated.UsenewQueryResponse(String, CountPolicy, int)instead.Creates a new query result with the provided paged results cookie and an estimate of the total number of remaining results.- Parameters:
- pagedResultsCookie- The opaque cookie which should be used with the next paged results query request, or- nullif 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- -1if paged results were not requested, or if the total number of remaining results is unknown.
- Returns:
- The new QueryResponse.
 
 
- 
 
-