Interface BackupSource

All Superinterfaces:
AutoCloseable

public interface BackupSource extends AutoCloseable
Repeatable file-backed backup input with an explicit owner. Metadata is a commitment, not proof of authenticity. Verifiers must count and hash actual input even when an implementation advertises trusted-looking values. Callers close each stream and finally the source. A source must not be consumed concurrently with its close operation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the identifier committed by the backup manifest.
    void
    Releases owned input and storage.
    long
    Returns the complete archive length.
    Opens an independent stream at offset zero.
    Returns the commitment to the complete archive bytes.
  • Method Details

    • backupId

      PkiId backupId()
      Returns the identifier committed by the backup manifest.
      Returns:
      stable backup identifier
    • contentLength

      long contentLength()
      Returns the complete archive length.
      Returns:
      nonnegative byte count
    • sha256

      String sha256()
      Returns the commitment to the complete archive bytes.
      Returns:
      lowercase hexadecimal SHA-256
    • openStream

      InputStream openStream() throws IOException
      Opens an independent stream at offset zero.
      Returns:
      caller-owned input stream
      Throws:
      IOException - if opening fails or the source is closed
    • close

      void close() throws IOException
      Releases owned input and storage. File-backed sources close their open streams and delete their own file. Successful repeated close is harmless; failed deletion is reported and can be retried.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if resource release or deletion fails