Package org.projectnessie.client
Interface NessieClientBuilder
-
- All Known Subinterfaces:
NessieHttpClientBuilder
- All Known Implementing Classes:
HttpClientBuilder,NessieClientBuilder.AbstractNessieClientBuilder,NessieHttpClientBuilder.AbstractNessieHttpClientBuilder,NessieHttpClientBuilderImpl
public interface NessieClientBuilderNessieApibuilder interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classNessieClientBuilder.AbstractNessieClientBuilderConvenience base class for implementations ofNessieClientBuilder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <I extends NessieClientBuilder>
IasInstanceOf(java.lang.Class<I> builderInterfaceType)<API extends NessieApi>
APIbuild(java.lang.Class<API> apiContract)Builds a newNessieApi.static NessieClientBuildercreateClientBuilder(java.lang.String clientName, java.lang.String clientBuilderImpl)Returns the Nessie client builder that matches the requested client name or client builder implementation class.static NessieClientBuildercreateClientBuilderFromSystemSettings()Constructs a client builder instance using config settings from Java system properties, process environment, Nessie client config file~/.config/nessie/nessie-client.properties, dot-env file~/.env.static NessieClientBuildercreateClientBuilderFromSystemSettings(NessieClientConfigSource mainConfigSource)NessieClientBuilderfromConfig(java.util.function.Function<java.lang.String,java.lang.String> configuration)Configure this HttpClientBuilder instance using a configuration object and standard Nessie configuration keys defined by the constants defined inNessieConfigConstants.NessieClientBuilderfromSystemProperties()Deprecated.UsefromConfig(Function)with config sources fromNessieClientConfigSources, preferablyNessieClientConfigSources.defaultConfigSources().java.lang.Stringname()The name of the Nessie client implementation, for exampleHTTPfor the HTTP/REST client.intpriority()Priority ordinal used to select the most relevantNessieClientBuilderimplementation.NessieClientBuilderwithApiCompatibilityCheck(boolean enable)NessieClientBuilderwithAuthentication(NessieAuthentication authentication)Sets theNessieAuthenticationinstance to be used.NessieClientBuilderwithAuthenticationFromConfig(java.util.function.Function<java.lang.String,java.lang.String> configuration)Configure only authentication in this HttpClientBuilder instance using a configuration object and standard Nessie configuration keys defined by the constants defined inNessieConfigConstants.NessieClientBuilderwithConnectionTimeout(int connectionTimeoutMillis)Sets the connect-timeout in milliseconds for remote requests.NessieClientBuilderwithDisableCompression(boolean disableCompression)Disables compression for remote requests.NessieClientBuilderwithReadTimeout(int readTimeoutMillis)Sets the read-timeout in milliseconds for remote requests.NessieClientBuilderwithSSLContext(javax.net.ssl.SSLContext sslContext)Optionally configure a specificSSLContext, currently only the Java 11+ accepts this option.NessieClientBuilderwithSSLParameters(javax.net.ssl.SSLParameters sslParameters)Optionally configure specificSSLParameters.NessieClientBuilderwithTracing(boolean tracing)NessieClientBuilderwithUri(java.lang.String uri)Convenience method forwithUri(URI)taking a string.NessieClientBuilderwithUri(java.net.URI uri)Set the Nessie server URI.
-
-
-
Method Detail
-
name
java.lang.String name()
The name of the Nessie client implementation, for exampleHTTPfor the HTTP/REST client.
-
priority
int priority()
Priority ordinal used to select the most relevantNessieClientBuilderimplementation.
-
asInstanceOf
<I extends NessieClientBuilder> I asInstanceOf(java.lang.Class<I> builderInterfaceType)
-
withApiCompatibilityCheck
@CanIgnoreReturnValue NessieClientBuilder withApiCompatibilityCheck(boolean enable)
-
fromSystemProperties
@CanIgnoreReturnValue @Deprecated NessieClientBuilder fromSystemProperties()
Deprecated.UsefromConfig(Function)with config sources fromNessieClientConfigSources, preferablyNessieClientConfigSources.defaultConfigSources().Same semantics asfromConfig(Function), uses the system properties.- Returns:
this- See Also:
fromConfig(Function)
-
fromConfig
@CanIgnoreReturnValue NessieClientBuilder fromConfig(java.util.function.Function<java.lang.String,java.lang.String> configuration)
Configure this HttpClientBuilder instance using a configuration object and standard Nessie configuration keys defined by the constants defined inNessieConfigConstants. Non-nullvalues returned by theconfiguration-function will override previously configured values.- Parameters:
configuration- The function that returns a configuration value for a configuration key.- Returns:
this- See Also:
NessieClientConfigSources,withAuthenticationFromConfig(Function)
-
withAuthenticationFromConfig
@CanIgnoreReturnValue NessieClientBuilder withAuthenticationFromConfig(java.util.function.Function<java.lang.String,java.lang.String> configuration)
Configure only authentication in this HttpClientBuilder instance using a configuration object and standard Nessie configuration keys defined by the constants defined inNessieConfigConstants.- Parameters:
configuration- The function that returns a configuration value for a configuration key.- Returns:
this- See Also:
fromConfig(Function)
-
withAuthentication
@CanIgnoreReturnValue NessieClientBuilder withAuthentication(NessieAuthentication authentication)
Sets theNessieAuthenticationinstance to be used.- Parameters:
authentication- authentication for this client- Returns:
this
-
withTracing
@CanIgnoreReturnValue NessieClientBuilder withTracing(boolean tracing)
-
withUri
@CanIgnoreReturnValue NessieClientBuilder withUri(java.net.URI uri)
Set the Nessie server URI. A server URI must be configured.- Parameters:
uri- server URI- Returns:
this
-
withUri
@CanIgnoreReturnValue NessieClientBuilder withUri(java.lang.String uri)
Convenience method forwithUri(URI)taking a string.- Parameters:
uri- server URI- Returns:
this
-
withReadTimeout
@CanIgnoreReturnValue NessieClientBuilder withReadTimeout(int readTimeoutMillis)
Sets the read-timeout in milliseconds for remote requests.
-
withConnectionTimeout
@CanIgnoreReturnValue NessieClientBuilder withConnectionTimeout(int connectionTimeoutMillis)
Sets the connect-timeout in milliseconds for remote requests.
-
withDisableCompression
@CanIgnoreReturnValue NessieClientBuilder withDisableCompression(boolean disableCompression)
Disables compression for remote requests.
-
withSSLContext
@CanIgnoreReturnValue NessieClientBuilder withSSLContext(javax.net.ssl.SSLContext sslContext)
Optionally configure a specificSSLContext, currently only the Java 11+ accepts this option.
-
withSSLParameters
@CanIgnoreReturnValue NessieClientBuilder withSSLParameters(javax.net.ssl.SSLParameters sslParameters)
Optionally configure specificSSLParameters.
-
build
<API extends NessieApi> API build(java.lang.Class<API> apiContract)
Builds a newNessieApi.- Returns:
- A new
NessieApi.
-
createClientBuilderFromSystemSettings
static NessieClientBuilder createClientBuilderFromSystemSettings()
Constructs a client builder instance using config settings from Java system properties, process environment, Nessie client config file~/.config/nessie/nessie-client.properties, dot-env file~/.env.
-
createClientBuilderFromSystemSettings
static NessieClientBuilder createClientBuilderFromSystemSettings(NessieClientConfigSource mainConfigSource)
-
createClientBuilder
@Nonnull @Nonnull static NessieClientBuilder createClientBuilder(java.lang.String clientName, java.lang.String clientBuilderImpl)
Returns the Nessie client builder that matches the requested client name or client builder implementation class.Nessie clients are discovered using Java's
service loadermechanism.The selection mechanism uses the given
Nessie client nameor Nessie client builder implementation class name to select the client builder from the list of available implementations.If neither a name nor an implementation class are specified, aka both parameters are
null, the Nessie client builder with the highestpriority()will be returned.Either the name or the implementation class should be specified. Specifying both is discouraged.
- Parameters:
clientName- the name of the Nessie client, as returned byname(), ornullclientBuilderImpl- the class that implements the Nessie client builder, ornull- Returns:
- Nessie client builder for the requested name or implementation class.
- Throws:
java.lang.IllegalArgumentException- if no Nessie client matching the requested name and/or implementation class could be found
-
-