public interface HttpStatusCodeProvider
A status code provider maps an HTTP status code to a JSON-RPC result code (e.g. -32000 -> 500).
From version 2.0 on the JSON-RPC specification is not explicitly documenting the mapping of result/error codes, so this provider can be used to configure application specific HTTP status codes for a given JSON-RPC error code.
The default implementation DefaultHttpStatusCodeProvider
follows the rules defined in the
JSON-RPC over HTTP document.
Modifier and Type | Method and Description |
---|---|
int |
getHttpStatusCode(int resultCode)
Returns an HTTP status code for the given response and result code.
|
java.lang.Integer |
getJsonRpcCode(int httpStatusCode)
Returns result code for the given HTTP status code
|
int getHttpStatusCode(int resultCode)
resultCode
- the result code of the current JSON-RPC method call. This is used to look up the HTTP status
code.java.lang.Integer getJsonRpcCode(int httpStatusCode)
httpStatusCode
- the int representation of the HTTP status code that should be used by the JSON-RPC response.