public class JSONRPC2LogUtility extends Object
Modifier and Type | Method | Description |
---|---|---|
static com.thetransactioncompany.jsonrpc2.JSONRPC2Request |
hideParameter(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
String paramName) |
Hides the value of the specified parameter in a JSON-RPC 2.0 request.
|
static com.thetransactioncompany.jsonrpc2.JSONRPC2Request |
hidePassword(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request) |
Hides the "password" parameter value in a JSON-RPC 2.0 request.
|
static void |
log(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
com.thetransactioncompany.jsonrpc2.JSONRPC2Response response) |
Logs (at INFO level) the name of the JSON-RPC 2.0 request and the
resulting response (success or error code + message).
|
static void |
log(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
com.thetransactioncompany.jsonrpc2.JSONRPC2Response response,
String prefix) |
Logs (at INFO level) the name of the JSON-RPC 2.0 request and the
resulting response (success or error code + message).
|
public static void log(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request, com.thetransactioncompany.jsonrpc2.JSONRPC2Response response, String prefix)
Format:
[prefix] request-method-name: Success | Error code: Message
Example:
[CID dff6fb77-7f96-4b82-a0f9-0ac25cfb1852] ldap.getEntry: Success [CID dff6fb77-7f96-4b82-a0f9-0ac25cfb1852] ldap.getEntry: Error -1000: Invalid/expired LDAP connection identifier (CID)
request
- The JSON-RPC 2.0 request. Must not be null
.response
- The resulting JSON-RPC 2.0 response. Must not be
null
.prefix
- The log message prefix. If null
the log
message will not be prefixed.public static void log(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request, com.thetransactioncompany.jsonrpc2.JSONRPC2Response response)
Format:
request-method-name: Success | Error code: Message
Example:
ldap.getEntry: Success ldap.getEntry: Error -1000 Invalid/expired LDAP connection identifier (CID)
request
- The JSON-RPC 2.0 request. Must not be null
.response
- The resulting JSON-RPC 2.0 response. Must not be
null
.public static com.thetransactioncompany.jsonrpc2.JSONRPC2Request hideParameter(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request, String paramName)
This method is intended for logging JSON-RPC 2.0 requests.
request
- The JSON-RPC 2.0 request. May be null
.paramName
- The name of the parameter to hide. May be
null
.public static com.thetransactioncompany.jsonrpc2.JSONRPC2Request hidePassword(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request)
This method is intended for logging JSON-RPC 2.0 requests.
request
- The JSON-RPC 2.0 request. May be null
.Copyright © 2018 Connect2id. All rights reserved.