Class BackupConfig

java.lang.Object
com.hypixel.hytale.server.core.config.BackupConfig

public class BackupConfig extends Object
Configuration for automatic world backups.

Settings can be overridden by command-line options (Options take priority).

  • Field Details

    • DEFAULT_FREQUENCY_MINUTES

      public static final int DEFAULT_FREQUENCY_MINUTES
      Default backup frequency in minutes.
      See Also:
    • DEFAULT_MAX_COUNT

      public static final int DEFAULT_MAX_COUNT
      Default maximum number of recent backups to retain.
      See Also:
    • DEFAULT_ARCHIVE_MAX_COUNT

      public static final int DEFAULT_ARCHIVE_MAX_COUNT
      Default maximum number of archived backups to retain.
      See Also:
    • CODEC

      @Nonnull public static final Codec<BackupConfig> CODEC
  • Constructor Details

    • BackupConfig

      public BackupConfig()
    • BackupConfig

      public BackupConfig(@Nonnull HytaleServerConfig hytaleServerConfig)
  • Method Details

    • setHytaleServerConfig

      public void setHytaleServerConfig(@Nonnull HytaleServerConfig hytaleServerConfig)
    • isEnabled

      public boolean isEnabled()
      Returns whether automatic backups are enabled.

      Command-line option takes priority over config value.

      Returns:
      true if backups are enabled, false otherwise.
    • getEnabledConfig

      @Nullable public Boolean getEnabledConfig()
      Returns the raw enabled state from config, ignoring CLI.
      Returns:
      the config enabled state, or null if not set.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether automatic backups are enabled.
      Parameters:
      enabled - the enabled state to set.
    • getFrequencyMinutes

      public int getFrequencyMinutes()
      Returns the backup frequency in minutes.

      Command-line option takes priority over config value.

      Returns:
      the backup frequency in minutes.
    • getFrequencyMinutesConfig

      @Nullable public Integer getFrequencyMinutesConfig()
      Returns the raw frequency from config, ignoring CLI.
      Returns:
      the config frequency, or null if not set.
    • setFrequencyMinutes

      public void setFrequencyMinutes(int frequencyMinutes)
      Sets the backup frequency in minutes.
      Parameters:
      frequencyMinutes - the frequency to set.
    • getDirectory

      @Nullable public Path getDirectory()
      Returns the backup directory path.

      Command-line option takes priority over config value.

      Returns:
      the backup directory path, or null if not configured.
    • getDirectoryConfig

      @Nullable public String getDirectoryConfig()
      Returns the raw directory string from config, ignoring CLI.
      Returns:
      the config directory, or null if not set.
    • setDirectory

      public void setDirectory(@Nullable String directory)
      Sets the backup directory path.
      Parameters:
      directory - the directory to set.
    • getMaxCount

      public int getMaxCount()
      Returns the maximum number of recent backups to retain.

      Command-line option takes priority over config value.

      Returns:
      the maximum backup count.
    • getMaxCountConfig

      @Nullable public Integer getMaxCountConfig()
      Returns the raw max count from config, ignoring CLI.
      Returns:
      the config max count, or null if not set.
    • setMaxCount

      public void setMaxCount(int maxCount)
      Sets the maximum number of recent backups to retain.
      Parameters:
      maxCount - the max count to set.
    • getArchiveMaxCount

      public int getArchiveMaxCount()
      Returns the maximum number of archived backups to retain.

      Command-line option takes priority over config value.

      Returns:
      the maximum archive count.
    • getArchiveMaxCountConfig

      @Nullable public Integer getArchiveMaxCountConfig()
      Returns the raw archive max count from config, ignoring CLI.
      Returns:
      the config archive max count, or null if not set.
    • setArchiveMaxCount

      public void setArchiveMaxCount(int archiveMaxCount)
      Sets the maximum number of archived backups to retain.
      Parameters:
      archiveMaxCount - the archive max count to set.
    • isConfigured

      public boolean isConfigured()
      Checks if backups are properly configured (enabled with a valid directory).
      Returns:
      true if backups can be performed, false otherwise.