Package org.projectnessie.client.http
Class NessieHttpClientBuilderImpl
java.lang.Object
org.projectnessie.client.NessieClientBuilder.AbstractNessieClientBuilder
org.projectnessie.client.http.NessieHttpClientBuilder.AbstractNessieHttpClientBuilder
org.projectnessie.client.http.NessieHttpClientBuilderImpl
- All Implemented Interfaces:
NessieHttpClientBuilder,NessieClientBuilder
- Direct Known Subclasses:
HttpClientBuilder
public class NessieHttpClientBuilderImpl
extends NessieHttpClientBuilder.AbstractNessieHttpClientBuilder
NessieHttpClientBuilder and NessieClientBuilder implementation for HTTP/REST.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.projectnessie.client.NessieClientBuilder
NessieClientBuilder.AbstractNessieClientBuilderNested classes/interfaces inherited from interface org.projectnessie.client.http.NessieHttpClientBuilder
NessieHttpClientBuilder.AbstractNessieHttpClientBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<API extends NessieApi>
APIBuilds a newNessieApi.name()The name of the Nessie client implementation, for exampleHTTPfor the HTTP/REST client.intpriority()Priority ordinal used to select the most relevantNessieClientBuilderimplementation.withApiCompatibilityCheck(boolean enable) withAuthentication(NessieAuthentication authentication) Sets theNessieAuthenticationinstance to be used.withConnectionTimeout(int connectionTimeoutMillis) Set the connection timeout in milliseconds for this client.withDisableCompression(boolean disableCompression) Set whether the compression shall be disabled or not.withFollowRedirects(String redirects) Whether HTTP redirects are followed, default is to not follow redirects.withForceUrlConnectionClient(boolean forceUrlConnectionClient) Whether to force using the "old"URLConnectionbased client when running on Java 11 and newer with Java's new HTTP client.withHttp2Upgrade(boolean http2Upgrade) Whether to allow HTTP/2 upgrade, default isfalse.withReadTimeout(int readTimeoutMillis) Set the read timeout in milliseconds for this client.withResponseFactory(HttpResponseFactory responseFactory) withSSLContext(SSLContext sslContext) Set the SSL context for this client.withSSLParameters(SSLParameters sslParameters) Optionally configure specificSSLParameters.withTracing(boolean tracing) Whether to enable adding the HTTP headers of an active OpenTracing span to all Nessie requests.Set the Nessie server URI.Methods inherited from class org.projectnessie.client.http.NessieHttpClientBuilder.AbstractNessieHttpClientBuilder
fromConfigMethods inherited from class org.projectnessie.client.NessieClientBuilder.AbstractNessieClientBuilder
asInstanceOf, fromSystemProperties, withAuthenticationFromConfig, withUriMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.projectnessie.client.NessieClientBuilder
asInstanceOf, fromSystemProperties, withAuthenticationFromConfig, withUri
-
Constructor Details
-
NessieHttpClientBuilderImpl
public NessieHttpClientBuilderImpl()
-
-
Method Details
-
name
Description copied from interface:NessieClientBuilderThe name of the Nessie client implementation, for exampleHTTPfor the HTTP/REST client. -
priority
public int priority()Description copied from interface:NessieClientBuilderPriority ordinal used to select the most relevantNessieClientBuilderimplementation. -
withUri
Set the Nessie server URI. A server URI must be configured.- Specified by:
withUriin interfaceNessieClientBuilder- Overrides:
withUriin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
uri- server URI- Returns:
this
-
withAuthentication
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withAuthentication(NessieAuthentication authentication) Description copied from interface:NessieClientBuilderSets theNessieAuthenticationinstance to be used.- Specified by:
withAuthenticationin interfaceNessieClientBuilder- Overrides:
withAuthenticationin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
authentication- authentication for this client- Returns:
this
-
withTracing
Whether to enable adding the HTTP headers of an active OpenTracing span to all Nessie requests. If enabled, the OpenTracing dependencies must be present at runtime.- Specified by:
withTracingin interfaceNessieClientBuilder- Overrides:
withTracingin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
tracing-trueto enable passing HTTP headers for active tracing spans.- Returns:
this
-
withReadTimeout
Set the read timeout in milliseconds for this client. Timeout will throwHttpClientReadTimeoutException.- Specified by:
withReadTimeoutin interfaceNessieClientBuilder- Overrides:
withReadTimeoutin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
readTimeoutMillis- number of seconds to wait for a response from server.- Returns:
this
-
withConnectionTimeout
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withConnectionTimeout(int connectionTimeoutMillis) Set the connection timeout in milliseconds for this client. Timeout will throwHttpClientException.- Specified by:
withConnectionTimeoutin interfaceNessieClientBuilder- Overrides:
withConnectionTimeoutin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
connectionTimeoutMillis- number of seconds to wait to connect to the server.- Returns:
this
-
withDisableCompression
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withDisableCompression(boolean disableCompression) Set whether the compression shall be disabled or not.- Specified by:
withDisableCompressionin interfaceNessieClientBuilder- Overrides:
withDisableCompressionin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
disableCompression- whether the compression shall be disabled or not.- Returns:
this
-
withSSLContext
Set the SSL context for this client.- Specified by:
withSSLContextin interfaceNessieClientBuilder- Overrides:
withSSLContextin classNessieClientBuilder.AbstractNessieClientBuilder- Parameters:
sslContext- the SSL context to use- Returns:
this
-
withSSLParameters
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withSSLParameters(SSLParameters sslParameters) Description copied from interface:NessieClientBuilderOptionally configure specificSSLParameters.- Specified by:
withSSLParametersin interfaceNessieClientBuilder- Overrides:
withSSLParametersin classNessieClientBuilder.AbstractNessieClientBuilder
-
withHttp2Upgrade
Description copied from interface:NessieHttpClientBuilderWhether to allow HTTP/2 upgrade, default isfalse.Only valid on Java 11 and newer with Java's new HTTP client.
- Specified by:
withHttp2Upgradein interfaceNessieHttpClientBuilder- Overrides:
withHttp2Upgradein classNessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
withFollowRedirects
Description copied from interface:NessieHttpClientBuilderWhether HTTP redirects are followed, default is to not follow redirects.Valid values are the enum names of
HttpClient.Redirect.Only valid on Java 11 and newer with Java's new HTTP client.
- Specified by:
withFollowRedirectsin interfaceNessieHttpClientBuilder- Overrides:
withFollowRedirectsin classNessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
withForceUrlConnectionClient
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withForceUrlConnectionClient(boolean forceUrlConnectionClient) Description copied from interface:NessieHttpClientBuilderWhether to force using the "old"URLConnectionbased client when running on Java 11 and newer with Java's new HTTP client.- Specified by:
withForceUrlConnectionClientin interfaceNessieHttpClientBuilder- Overrides:
withForceUrlConnectionClientin classNessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
withApiCompatibilityCheck
- Specified by:
withApiCompatibilityCheckin interfaceNessieClientBuilder- Overrides:
withApiCompatibilityCheckin classNessieClientBuilder.AbstractNessieClientBuilder
-
withResponseFactory
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withResponseFactory(HttpResponseFactory responseFactory) - Specified by:
withResponseFactoryin interfaceNessieHttpClientBuilder- Overrides:
withResponseFactoryin classNessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
build
Description copied from interface:NessieClientBuilderBuilds a newNessieApi.- Returns:
- A new
NessieApi.
-