Class Json2LdapConnector


  • public class Json2LdapConnector
    extends Object
    Connector to a remote Json2Ldap web service.

    Use the sendRequest() method to dispatch JSON-RPC 2.0 requests to it. The verify() method makes sure the configured URL points to a Json2Ldap web service and reports its version number and build date (as returned by the Json2Ldap "ws.getVersion" remote procedure call).

    Json2Ldap documentation: http://connect2id.com/products/json2ldap

    • Constructor Detail

      • Json2LdapConnector

        public Json2LdapConnector​(URL url)
        Creates a new Json2Ldap connector instance.
        Parameters:
        url - The Json2Ldap URL, must be HTTP or HTTPS.
    • Method Detail

      • verify

        public String verify()
                      throws com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException
        Makes sure the remote web service is Json2Ldap. Returns the version number (using the "ws.getVersion" remote procedure call). It is recommended to call this method before beginning an actual Json2Ldap session.
        Returns:
        The Json2Ldap version number / build date as a string.
        Throws:
        com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException - If there was a network exception or the remote web service isn't Json2Ldap.
      • sendRequest

        public com.thetransactioncompany.jsonrpc2.JSONRPC2Response sendRequest​(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request)
                                                                        throws com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException
        Sends a JSON-RPC 2.0 request to the remote Json2Ldap service.
        Parameters:
        request - The JSON-RPC 2.0 request.
        Returns:
        The JSON-RPC 2.0 response.
        Throws:
        com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException - If there was a request failure.