Package com.nimbusds.common.jsonrpc2
Class LoggingWsDetector
java.lang.Object
com.nimbusds.common.jsonrpc2.WsDetector
com.nimbusds.common.jsonrpc2.LoggingWsDetector
- All Implemented Interfaces:
Runnable
Logs the detected name and version of a remote JSON-RPC 2.0 web service, as
reported by a
WsInfoRequestHandler
. To prevent blocking the detection
routine is run on a separate thread.
Example:
new Thread(new LoggingWsDetector(...)).start();
-
Constructor Summary
ConstructorDescriptionLoggingWsDetector
(URL url, String expectedWsName, org.apache.logging.log4j.Logger log) Creates a new JSON-RPC 2.0 web service detector. -
Method Summary
Methods inherited from class com.nimbusds.common.jsonrpc2.WsDetector
detect, getSession
-
Constructor Details
-
LoggingWsDetector
Creates a new JSON-RPC 2.0 web service detector.- Parameters:
url
- The web service HTTP(S) URL. Must not benull
.expectedWsName
- The expected web service name, as reported byws.getName
. Must not benull
.log
- The logger. Must not benull
.
-
-
Method Details
-
getWsInfo
Returns the detected web service name and version.- Returns:
- The web service name and version,
null
if not detected.
-
run
Detects and logs the JSON-RPC 2.0 web service name and version. The target web service must handlews.getName
andws.getVersion
calls, as implemented byWsInfoRequestHandler
.Any encountered exceptions are logged at WARN level.
-