Interface BackupManager

All Known Implementing Classes:
NullBackupManager, SimpleBackupManager

public interface BackupManager
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    automaticBackup​(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)
    This will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled.
    static void
    backup​(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)
    This will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled.
    int
    Get the maximum amount of backups that may be stored for a plot-owner combo
    @NonNull Path
    Get the directory in which backups are stored
    @NonNull BackupProfile
    getProfile​(@NonNull Plot plot)
    Get the backup profile for a plot based on its current owner (if there is one)
    boolean
    Returns true if (potentially) destructive actions should cause PlotSquared to create automatic plot backups
  • Method Details

    • backup

      static void backup(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)
      This will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled. Otherwise it will complete immediately.
      Parameters:
      player - Player that triggered the backup
      plot - Plot to perform the automatic backup on
      whenDone - Action that runs when the automatic backup has been completed
    • getProfile

      @NonNull BackupProfile getProfile(@NonNull Plot plot)
      Get the backup profile for a plot based on its current owner (if there is one)
      Parameters:
      plot - Plot to get the backup profile for
      Returns:
      Backup profile
    • automaticBackup

      void automaticBackup(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)
      This will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled. Otherwise it will complete immediately.
      Parameters:
      player - Player that triggered the backup
      plot - Plot to perform the automatic backup on
      whenDone - Action that runs when the automatic backup has been completed
    • getBackupPath

      @NonNull Path getBackupPath()
      Get the directory in which backups are stored
      Returns:
      Backup directory path
    • getBackupLimit

      int getBackupLimit()
      Get the maximum amount of backups that may be stored for a plot-owner combo
      Returns:
      Backup limit
    • shouldAutomaticallyBackup

      boolean shouldAutomaticallyBackup()
      Returns true if (potentially) destructive actions should cause PlotSquared to create automatic plot backups
      Returns:
      True if automatic backups are enabled