Package com.exasol.bucketfs.jsonrpc
Class CommandFactory.Builder
- java.lang.Object
-
- com.exasol.bucketfs.jsonrpc.CommandFactory.Builder
-
- Enclosing class:
- CommandFactory
public static class CommandFactory.Builder extends Object
Builder for aCommandFactory.Call
CommandFactory.builder()to create a new instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandFactory.BuilderbasicAuthentication(String username, String password)Authenticate via basic authentication.CommandFactory.BuilderbearerTokenAuthentication(String token)Authenticate via the given bearer token.CommandFactorybuild()Build a newCommandFactory.CommandFactory.Buildercertificate(X509Certificate certificate)Use the given certificate for TLS connections.CommandFactory.BuilderraiseTlsErrors(boolean raise)Define if TLS errors should raise an error when executing requests or if they should be ignored.CommandFactory.BuilderserverUrl(String serverUrl)Set the URL of the RPC interface, e.g.
-
-
-
Method Detail
-
raiseTlsErrors
public CommandFactory.Builder raiseTlsErrors(boolean raise)
Define if TLS errors should raise an error when executing requests or if they should be ignored. Setting this tofalseis required as the docker-db uses a self-signed certificate.Defaults to raise TLS errors.
- Parameters:
raise-trueif theCommandFactoryshould fail for TLS errors,falseif it should ignore TLS errors.- Returns:
- this instance for method chaining
-
certificate
public CommandFactory.Builder certificate(X509Certificate certificate)
Use the given certificate for TLS connections.Defaults to using the certificates from the JVMs default key store.
Mutually exclusive with setting
raiseTlsErrors(boolean)tofalse.- Parameters:
certificate- certificate to use- Returns:
- this instance for method chaining
-
serverUrl
public CommandFactory.Builder serverUrl(String serverUrl)
Set the URL of the RPC interface, e.g."https://<hostname>:443/jrpc".- Parameters:
serverUrl- RPC interface URL- Returns:
- this instance for method chaining
- Throws:
IllegalArgumentException- the URL has an invalid format
-
bearerTokenAuthentication
public CommandFactory.Builder bearerTokenAuthentication(String token)
Authenticate via the given bearer token.- Parameters:
token- bearer token- Returns:
- this instance for method chaining
-
basicAuthentication
public CommandFactory.Builder basicAuthentication(String username, String password)
Authenticate via basic authentication.- Parameters:
username- username for authenticating against the RPC interfacepassword- password for authenticating against the RPC interface- Returns:
- this instance for method chaining
-
build
public CommandFactory build()
Build a newCommandFactory.- Returns:
- the new
CommandFactory - Throws:
NullPointerException- in case not all mandatory fields where defined
-
-