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
NessieHttpClientBuilderandNessieClientBuilderimplementation for HTTP/REST.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.projectnessie.client.NessieClientBuilder
NessieClientBuilder.AbstractNessieClientBuilder
-
Nested classes/interfaces inherited from interface org.projectnessie.client.http.NessieHttpClientBuilder
NessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
-
Constructor Summary
Constructors Constructor Description NessieHttpClientBuilderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <API extends NessieApi>
APIbuild(java.lang.Class<API> apiVersion)Builds a newNessieApi.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.NessieHttpClientBuilderImplwithApiCompatibilityCheck(boolean enable)NessieHttpClientBuilderImplwithAuthentication(NessieAuthentication authentication)Sets theNessieAuthenticationinstance to be used.NessieHttpClientBuilderImplwithConnectionTimeout(int connectionTimeoutMillis)Set the connection timeout in milliseconds for this client.NessieHttpClientBuilderImplwithDisableCompression(boolean disableCompression)Set whether the compression shall be disabled or not.NessieHttpClientBuilderImplwithFollowRedirects(java.lang.String redirects)Whether HTTP redirects are followed, default is to not follow redirects.NessieHttpClientBuilderImplwithForceUrlConnectionClient(boolean forceUrlConnectionClient)Whether to force using the "old"URLConnectionbased client when running on Java 11 and newer with Java's new HTTP client.NessieHttpClientBuilderImplwithHttp2Upgrade(boolean http2Upgrade)Whether to allow HTTP/2 upgrade, default isfalse.NessieHttpClientBuilderImplwithReadTimeout(int readTimeoutMillis)Set the read timeout in milliseconds for this client.NessieHttpClientBuilderImplwithResponseFactory(HttpResponseFactory responseFactory)NessieHttpClientBuilderImplwithSSLContext(javax.net.ssl.SSLContext sslContext)Set the SSL context for this client.NessieHttpClientBuilderImplwithSSLParameters(javax.net.ssl.SSLParameters sslParameters)Optionally configure specificSSLParameters.NessieHttpClientBuilderImplwithTracing(boolean tracing)Whether to enable adding the HTTP headers of an active OpenTracing span to all Nessie requests.NessieHttpClientBuilderImplwithUri(java.net.URI uri)Set the Nessie server URI.-
Methods inherited from class org.projectnessie.client.http.NessieHttpClientBuilder.AbstractNessieHttpClientBuilder
fromConfig
-
Methods inherited from class org.projectnessie.client.NessieClientBuilder.AbstractNessieClientBuilder
asInstanceOf, fromSystemProperties, withAuthenticationFromConfig, withUri
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.projectnessie.client.NessieClientBuilder
asInstanceOf, fromSystemProperties, withAuthenticationFromConfig, withUri
-
-
-
-
Method Detail
-
name
public java.lang.String 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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withUri(java.net.URI uri)
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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withTracing(boolean tracing)
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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withReadTimeout(int readTimeoutMillis)
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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withSSLContext(javax.net.ssl.SSLContext sslContext)
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(javax.net.ssl.SSLParameters sslParameters)
Description copied from interface:NessieClientBuilderOptionally configure specificSSLParameters.- Specified by:
withSSLParametersin interfaceNessieClientBuilder- Overrides:
withSSLParametersin classNessieClientBuilder.AbstractNessieClientBuilder
-
withHttp2Upgrade
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withHttp2Upgrade(boolean http2Upgrade)
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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withFollowRedirects(java.lang.String redirects)
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
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withApiCompatibilityCheck(boolean enable)
- Specified by:
withApiCompatibilityCheckin interfaceNessieClientBuilder- Overrides:
withApiCompatibilityCheckin classNessieClientBuilder.AbstractNessieClientBuilder
-
withResponseFactory
@CanIgnoreReturnValue public NessieHttpClientBuilderImpl withResponseFactory(HttpResponseFactory responseFactory)
- Specified by:
withResponseFactoryin interfaceNessieHttpClientBuilder- Overrides:
withResponseFactoryin classNessieHttpClientBuilder.AbstractNessieHttpClientBuilder
-
build
public <API extends NessieApi> API build(java.lang.Class<API> apiVersion)
Description copied from interface:NessieClientBuilderBuilds a newNessieApi.- Returns:
- A new
NessieApi.
-
-