Class IP2LocationAdminConfig.Builder
java.lang.Object
com.iizix.server.geo.ip2location.IP2LocationAdminConfig.Builder
- Enclosing class:
IP2LocationAdminConfig
The builder of a configuration; starts with the defaults of every setting, which are the defaults of
ServerSettings and of NetPhantom's [IP2Location] section.- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration.Sets the database tier.databasePath(String path) Sets the database directory.enabled(boolean enabled) Sets the switch.initFailureThreshold(int threshold) Sets the initialization failure threshold.Sets the IP mode.lookupErrorThreshold(int threshold) Sets the lookup error threshold.maxAutoRecoveryAttempts(int attempts) Sets the maximum automatic recovery attempts.memoryMapped(boolean memoryMapped) Sets memory-mapped file access.notifyOnTransientErrors(boolean notify) Sets whether transient errors are notified.recoverOnCorruption(boolean recover) Sets whether a database corruption triggers the recovery.recoverOnDownloadFailure(boolean recover) Sets whether a download failure triggers the recovery.recoveryCooldownMinutes(int minutes) Sets the recovery cooldown.Sets the recovery mode.Sets the download token.
Method Details
enabled
Sets the switch.- Parameters:
enabled- The switch.- Returns:
- This builder.
token
Sets the download token.- Parameters:
token- The token, trimmed; null for none.- Returns:
- This builder.
databasePath
Sets the database directory.- Parameters:
path- The directory, trimmed; null for none.- Returns:
- This builder.
database
Sets the database tier.- Parameters:
name- The tier name, trimmed; null or empty for the default.- Returns:
- This builder.
ipMode
Sets the IP mode.- Parameters:
mode- The mode, null for IPv4 only.- Returns:
- This builder.
memoryMapped
Sets memory-mapped file access.- Parameters:
memoryMapped- The flag.- Returns:
- This builder.
recoveryMode
Sets the recovery mode.- Parameters:
mode- The mode, null for notify only.- Returns:
- This builder.
initFailureThreshold
Sets the initialization failure threshold.- Parameters:
threshold- The count.- Returns:
- This builder.
lookupErrorThreshold
Sets the lookup error threshold.- Parameters:
threshold- The count.- Returns:
- This builder.
maxAutoRecoveryAttempts
Sets the maximum automatic recovery attempts.- Parameters:
attempts- The count.- Returns:
- This builder.
recoveryCooldownMinutes
Sets the recovery cooldown.- Parameters:
minutes- The minutes.- Returns:
- This builder.
recoverOnDownloadFailure
Sets whether a download failure triggers the recovery.- Parameters:
recover- The flag.- Returns:
- This builder.
recoverOnCorruption
Sets whether a database corruption triggers the recovery.- Parameters:
recover- The flag.- Returns:
- This builder.
notifyOnTransientErrors
Sets whether transient errors are notified.- Parameters:
notify- The flag.- Returns:
- This builder.
build