Package ai.promoted.delivery.client
Class PromotedDeliveryClient.Builder
- java.lang.Object
-
- ai.promoted.delivery.client.PromotedDeliveryClient.Builder
-
- Enclosing class:
- PromotedDeliveryClient
public static class PromotedDeliveryClient.Builder extends Object
Builds aPromotedDeliveryClient.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PromotedDeliveryClientbuild()Builds thePromotedDeliveryClient.PromotedDeliveryClient.BuilderwithAcceptGzip(boolean acceptGzip)Sets accept gzip encoding header.PromotedDeliveryClient.BuilderwithApiFactory(ApiFactory apiFactory)Sets API factory.PromotedDeliveryClient.BuilderwithApplyTreatmentChecker(ApplyTreatmentChecker applyTreatmentChecker)Sets apply treatment checker.PromotedDeliveryClient.BuilderwithBlockingShadowTraffic(boolean blockingShadowTraffic)Sets blockingShadowTraffic, which determines whether or not shadow traffic delivery is a blocking call.PromotedDeliveryClient.BuilderwithDeliveryApiKey(String deliveryApiKey)Sets delivery api key.PromotedDeliveryClient.BuilderwithDeliveryEndpoint(String deliveryEndpoint)Sets delivery endpoint.PromotedDeliveryClient.BuilderwithDeliveryTimeoutMillis(long deliveryTimeoutMillis)Sets delivery timeout millis.PromotedDeliveryClient.BuilderwithExecutor(Executor executor)Sets executor.PromotedDeliveryClient.BuilderwithMaxRequestInsertions(int maxRequestInsertions)Sets max request insertions.PromotedDeliveryClient.BuilderwithMetricsApiKey(String metricsApiKey)Sets metrics aoi key.PromotedDeliveryClient.BuilderwithMetricsEndpoint(String metricsEndpoint)Sets metrics endpoint.PromotedDeliveryClient.BuilderwithMetricsTimeoutMillis(long metricsTimoutMillis)Sets metrics timeout millis.PromotedDeliveryClient.BuilderwithSampler(Sampler sampler)Sets sampler, which we use for sampling shadow traffic.PromotedDeliveryClient.BuilderwithShadowTrafficDeliveryRate(float shadowTrafficDeliveryRate)Sets shadow traffic delivery rate.PromotedDeliveryClient.BuilderwithUseGrpc(boolean useGrpc)Whether to use gRPC instead of HTTP for delivery.PromotedDeliveryClient.BuilderwithWarmup(boolean warmup)Sets warmup, which will optionally prime the HTTPClient connection pool.PromotedDeliveryClient.BuilderwitPerformChecks(boolean performChecks)Sets performChecks, which will optionally cause extra validations to occur on delivery requests.
-
-
-
Method Detail
-
withDeliveryEndpoint
public PromotedDeliveryClient.Builder withDeliveryEndpoint(String deliveryEndpoint)
Sets delivery endpoint.- Parameters:
deliveryEndpoint- the delivery endpoint- Returns:
- the builder
-
withDeliveryApiKey
public PromotedDeliveryClient.Builder withDeliveryApiKey(String deliveryApiKey)
Sets delivery api key.- Parameters:
deliveryApiKey- the delivery api key- Returns:
- the builder
-
withDeliveryTimeoutMillis
public PromotedDeliveryClient.Builder withDeliveryTimeoutMillis(long deliveryTimeoutMillis)
Sets delivery timeout millis.- Parameters:
deliveryTimeoutMillis- the delivery timeout millis- Returns:
- the builder
-
withMetricsEndpoint
public PromotedDeliveryClient.Builder withMetricsEndpoint(String metricsEndpoint)
Sets metrics endpoint.- Parameters:
metricsEndpoint- the metrics endpoint- Returns:
- the builder
-
withMetricsApiKey
public PromotedDeliveryClient.Builder withMetricsApiKey(String metricsApiKey)
Sets metrics aoi key.- Parameters:
metricsApiKey- the metrics api key- Returns:
- the builder
-
withMetricsTimeoutMillis
public PromotedDeliveryClient.Builder withMetricsTimeoutMillis(long metricsTimoutMillis)
Sets metrics timeout millis.- Parameters:
metricsTimoutMillis- the metrics timout millis- Returns:
- the builder
-
witPerformChecks
public PromotedDeliveryClient.Builder witPerformChecks(boolean performChecks)
Sets performChecks, which will optionally cause extra validations to occur on delivery requests.- Parameters:
performChecks- the performChecks value- Returns:
- the builder
-
withBlockingShadowTraffic
public PromotedDeliveryClient.Builder withBlockingShadowTraffic(boolean blockingShadowTraffic)
Sets blockingShadowTraffic, which determines whether or not shadow traffic delivery is a blocking call.- Parameters:
blockingShadowTraffic- the blockingShadowTraffic value- Returns:
- the builder
-
withWarmup
public PromotedDeliveryClient.Builder withWarmup(boolean warmup)
Sets warmup, which will optionally prime the HTTPClient connection pool.- Parameters:
warmup- the warmup- Returns:
- the builder
-
withExecutor
public PromotedDeliveryClient.Builder withExecutor(Executor executor)
Sets executor.- Parameters:
executor- the metrics executor- Returns:
- the builder
-
withApplyTreatmentChecker
public PromotedDeliveryClient.Builder withApplyTreatmentChecker(ApplyTreatmentChecker applyTreatmentChecker)
Sets apply treatment checker.- Parameters:
applyTreatmentChecker- the apply treatment checker- Returns:
- the builder
-
withApiFactory
public PromotedDeliveryClient.Builder withApiFactory(ApiFactory apiFactory)
Sets API factory.- Parameters:
apiFactory- the API factory- Returns:
- the builder
-
withMaxRequestInsertions
public PromotedDeliveryClient.Builder withMaxRequestInsertions(int maxRequestInsertions)
Sets max request insertions.- Parameters:
maxRequestInsertions- the max request insertions- Returns:
- the builder
-
withShadowTrafficDeliveryRate
public PromotedDeliveryClient.Builder withShadowTrafficDeliveryRate(float shadowTrafficDeliveryRate)
Sets shadow traffic delivery rate.- Parameters:
shadowTrafficDeliveryRate- the shadow traffic delivery rate- Returns:
- the builder
-
withSampler
public PromotedDeliveryClient.Builder withSampler(Sampler sampler)
Sets sampler, which we use for sampling shadow traffic.- Parameters:
sampler- the sampler- Returns:
- the builder
-
withAcceptGzip
public PromotedDeliveryClient.Builder withAcceptGzip(boolean acceptGzip)
Sets accept gzip encoding header. Defauls to true.- Parameters:
acceptGzip- accepts gzip- Returns:
- the builder
-
withUseGrpc
public PromotedDeliveryClient.Builder withUseGrpc(boolean useGrpc)
Whether to use gRPC instead of HTTP for delivery. Defauls to false.- Parameters:
useGrpc- uses gRPC- Returns:
- the builder
-
build
public PromotedDeliveryClient build()
Builds thePromotedDeliveryClient.- Returns:
- the promoted delivery client
-
-