Class IP2LocationAdminConfig.Builder

java.lang.Object
com.iizix.server.geo.ip2location.IP2LocationAdminConfig.Builder
Enclosing class:
IP2LocationAdminConfig

public static final class IP2LocationAdminConfig.Builder extends Object
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 Details

    • enabled

      public IP2LocationAdminConfig.Builder enabled(boolean enabled)
      Sets the switch.
      Parameters:
      enabled - The switch.
      Returns:
      This builder.
    • token

      public IP2LocationAdminConfig.Builder token(String token)
      Sets the download token.
      Parameters:
      token - The token, trimmed; null for none.
      Returns:
      This builder.
    • databasePath

      public IP2LocationAdminConfig.Builder databasePath(String path)
      Sets the database directory.
      Parameters:
      path - The directory, trimmed; null for none.
      Returns:
      This builder.
    • database

      public IP2LocationAdminConfig.Builder database(String name)
      Sets the database tier.
      Parameters:
      name - The tier name, trimmed; null or empty for the default.
      Returns:
      This builder.
    • ipMode

      public IP2LocationAdminConfig.Builder ipMode(IPMode mode)
      Sets the IP mode.
      Parameters:
      mode - The mode, null for IPv4 only.
      Returns:
      This builder.
    • memoryMapped

      public IP2LocationAdminConfig.Builder memoryMapped(boolean 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

      public IP2LocationAdminConfig.Builder initFailureThreshold(int threshold)
      Sets the initialization failure threshold.
      Parameters:
      threshold - The count.
      Returns:
      This builder.
    • lookupErrorThreshold

      public IP2LocationAdminConfig.Builder lookupErrorThreshold(int threshold)
      Sets the lookup error threshold.
      Parameters:
      threshold - The count.
      Returns:
      This builder.
    • maxAutoRecoveryAttempts

      public IP2LocationAdminConfig.Builder maxAutoRecoveryAttempts(int attempts)
      Sets the maximum automatic recovery attempts.
      Parameters:
      attempts - The count.
      Returns:
      This builder.
    • recoveryCooldownMinutes

      public IP2LocationAdminConfig.Builder recoveryCooldownMinutes(int minutes)
      Sets the recovery cooldown.
      Parameters:
      minutes - The minutes.
      Returns:
      This builder.
    • recoverOnDownloadFailure

      public IP2LocationAdminConfig.Builder recoverOnDownloadFailure(boolean recover)
      Sets whether a download failure triggers the recovery.
      Parameters:
      recover - The flag.
      Returns:
      This builder.
    • recoverOnCorruption

      public IP2LocationAdminConfig.Builder recoverOnCorruption(boolean recover)
      Sets whether a database corruption triggers the recovery.
      Parameters:
      recover - The flag.
      Returns:
      This builder.
    • notifyOnTransientErrors

      public IP2LocationAdminConfig.Builder notifyOnTransientErrors(boolean notify)
      Sets whether transient errors are notified.
      Parameters:
      notify - The flag.
      Returns:
      This builder.
    • build

      public IP2LocationAdminConfig build()
      Builds the configuration.
      Returns:
      The immutable configuration.