Klasse DatabaseBackupService

java.lang.Object
de.delinkedde.areashopreborn.application.DatabaseBackupService

public final class DatabaseBackupService extends Object
Creates and verifies consistent SQLite backups inside plugin-owned storage.
  • Konstruktordetails

    • DatabaseBackupService

      public DatabaseBackupService(Database database, EstateRepository estates, Path pluginDataFolder, String directoryName, int retentionCount)
      Creates a backup service.
      Parameter:
      database - SQLite owner and executor
      estates - audit repository
      pluginDataFolder - plugin-owned data directory
      directoryName - backup directory relative to the plugin data directory
      retentionCount - number of newest complete backups to retain
    • DatabaseBackupService

      public DatabaseBackupService(Database database, EstateRepository estates, Path pluginDataFolder, String directoryName, int retentionCount, long maximumBackupBytes, long maximumManifestBytes, int maximumDirectoryEntries)
      Creates a production backup service with explicit resource limits.
      Parameter:
      database - SQLite owner and executor
      estates - audit repository
      pluginDataFolder - plugin-owned data directory
      directoryName - backup directory relative to the plugin data directory
      retentionCount - number of newest complete backups to retain
      maximumBackupBytes - maximum permitted snapshot size
      maximumManifestBytes - maximum permitted manifest size
      maximumDirectoryEntries - maximum entries scanned during retention
    • DatabaseBackupService

      public DatabaseBackupService(Database database, EstateRepository estates, Path storageRoot, Clock clock, int retentionCount)
      Creates a testable backup service with an explicit clock and normalized storage root.
      Parameter:
      database - SQLite owner and executor
      estates - audit repository
      storageRoot - normalized backup directory
      clock - timestamp source
      retentionCount - number of newest complete backups to retain
    • DatabaseBackupService

      public DatabaseBackupService(Database database, EstateRepository estates, Path storageRoot, Clock clock, int retentionCount, long maximumBackupBytes, long maximumManifestBytes, int maximumDirectoryEntries)
      Creates a testable bounded backup service.
      Parameter:
      database - SQLite owner and executor
      estates - audit repository
      storageRoot - normalized backup directory
      clock - timestamp source
      retentionCount - number of newest complete backups to retain
      maximumBackupBytes - maximum permitted snapshot size
      maximumManifestBytes - maximum permitted manifest size
      maximumDirectoryEntries - maximum entries scanned during retention
  • Methodendetails

    • create

      public CompletableFuture<DatabaseBackup> create(UUID administratorId)
      Creates a consistent database snapshot, integrity manifest, and audit entry.
      Parameter:
      administratorId - administrator requesting the backup
      Gibt zurück:
      future containing the verified artifact metadata
    • verify

      public CompletableFuture<DatabaseBackup> verify(String databaseFile)
      Verifies manifest metadata, SHA-256, size, SQLite integrity, and schema version.
      Parameter:
      databaseFile - exact backup file name returned by create(UUID)
      Gibt zurück:
      future containing verified metadata