LoggableConfiguration
public class JSONRPC2WebAPIConfiguration extends Object implements LoggableConfiguration
The configuration is stored as public fields which become immutable (final) after their initialisation.
Property keys: [prefix]*
Modifier and Type | Field | Description |
---|---|---|
static boolean |
DEFAULT_EXPOSE_EXCEPTIONS |
The default expose exceptions policy.
|
static boolean |
DEFAULT_REPORT_REQUEST_PROC_TIME |
The default request processing time reporting.
|
static String |
DEFAULT_RESPONSE_CONTENT_TYPE |
The default response content type.
|
boolean |
exposeExceptions |
If
true the web service will expose exception details to
clients in the JSON-RPC 2.0 error "data" field. |
boolean |
reportRequestProcTime |
If
true enables reporting of request processing time by
appending a non-standard "xProcTime" attribute to the JSON-RPC 2.0
responses. |
String |
responseContentType |
The value of the HTTP "Content-Type" header for the JSON-RPC 2.0
responses.
|
LOG_CATEGORY
Constructor | Description |
---|---|
JSONRPC2WebAPIConfiguration(String prefix,
Properties props) |
Creates a JSON-RPC 2.0 web API configuration from the specified
properties.
|
public final String responseContentType
Typically set to application/json;charset=utf-8
or to
text/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
public static final String DEFAULT_RESPONSE_CONTENT_TYPE
public final boolean 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
public static final boolean DEFAULT_EXPOSE_EXCEPTIONS
public final boolean reportRequestProcTime
true
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
public static final boolean DEFAULT_REPORT_REQUEST_PROC_TIME
public JSONRPC2WebAPIConfiguration(String prefix, Properties props) throws com.thetransactioncompany.util.PropertyParseException
Mandatory properties:
Optional properties, with defaults:
prefix
- The properties prefix. Must not be null
.props
- The properties. Must not be null
.com.thetransactioncompany.util.PropertyParseException
- On a missing or invalid property.public void log()
log
in interface LoggableConfiguration
Copyright © 2018 Connect2id. All rights reserved.