Class PollableOptions
- java.lang.Object
-
- com.broadleafcommerce.metadata.dsl.core.extension.PollableOptions
-
- All Implemented Interfaces:
Copyable<PollableOptions>
,Serializable
public class PollableOptions extends Object implements Serializable, Copyable<PollableOptions>
- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PollableOptions.ConstantPollStrategy
This represents thePollableOptions.PollStrategyType.CONSTANT
polling strategy.static class
PollableOptions.ExponentialPollStrategy
This represents thePollableOptions.PollStrategyType.EXPONENTIAL
polling strategy with back-off and jitter.static class
PollableOptions.LinearPollStrategy
This represents thePollableOptions.PollStrategyType.LINEAR
polling strategy.static class
PollableOptions.PollStrategy<S extends PollableOptions.PollStrategy<S>>
Abstract class representing the base polling strategy and its type.static class
PollableOptions.PollStrategyType
Represents the type of strategy used to when calculating the interval at which to poll.
-
Constructor Summary
Constructors Constructor Description PollableOptions()
PollableOptions(PollableOptions pollableOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
PollableOptions
constantStrategy(int interval)
Creates a constant polling strategy.PollableOptions
copy()
boolean
equals(Object o)
PollableOptions
errorLimit(int errorLimit)
PollableOptions
exponentialStrategy(int interval, int min, int max)
Creates an exponential polling strategy.int
getErrorLimit()
This represents the number of polling failures permitted before stopping.int
getLimit()
This represents the number of poll requests permitted before stopping.PollableOptions.PollStrategy<?>
getStrategy()
This represents the strategy used for calculating the interval between each poll request.int
hashCode()
PollableOptions
limit(int limit)
PollableOptions
linearStrategy(int start, int increment)
Creates a linear polling strategy.PollableOptions
strategy(PollableOptions.PollStrategy<?> strategy)
-
-
-
Constructor Detail
-
PollableOptions
public PollableOptions()
-
PollableOptions
public PollableOptions(PollableOptions pollableOptions)
-
-
Method Detail
-
copy
public PollableOptions copy()
- Specified by:
copy
in interfaceCopyable<PollableOptions>
- Returns:
- a deep copy of this instance
-
errorLimit
public PollableOptions errorLimit(int errorLimit)
-
limit
public PollableOptions limit(int limit)
-
strategy
public PollableOptions strategy(PollableOptions.PollStrategy<?> strategy)
-
constantStrategy
public PollableOptions constantStrategy(int interval)
Creates a constant polling strategy.- Parameters:
interval
- the constant interval at which to poll- Returns:
- this
-
linearStrategy
public PollableOptions linearStrategy(int start, int increment)
Creates a linear polling strategy.- Parameters:
start
- the base interval at which to pollincrement
- the increment at which the starting interval is increased each poll- Returns:
- this
-
exponentialStrategy
public PollableOptions exponentialStrategy(int interval, int min, int max)
Creates an exponential polling strategy.- Parameters:
interval
- the base intervalmin
- the minimum interval at which to pollmax
- the minimum interval at which to poll- Returns:
- this
-
getErrorLimit
public int getErrorLimit()
This represents the number of polling failures permitted before stopping.
-
getLimit
public int getLimit()
This represents the number of poll requests permitted before stopping.
-
getStrategy
public PollableOptions.PollStrategy<?> getStrategy()
This represents the strategy used for calculating the interval between each poll request.
-
canEqual
protected boolean canEqual(Object other)
-
-