Package com.nimbusds.common.jsonrpc2
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 aWsInfoRequestHandler
.
-
-
Constructor Summary
Constructors Constructor Description WsDetector(URL url)
Creates a new JSON-RPC 2.0 web service detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WsInfo
detect()
Detects the JSON-RPC 2.0 web service name and version.com.thetransactioncompany.jsonrpc2.client.JSONRPC2Session
getSession()
Gets the client session associated with this JSON-RPC 2.0 web service detected.
-
-
-
Constructor Detail
-
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 benull
.
-
-
Method Detail
-
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 handlews.getName
andws.getVersion
calls, as implemented byWsInfoRequestHandler
.- 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.
-
-