Class JSONRPC2WebAPIConfiguration
- All Implemented Interfaces:
LoggableConfiguration
The configuration is stored as public fields which become immutable (final) after their initialisation.
Property keys: [prefix]*
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default expose exceptions policy.static final boolean
The default request processing time reporting.static final String
The default response content type.final boolean
Iftrue
the web service will expose exception details to clients in the JSON-RPC 2.0 error "data" field.final boolean
Iftrue
enables reporting of request processing time by appending a non-standard "xProcTime" attribute to the JSON-RPC 2.0 responses.final String
The value of the HTTP "Content-Type" header for the JSON-RPC 2.0 responses.Fields inherited from interface com.nimbusds.common.config.LoggableConfiguration
LOG_CATEGORY
-
Constructor Summary
ConstructorDescriptionJSONRPC2WebAPIConfiguration
(String prefix, Properties props) Creates a JSON-RPC 2.0 web API configuration from the specified properties. -
Method Summary
-
Field Details
-
responseContentType
The value of the HTTP "Content-Type" header for the JSON-RPC 2.0 responses.Typically set to
application/json;charset=utf-8
or totext/plain;charset=utf-8
to support browser CORS requests.Note that the charset must always be defined and set to
utf-8
.Property key: [prefix]responseContentType
-
DEFAULT_RESPONSE_CONTENT_TYPE
The default response content type.- See Also:
-
exposeExceptions
If
true
the web service will expose exception details to clients in the JSON-RPC 2.0 error "data" field. Use this setting for debugging purposes or if the web clients are trusted.If
false
the web service will not provide any exception details in JSON-RPC 2.0 errors. Use this setting if the web clients are not trusted or if they don't need to know details about encountered exceptions.Property key: [prefix]exposeExceptions
-
DEFAULT_EXPOSE_EXCEPTIONS
The default expose exceptions policy.- See Also:
-
reportRequestProcTime
Iftrue
enables reporting of request processing time by appending a non-standard "xProcTime" attribute to the JSON-RPC 2.0 responses.Intended for debugging and testing purposes. Disabled by default to prevent parse exceptions by clients which don't allow unexpected JSON attributes in the JSON-RPC 2.0 response messages.
Property key: [prefix]reportRequestProcTime
-
DEFAULT_REPORT_REQUEST_PROC_TIME
The default request processing time reporting.- See Also:
-
-
Constructor Details
-
JSONRPC2WebAPIConfiguration
public JSONRPC2WebAPIConfiguration(String prefix, Properties props) throws com.thetransactioncompany.util.PropertyParseException Creates a JSON-RPC 2.0 web API configuration from the specified properties.Mandatory properties:
- none
Optional properties, with defaults:
- [prefix]responseContentType = application/json; charset=utf-8
- [prefix]exposeExceptions = false
- [prefix]reportRequestProcTime = false
- Parameters:
prefix
- The properties prefix. Must not benull
.props
- The properties. Must not benull
.- Throws:
com.thetransactioncompany.util.PropertyParseException
- On a missing or invalid property.
-
-
Method Details
-
log
Logs the configuration details at INFO level.- Specified by:
log
in interfaceLoggableConfiguration
-