Package com.nimbusds.common.jsonrpc2
Class LoggingWsDetector
- java.lang.Object
-
- com.nimbusds.common.jsonrpc2.WsDetector
-
- com.nimbusds.common.jsonrpc2.LoggingWsDetector
-
- All Implemented Interfaces:
Runnable
public class LoggingWsDetector extends WsDetector implements Runnable
Logs the detected name and version of a remote JSON-RPC 2.0 web service, as reported by aWsInfoRequestHandler
. To prevent blocking the detection routine is run on a separate thread.Example:
new Thread(new LoggingWsDetector(...)).start();
-
-
Constructor Summary
Constructors Constructor Description LoggingWsDetector(URL url, String expectedWsName, org.apache.logging.log4j.Logger log)
Creates a new JSON-RPC 2.0 web service detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WsInfo
getWsInfo()
Returns the detected web service name and version.void
run()
Detects and logs the JSON-RPC 2.0 web service name and version.-
Methods inherited from class com.nimbusds.common.jsonrpc2.WsDetector
detect, getSession
-
-
-
-
Constructor Detail
-
LoggingWsDetector
public LoggingWsDetector(URL url, String expectedWsName, org.apache.logging.log4j.Logger log)
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 Detail
-
getWsInfo
public WsInfo getWsInfo()
Returns the detected web service name and version.- Returns:
- The web service name and version,
null
if not detected.
-
run
public void 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.
-
-