Class WsDetector

java.lang.Object
com.nimbusds.common.jsonrpc2.WsDetector
Direct Known Subclasses:
LoggingWsDetector

public class WsDetector extends Object
Detects the name and version of a remote JSON-RPC 2.0 web service, as reported by a WsInfoRequestHandler.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new JSON-RPC 2.0 web service detector.
  • Method Summary

    Modifier and Type
    Method
    Description
    Detects the JSON-RPC 2.0 web service name and version.
    com.thetransactioncompany.jsonrpc2.client.JSONRPC2Session
    Gets the client session associated with this JSON-RPC 2.0 web service detected.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WsDetector

      public WsDetector(URL url)
      Creates a new JSON-RPC 2.0 web service detector.
      Parameters:
      url - The web service HTTP(S) URL. Must not be null.
  • Method Details

    • getSession

      public com.thetransactioncompany.jsonrpc2.client.JSONRPC2Session getSession()
      Gets the client session associated with this JSON-RPC 2.0 web service detected.
      Returns:
      The JSON-RPC 2.0 client session.
    • detect

      public WsInfo detect() throws Exception
      Detects 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.
      Returns:
      The reported web service name and version.
      Throws:
      Exception - If the web service name and version couldn't be detected, for example due to a network exception.