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 classPollableOptions.ConstantPollStrategyThis represents thePollableOptions.PollStrategyType.CONSTANTpolling strategy.static classPollableOptions.ExponentialPollStrategyThis represents thePollableOptions.PollStrategyType.EXPONENTIALpolling strategy with back-off and jitter.static classPollableOptions.LinearPollStrategyThis represents thePollableOptions.PollStrategyType.LINEARpolling strategy.static classPollableOptions.PollStrategy<S extends PollableOptions.PollStrategy<S>>Abstract class representing the base polling strategy and its type.static classPollableOptions.PollStrategyTypeRepresents 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 booleancanEqual(Object other)PollableOptionsconstantStrategy(int interval)Creates a constant polling strategy.PollableOptionscopy()booleanequals(Object o)PollableOptionserrorLimit(int errorLimit)PollableOptionsexponentialStrategy(int interval, int min, int max)Creates an exponential polling strategy.intgetErrorLimit()This represents the number of polling failures permitted before stopping.intgetLimit()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.inthashCode()PollableOptionslimit(int limit)PollableOptionslinearStrategy(int start, int increment)Creates a linear polling strategy.PollableOptionsstrategy(PollableOptions.PollStrategy<?> strategy)
-
-
-
Constructor Detail
-
PollableOptions
public PollableOptions()
-
PollableOptions
public PollableOptions(PollableOptions pollableOptions)
-
-
Method Detail
-
copy
public PollableOptions copy()
- Specified by:
copyin 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)
-
-