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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionai.vespa.feed.client.FeedClientBuilderaddProxyRequestHeader(String name, String value) ai.vespa.feed.client.FeedClientBuilderaddProxyRequestHeader(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.FeedClientbuild()Constructs instance ofFeedClientfrom 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) ai.vespa.feed.client.FeedClientBuildersetDryrun(boolean enabled) ai.vespa.feed.client.FeedClientBuildersetEndpointUris(List<URI> endpoints) setHostnameVerifier(HostnameVerifier verifier) SetsHostnameVerifierinstance (e.g for disabling default SSL hostname verification).setInitialInflightFactor(int factor) setMaxStreamPerConnection(int max) ai.vespa.feed.client.FeedClientBuildersetProxyCaCertificates(Collection<X509Certificate> caCertificates) setProxyCaCertificatesFile(Path caCertificatesFile) ai.vespa.feed.client.FeedClientBuildersetProxyHostnameVerifier(HostnameVerifier verifier) setRetryStrategy(ai.vespa.feed.client.FeedClient.RetryStrategy strategy) Overrides default retry strategy.setSpeedTest(boolean enabled) setSslContext(SSLContext context) SetsSSLContextinstance.
-
Constructor Details
-
FeedClientBuilderImpl
public FeedClientBuilderImpl()
-
-
Method Details
-
setEndpointUris
- Specified by:
setEndpointUrisin interfaceai.vespa.feed.client.FeedClientBuilder
-
setConnectionsPerEndpoint
- Specified by:
setConnectionsPerEndpointin interfaceai.vespa.feed.client.FeedClientBuilder
-
setMaxStreamPerConnection
- Specified by:
setMaxStreamPerConnectionin interfaceai.vespa.feed.client.FeedClientBuilder
-
setConnectionTimeToLive
- Specified by:
setConnectionTimeToLivein interfaceai.vespa.feed.client.FeedClientBuilder
-
setSslContext
SetsSSLContextinstance.- Specified by:
setSslContextin interfaceai.vespa.feed.client.FeedClientBuilder
-
setHostnameVerifier
SetsHostnameVerifierinstance (e.g for disabling default SSL hostname verification).- Specified by:
setHostnameVerifierin interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxyHostnameVerifier
- Specified by:
setProxyHostnameVerifierin interfaceai.vespa.feed.client.FeedClientBuilder
-
noBenchmarking
Turns off benchmarking. Attempting to getFeedClient.stats()will result in an exception.- Specified by:
noBenchmarkingin interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
Adds HTTP request header to all client requests.- Specified by:
addRequestHeaderin interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
Adds HTTP request header to all client requests. ValueSupplieris invoked for each HTTP request, i.e. value can be dynamically updated during a feed.- Specified by:
addRequestHeaderin interfaceai.vespa.feed.client.FeedClientBuilder
-
addProxyRequestHeader
- Specified by:
addProxyRequestHeaderin interfaceai.vespa.feed.client.FeedClientBuilder
-
addProxyRequestHeader
public ai.vespa.feed.client.FeedClientBuilder addProxyRequestHeader(String name, Supplier<String> valueSupplier) - Specified by:
addProxyRequestHeaderin interfaceai.vespa.feed.client.FeedClientBuilder
-
setRetryStrategy
public FeedClientBuilderImpl setRetryStrategy(ai.vespa.feed.client.FeedClient.RetryStrategy strategy) Overrides default retry strategy.- Specified by:
setRetryStrategyin 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:
setCircuitBreakerin interfaceai.vespa.feed.client.FeedClientBuilder- See Also:
-
FeedClient.CircuitBreaker
-
setCertificate
Sets path to client SSL certificate/key PEM files- Specified by:
setCertificatein interfaceai.vespa.feed.client.FeedClientBuilder
-
setCertificate
public FeedClientBuilderImpl setCertificate(Collection<X509Certificate> certificate, PrivateKey privateKey) Sets client SSL certificates/key- Specified by:
setCertificatein interfaceai.vespa.feed.client.FeedClientBuilder
-
setCertificate
Sets client SSL certificate/key- Specified by:
setCertificatein interfaceai.vespa.feed.client.FeedClientBuilder
-
setDryrun
- Specified by:
setDryrunin interfaceai.vespa.feed.client.FeedClientBuilder
-
setSpeedTest
- Specified by:
setSpeedTestin interfaceai.vespa.feed.client.FeedClientBuilder
-
setCaCertificatesFile
Overrides JVM default SSL truststore- Specified by:
setCaCertificatesFilein interfaceai.vespa.feed.client.FeedClientBuilder- Parameters:
caCertificatesFile- Path to PEM encoded file containing trusted certificates
-
setProxyCaCertificatesFile
- Specified by:
setProxyCaCertificatesFilein interfaceai.vespa.feed.client.FeedClientBuilder
-
setCaCertificates
Overrides JVM default SSL truststore- Specified by:
setCaCertificatesin interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxyCaCertificates
public ai.vespa.feed.client.FeedClientBuilder setProxyCaCertificates(Collection<X509Certificate> caCertificates) - Specified by:
setProxyCaCertificatesin interfaceai.vespa.feed.client.FeedClientBuilder
-
setProxy
- Specified by:
setProxyin interfaceai.vespa.feed.client.FeedClientBuilder
-
setCompression
public FeedClientBuilderImpl setCompression(ai.vespa.feed.client.FeedClientBuilder.Compression compression) - Specified by:
setCompressionin interfaceai.vespa.feed.client.FeedClientBuilder
-
setInitialInflightFactor
- Specified by:
setInitialInflightFactorin interfaceai.vespa.feed.client.FeedClientBuilder
-
build
public ai.vespa.feed.client.FeedClient build()Constructs instance ofFeedClientfrom builder configuration- Specified by:
buildin interfaceai.vespa.feed.client.FeedClientBuilder
-