Module io.github.bucket4j.core
Enum Class RecoveryStrategy
- All Implemented Interfaces:
Serializable,Comparable<RecoveryStrategy>,Constable
Specifies the reaction which should be applied in case of previously saved state of bucket has been lost.
The state of bucket can be lost by many reasons, for example:
- Split-brain happen.
- The bucket state was stored on single jvm node without replication strategy and this node was crashed.
- Wrong cache configuration.
- Pragmatically errors introduced by vendor.
- Human mistake.
DefaultBucketProxy detects that bucket state is missed, it applies this strategy to react.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic RecoveryStrategyReturns the enum constant of this class with the specified name.static RecoveryStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RECONSTRUCT
Initialize bucket yet another time. Use this strategy if availability is more preferred than consistency. -
THROW_BUCKET_NOT_FOUND_EXCEPTION
ThrowBucketNotFoundException. Use this strategy if consistency is more preferred than availability.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-