Package com.fauna.client
Class ExponentialBackoffStrategy.Builder
- java.lang.Object
-
- com.fauna.client.ExponentialBackoffStrategy.Builder
-
- Enclosing class:
- ExponentialBackoffStrategy
public static class ExponentialBackoffStrategy.Builder extends java.lang.ObjectBuilder class for the ExponentialBackoffStrategy. Allows fluent configuration of the backoff strategy parameters.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExponentialBackoffStrategy.BuilderbackoffFactor(float backoffFactor)Sets the backoff factor.ExponentialBackoffStrategybuild()Builds and returns a new ExponentialBackoffStrategy instance.ExponentialBackoffStrategy.BuilderinitialIntervalMillis(int initialIntervalMillis)Sets the initial interval (in milliseconds) for the first retry attempt.ExponentialBackoffStrategy.BuilderjitterFactor(float jitterFactor)Sets the jitter factor (between 0 and 1) to control how much to jitter the backoff delay.ExponentialBackoffStrategy.BuildermaxAttempts(int maxAttempts)Sets the maximum number of retry attempts.ExponentialBackoffStrategy.BuildermaxBackoffMillis(int maxBackoffMillis)Sets the maximum backoff (in milliseconds) between retries.
-
-
-
Method Detail
-
maxAttempts
public ExponentialBackoffStrategy.Builder maxAttempts(int maxAttempts)
Sets the maximum number of retry attempts.- Parameters:
maxAttempts- The maximum number of retry attempts.- Returns:
- The current Builder instance.
-
backoffFactor
public ExponentialBackoffStrategy.Builder backoffFactor(float backoffFactor)
Sets the backoff factor.- Parameters:
backoffFactor- The factor by which the backoff delay increases.- Returns:
- The current Builder instance.
-
initialIntervalMillis
public ExponentialBackoffStrategy.Builder initialIntervalMillis(int initialIntervalMillis)
Sets the initial interval (in milliseconds) for the first retry attempt.- Parameters:
initialIntervalMillis- The initial interval in milliseconds.- Returns:
- The current Builder instance.
-
maxBackoffMillis
public ExponentialBackoffStrategy.Builder maxBackoffMillis(int maxBackoffMillis)
Sets the maximum backoff (in milliseconds) between retries.- Parameters:
maxBackoffMillis- The maximum backoff in milliseconds.- Returns:
- The current Builder instance.
-
jitterFactor
public ExponentialBackoffStrategy.Builder jitterFactor(float jitterFactor)
Sets the jitter factor (between 0 and 1) to control how much to jitter the backoff delay.- Parameters:
jitterFactor- The jitter factor.- Returns:
- The current Builder instance.
-
build
public ExponentialBackoffStrategy build()
Builds and returns a new ExponentialBackoffStrategy instance.- Returns:
- A new ExponentialBackoffStrategy.
-
-