Class RecoveryConfig.Builder
java.lang.Object
co.mindus.ip2location.RecoveryConfig.Builder
- Enclosing class:
RecoveryConfig
Builder for creating
RecoveryConfig instances.- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionautoRecoveryCooldownMinutes(int minutes) Sets the cooldown period between recovery attempts.build()Builds the RecoveryConfig instance.initFailureThreshold(int threshold) Sets the threshold for consecutive initialization failures.lookupErrorThreshold(int threshold) Sets the threshold for consecutive lookup errors.maxAutoRecoveryAttempts(int attempts) Sets the maximum number of automatic recovery attempts.notifyOnTransientErrors(boolean notify) Sets whether to notify listeners on transient errors.recoverOnCorruption(boolean recover) Sets whether to trigger recovery on database corruption.recoverOnDownloadFailure(boolean recover) Sets whether to trigger recovery after download failures.Sets the action to take when recovery is triggered.
Constructor Details
Builder
public Builder()
Method Details
recoveryAction
Sets the action to take when recovery is triggered.- Parameters:
action- The recovery action (default: NOTIFY_ONLY)- Returns:
- This builder
initFailureThreshold
Sets the threshold for consecutive initialization failures.- Parameters:
threshold- Number of failures before recovery (default: 2, minimum: 1)- Returns:
- This builder
lookupErrorThreshold
Sets the threshold for consecutive lookup errors.- Parameters:
threshold- Number of errors before recovery (default: 10, minimum: 1)- Returns:
- This builder
recoverOnDownloadFailure
Sets whether to trigger recovery after download failures.- Parameters:
recover-trueto enable (default: false)- Returns:
- This builder
recoverOnCorruption
Sets whether to trigger recovery on database corruption.- Parameters:
recover-trueto enable (default: true)- Returns:
- This builder
maxAutoRecoveryAttempts
Sets the maximum number of automatic recovery attempts.- Parameters:
attempts- Maximum attempts (default: 3, minimum: 1)- Returns:
- This builder
autoRecoveryCooldownMinutes
Sets the cooldown period between recovery attempts.- Parameters:
minutes- Cooldown in minutes (default: 60, minimum: 1)- Returns:
- This builder
notifyOnTransientErrors
Sets whether to notify listeners on transient errors.- Parameters:
notify-trueto enable (default: false)- Returns:
- This builder
build