Package ai.vespa.feed.client.impl
Class FeedClientBuilderImpl
java.lang.Object
ai.vespa.feed.client.impl.FeedClientBuilderImpl
- All Implemented Interfaces:
ai.vespa.feed.client.FeedClientBuilder
Builder for creating a
FeedClient
instance.- Author:
- bjorncs, jonmv
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.vespa.feed.client.FeedClientBuilder
ai.vespa.feed.client.FeedClientBuilder.Compression
-
Field Summary
Fields inherited from interface ai.vespa.feed.client.FeedClientBuilder
PREFERRED_IMPLEMENTATION_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionai.vespa.feed.client.FeedClientBuilder
addProxyRequestHeader
(String name, String value) ai.vespa.feed.client.FeedClientBuilder
addProxyRequestHeader
(String name, Supplier<String> valueSupplier) addRequestHeader
(String name, String value) Adds HTTP request header to all client requests.addRequestHeader
(String name, Supplier<String> valueSupplier) Adds HTTP request header to all client requests.ai.vespa.feed.client.FeedClient
build()
Constructs instance ofFeedClient
from builder configurationTurns off benchmarking.setCaCertificates
(Collection<X509Certificate> caCertificates) Overrides JVM default SSL truststoresetCaCertificatesFile
(Path caCertificatesFile) Overrides JVM default SSL truststoresetCertificate
(Path certificatePemFile, Path privateKeyPemFile) Sets path to client SSL certificate/key PEM filessetCertificate
(X509Certificate certificate, PrivateKey privateKey) Sets client SSL certificate/keysetCertificate
(Collection<X509Certificate> certificate, PrivateKey privateKey) Sets client SSL certificates/keysetCircuitBreaker
(ai.vespa.feed.client.FeedClient.CircuitBreaker breaker) Overrides default circuit breaker.setCompression
(ai.vespa.feed.client.FeedClientBuilder.Compression compression) setConnectionsPerEndpoint
(int max) setDryrun
(boolean enabled) ai.vespa.feed.client.FeedClientBuilder
setEndpointUris
(List<URI> endpoints) setHostnameVerifier
(HostnameVerifier verifier) SetsHostnameVerifier
instance (e.g for disabling default SSL hostname verification).setMaxStreamPerConnection
(int max) ai.vespa.feed.client.FeedClientBuilder
setProxyCaCertificates
(Collection<X509Certificate> caCertificates) setProxyCaCertificatesFile
(Path caCertificatesFile) ai.vespa.feed.client.FeedClientBuilder
setProxyHostnameVerifier
(HostnameVerifier verifier) setRetryStrategy
(ai.vespa.feed.client.FeedClient.RetryStrategy strategy) Overrides default retry strategy.setSpeedTest
(boolean enabled) setSslContext
(SSLContext context) SetsSSLContext
instance.
-
Constructor Details
-
FeedClientBuilderImpl
public FeedClientBuilderImpl()
-
-
Method Details
-
setEndpointUris
- Specified by:
setEndpointUris
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setConnectionsPerEndpoint
- Specified by:
setConnectionsPerEndpoint
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setMaxStreamPerConnection
- Specified by:
setMaxStreamPerConnection
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setSslContext
SetsSSLContext
instance.- Specified by:
setSslContext
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setHostnameVerifier
SetsHostnameVerifier
instance (e.g for disabling default SSL hostname verification).- Specified by:
setHostnameVerifier
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxyHostnameVerifier
- Specified by:
setProxyHostnameVerifier
in interfaceai.vespa.feed.client.FeedClientBuilder
-
noBenchmarking
Turns off benchmarking. Attempting to getFeedClient.stats()
will result in an exception.- Specified by:
noBenchmarking
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
Adds HTTP request header to all client requests.- Specified by:
addRequestHeader
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
Adds HTTP request header to all client requests. ValueSupplier
is invoked for each HTTP request, i.e. value can be dynamically updated during a feed.- Specified by:
addRequestHeader
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addProxyRequestHeader
- Specified by:
addProxyRequestHeader
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addProxyRequestHeader
public ai.vespa.feed.client.FeedClientBuilder addProxyRequestHeader(String name, Supplier<String> valueSupplier) - Specified by:
addProxyRequestHeader
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setRetryStrategy
public FeedClientBuilderImpl setRetryStrategy(ai.vespa.feed.client.FeedClient.RetryStrategy strategy) Overrides default retry strategy.- Specified by:
setRetryStrategy
in interfaceai.vespa.feed.client.FeedClientBuilder
- See Also:
-
FeedClient.RetryStrategy
-
setCircuitBreaker
public FeedClientBuilderImpl setCircuitBreaker(ai.vespa.feed.client.FeedClient.CircuitBreaker breaker) Overrides default circuit breaker.- Specified by:
setCircuitBreaker
in interfaceai.vespa.feed.client.FeedClientBuilder
- See Also:
-
FeedClient.CircuitBreaker
-
setCertificate
Sets path to client SSL certificate/key PEM files- Specified by:
setCertificate
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCertificate
public FeedClientBuilderImpl setCertificate(Collection<X509Certificate> certificate, PrivateKey privateKey) Sets client SSL certificates/key- Specified by:
setCertificate
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCertificate
Sets client SSL certificate/key- Specified by:
setCertificate
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setDryrun
- Specified by:
setDryrun
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setSpeedTest
- Specified by:
setSpeedTest
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCaCertificatesFile
Overrides JVM default SSL truststore- Specified by:
setCaCertificatesFile
in interfaceai.vespa.feed.client.FeedClientBuilder
- Parameters:
caCertificatesFile
- Path to PEM encoded file containing trusted certificates
-
setProxyCaCertificatesFile
- Specified by:
setProxyCaCertificatesFile
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCaCertificates
Overrides JVM default SSL truststore- Specified by:
setCaCertificates
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxyCaCertificates
public ai.vespa.feed.client.FeedClientBuilder setProxyCaCertificates(Collection<X509Certificate> caCertificates) - Specified by:
setProxyCaCertificates
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxy
- Specified by:
setProxy
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCompression
public FeedClientBuilderImpl setCompression(ai.vespa.feed.client.FeedClientBuilder.Compression compression) - Specified by:
setCompression
in interfaceai.vespa.feed.client.FeedClientBuilder
-
build
public ai.vespa.feed.client.FeedClient build()Constructs instance ofFeedClient
from builder configuration- Specified by:
build
in interfaceai.vespa.feed.client.FeedClientBuilder
-