Class JSONRPC2WebAPIConfiguration

java.lang.Object
com.nimbusds.common.config.JSONRPC2WebAPIConfiguration
All Implemented Interfaces:
LoggableConfiguration

JSON-RPC 2.0 web API configuration. Connect2id web services with additional API configuration properties can extend this class.

The configuration is stored as public fields which become immutable (final) after their initialisation.

Property keys: [prefix]*

  • 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 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

    • DEFAULT_RESPONSE_CONTENT_TYPE

      The default response content type.
      See Also:
    • exposeExceptions

      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

    • DEFAULT_EXPOSE_EXCEPTIONS

      public static final boolean DEFAULT_EXPOSE_EXCEPTIONS
      The default expose exceptions policy.
      See Also:
    • reportRequestProcTime

      public final boolean reportRequestProcTime
      If 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

    • DEFAULT_REPORT_REQUEST_PROC_TIME

      public static final boolean 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 be null.
      props - The properties. Must not be null.
      Throws:
      com.thetransactioncompany.util.PropertyParseException - On a missing or invalid property.
  • Method Details