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
public class FeedClientBuilderImpl extends Object implements ai.vespa.feed.client.FeedClientBuilder
Builder for creating aFeedClient
instance.- Author:
- bjorncs, jonmv
-
-
Constructor Summary
Constructors Constructor Description FeedClientBuilderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeedClientBuilderImpl
addRequestHeader(String name, String value)
Adds HTTP request header to all client requests.FeedClientBuilderImpl
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 configurationFeedClientBuilderImpl
noBenchmarking()
Turns off benchmarking.FeedClientBuilderImpl
setCaCertificates(Collection<X509Certificate> caCertificates)
Overrides JVM default SSL truststoreFeedClientBuilderImpl
setCaCertificatesFile(Path caCertificatesFile)
Overrides JVM default SSL truststoreFeedClientBuilderImpl
setCertificate(Path certificatePemFile, Path privateKeyPemFile)
Sets path to client SSL certificate/key PEM filesFeedClientBuilderImpl
setCertificate(X509Certificate certificate, PrivateKey privateKey)
Sets client SSL certificate/keyFeedClientBuilderImpl
setCertificate(Collection<X509Certificate> certificate, PrivateKey privateKey)
Sets client SSL certificates/keyFeedClientBuilderImpl
setCircuitBreaker(ai.vespa.feed.client.FeedClient.CircuitBreaker breaker)
Overrides default circuit breaker.FeedClientBuilderImpl
setConnectionsPerEndpoint(int max)
FeedClientBuilderImpl
setDryrun(boolean enabled)
ai.vespa.feed.client.FeedClientBuilder
setEndpointUris(List<URI> endpoints)
FeedClientBuilderImpl
setHostnameVerifier(HostnameVerifier verifier)
SetsHostnameVerifier
instance (e.g for disabling default SSL hostname verification).FeedClientBuilderImpl
setMaxStreamPerConnection(int max)
FeedClientBuilderImpl
setRetryStrategy(ai.vespa.feed.client.FeedClient.RetryStrategy strategy)
Overrides default retry strategy.FeedClientBuilderImpl
setSslContext(SSLContext context)
SetsSSLContext
instance.
-
-
-
Method Detail
-
setEndpointUris
public ai.vespa.feed.client.FeedClientBuilder setEndpointUris(List<URI> endpoints)
- Specified by:
setEndpointUris
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setConnectionsPerEndpoint
public FeedClientBuilderImpl setConnectionsPerEndpoint(int max)
- Specified by:
setConnectionsPerEndpoint
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setMaxStreamPerConnection
public FeedClientBuilderImpl setMaxStreamPerConnection(int max)
- Specified by:
setMaxStreamPerConnection
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setSslContext
public FeedClientBuilderImpl setSslContext(SSLContext context)
SetsSSLContext
instance.- Specified by:
setSslContext
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setHostnameVerifier
public FeedClientBuilderImpl setHostnameVerifier(HostnameVerifier verifier)
SetsHostnameVerifier
instance (e.g for disabling default SSL hostname verification).- Specified by:
setHostnameVerifier
in interfaceai.vespa.feed.client.FeedClientBuilder
-
noBenchmarking
public FeedClientBuilderImpl noBenchmarking()
Turns off benchmarking. Attempting to getFeedClient.stats()
will result in an exception.- Specified by:
noBenchmarking
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
public FeedClientBuilderImpl addRequestHeader(String name, String value)
Adds HTTP request header to all client requests.- Specified by:
addRequestHeader
in interfaceai.vespa.feed.client.FeedClientBuilder
-
addRequestHeader
public FeedClientBuilderImpl addRequestHeader(String name, Supplier<String> valueSupplier)
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
-
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
public FeedClientBuilderImpl setCertificate(Path certificatePemFile, Path privateKeyPemFile)
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
public FeedClientBuilderImpl setCertificate(X509Certificate certificate, PrivateKey privateKey)
Sets client SSL certificate/key- Specified by:
setCertificate
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setDryrun
public FeedClientBuilderImpl setDryrun(boolean enabled)
- Specified by:
setDryrun
in interfaceai.vespa.feed.client.FeedClientBuilder
-
setCaCertificatesFile
public FeedClientBuilderImpl setCaCertificatesFile(Path caCertificatesFile)
Overrides JVM default SSL truststore- Specified by:
setCaCertificatesFile
in interfaceai.vespa.feed.client.FeedClientBuilder
- Parameters:
caCertificatesFile
- Path to PEM encoded file containing trusted certificates
-
setCaCertificates
public FeedClientBuilderImpl setCaCertificates(Collection<X509Certificate> caCertificates)
Overrides JVM default SSL truststore- Specified by:
setCaCertificates
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
-
-