Package org.forgerock.json.resource.http
Class HttpUtils
- java.lang.Object
-
- org.forgerock.json.resource.http.HttpUtils
-
public final class HttpUtils extends Object
HTTP utility methods and constants.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_DISPOSITIONthe HTTP header for Content-Disposition.static VersionDEFAULT_PROTOCOL_VERSIONThe default version of the named protocol.static StringPARAM_ACTIONthe HTTP request parameter for an action.static StringPARAM_COUNT_ONLYthe HTTP request parameter to request only the count of results.static StringPARAM_CREST_APIRequest the CREST API Descriptor.static StringPARAM_FIELDSthe HTTP request parameter to specify which fields to return.static StringPARAM_MIME_TYPEthe HTTP request parameter to request a certain mimetype for a field.static StringPARAM_PAGE_SIZEthe HTTP request parameter to request a certain page size.static StringPARAM_PAGED_RESULTS_COOKIEthe HTTP request parameter to specify a paged results cookie.static StringPARAM_PAGED_RESULTS_OFFSETthe HTTP request parameter to specify a paged results offset.static StringPARAM_PRETTY_PRINTthe HTTP request parameter to request pretty printing.static StringPARAM_QUERY_EXPRESSIONthe HTTP request parameter to specify a query expression.static StringPARAM_QUERY_FILTERthe HTTP request parameter to specify a query filter.static StringPARAM_QUERY_IDthe HTTP request parameter to specify a query id.static StringPARAM_SORT_KEYSthe HTTP request parameter to specify the sort keys.static StringPARAM_TOTAL_PAGED_RESULTS_POLICYThe policy used for counting total paged results.static VersionPROTOCOL_VERSION_1Protocol Version 1.static VersionPROTOCOL_VERSION_2Protocol Version 2 - supports upsert on PUT.static VersionPROTOCOL_VERSION_2_1Protocol Version 2.1 - supports defacto standard for create requests when the ID of the created resource is to be allocated by the server, which are represented as a POST to the collection endpoint without an_actionquery parameter.static VersionPROTOCOL_VERSION_2_2Protocol Version 2.2 - supports _countOnly parameter on query requests to indicate that only a count of the resources matching the supplied query filter on the resource collection are returned.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RequestTypedetermineRequestType(Request request)Determines which CREST operation (CRUDPAQ) of the incoming request.
-
-
-
Field Detail
-
CONTENT_DISPOSITION
public static final String CONTENT_DISPOSITION
the HTTP header for Content-Disposition.- See Also:
- Constant Field Values
-
PARAM_ACTION
public static final String PARAM_ACTION
the HTTP request parameter for an action.
-
PARAM_FIELDS
public static final String PARAM_FIELDS
the HTTP request parameter to specify which fields to return.
-
PARAM_MIME_TYPE
public static final String PARAM_MIME_TYPE
the HTTP request parameter to request a certain mimetype for a field.
-
PARAM_PAGE_SIZE
public static final String PARAM_PAGE_SIZE
the HTTP request parameter to request a certain page size.
-
PARAM_PAGED_RESULTS_COOKIE
public static final String PARAM_PAGED_RESULTS_COOKIE
the HTTP request parameter to specify a paged results cookie.
-
PARAM_PAGED_RESULTS_OFFSET
public static final String PARAM_PAGED_RESULTS_OFFSET
the HTTP request parameter to specify a paged results offset.
-
PARAM_PRETTY_PRINT
public static final String PARAM_PRETTY_PRINT
the HTTP request parameter to request pretty printing.- See Also:
- Constant Field Values
-
PARAM_QUERY_EXPRESSION
public static final String PARAM_QUERY_EXPRESSION
the HTTP request parameter to specify a query expression.
-
PARAM_QUERY_FILTER
public static final String PARAM_QUERY_FILTER
the HTTP request parameter to specify a query filter.
-
PARAM_QUERY_ID
public static final String PARAM_QUERY_ID
the HTTP request parameter to specify a query id.
-
PARAM_SORT_KEYS
public static final String PARAM_SORT_KEYS
the HTTP request parameter to specify the sort keys.
-
PARAM_TOTAL_PAGED_RESULTS_POLICY
public static final String PARAM_TOTAL_PAGED_RESULTS_POLICY
The policy used for counting total paged results.
-
PARAM_COUNT_ONLY
public static final String PARAM_COUNT_ONLY
the HTTP request parameter to request only the count of results.
-
PARAM_CREST_API
public static final String PARAM_CREST_API
Request the CREST API Descriptor.
-
PROTOCOL_VERSION_1
public static final Version PROTOCOL_VERSION_1
Protocol Version 1.
-
PROTOCOL_VERSION_2
public static final Version PROTOCOL_VERSION_2
Protocol Version 2 - supports upsert on PUT.
-
PROTOCOL_VERSION_2_1
public static final Version PROTOCOL_VERSION_2_1
Protocol Version 2.1 - supports defacto standard for create requests when the ID of the created resource is to be allocated by the server, which are represented as a POST to the collection endpoint without an_actionquery parameter.
-
PROTOCOL_VERSION_2_2
public static final Version PROTOCOL_VERSION_2_2
Protocol Version 2.2 - supports _countOnly parameter on query requests to indicate that only a count of the resources matching the supplied query filter on the resource collection are returned.
-
DEFAULT_PROTOCOL_VERSION
public static final Version DEFAULT_PROTOCOL_VERSION
The default version of the named protocol.
-
-
Method Detail
-
determineRequestType
public static RequestType determineRequestType(Request request) throws ResourceException
Determines which CREST operation (CRUDPAQ) of the incoming request.- Parameters:
request- The request.- Returns:
- The Operation.
- Throws:
ResourceException- If the request operation could not be determined or is not supported.
-
-