Interface StorageProvider

All Known Implementing Classes:
FileSystemStorageProvider

public interface StorageProvider
Provider responsible for moving Batch representations through storage lifecycle, eventually completing the batch into it's final completion state that is ready for ingestion into AuditServices.
  • Method Details

    • newBatch

      Batch newBatch()
      Create a new Batch storage representation
      Returns:
      new Batch storage representation
    • completeBatch

      Batch completeBatch(Batch batch)
      Complete a Batch to its completion state
      Parameters:
      batch - The Batch storage representation to complete
      Returns:
      The completed Batch representation
      Throws:
      AtomicMoveException - If atomically moving the batch to completion state fails
    • review

      void review(Consumer<Stream<Batch>> consumer)
      Preview all completed batches as a stream of Batch instances. The stream is automatically closed once the consumer exits.
      Parameters:
      consumer - A consumer receiving a stream of paths for review
    • nextIngestionBatch

      @Nullable Batch nextIngestionBatch()
      Grab the next available completed batch from storage for ingestion.
      Returns:
      The next available completed batch from storage. Null if none available.
      Throws:
      AtomicMoveException - If atomically moving the batch to ingestion processing state fails