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 Details

    • newActionResponse

      public static ActionResponse newActionResponse(JsonValue json)
      Returns a new JsonValue response with the provided JSON content.
      Parameters:
      json - The JSON content.
      Returns:
      The new ActionResponse.
    • newResourceResponse

      public static ResourceResponse newResourceResponse(String id, String revision, JsonValue content)
      Returns a new Resource response 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 Resource response.
    • newQueryResponse

      public static QueryResponse newQueryResponse()
      Creates a new query result with a null paged results cookie and no count of the total number of remaining results.
      Returns:
      The new QueryResponse.
    • newQueryResponse

      public 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 null if paged results were not requested, or if there are not more pages to be returned.
      Returns:
      The new QueryResponse.
    • newQueryResponse

      public 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 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 totalPagedResults
      totalPagedResults - 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.
      Returns:
      The new QueryResponse.
    • newRemainingResultsResponse

      @Deprecated public static QueryResponse newRemainingResultsResponse(String pagedResultsCookie, int remainingPagedResults)
      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 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.
      Returns:
      The new QueryResponse.