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 a WsInfoRequestHandler. To prevent blocking the detection routine is run on a separate thread.

Example:

 new Thread(new LoggingWsDetector(...)).start();
 
  • Constructor Details

    • 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 be null.
      expectedWsName - The expected web service name, as reported by ws.getName. Must not be null.
      log - The logger. Must not be null.
  • Method Details

    • 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 handle ws.getName and ws.getVersion calls, as implemented by WsInfoRequestHandler.

      Any encountered exceptions are logged at WARN level.

      Specified by:
      run in interface Runnable