Interface OutboxRecordRepository

  • All Implemented Interfaces:

    
    public interface OutboxRecordRepository
    
                        

    Repository interface for managing outbox records.

    Provides methods for persisting, querying, and managing outbox records in the underlying data store.

    Since:

    0.1.0

    Author:

    Roland Beisel

    • Constructor Detail

    • Method Detail

      • save

         abstract OutboxRecord save(OutboxRecord record)

        Saves an outbox record to the repository.

        Parameters:
        record - The outbox record to save
        Returns:

        The saved outbox record

      • findPendingRecords

         abstract List<OutboxRecord> findPendingRecords()

        Finds all pending outbox records that are ready for processing. Implementations must return records sorted by creation time ascending

        Returns:

        List of pending outbox records

      • findCompletedRecords

         abstract List<OutboxRecord> findCompletedRecords()

        Finds all completed outbox records. Implementations must return records sorted by creation time ascending

        Returns:

        List of completed outbox records

      • findFailedRecords

         abstract List<OutboxRecord> findFailedRecords()

        Finds all failed outbox records. Implementations must return records sorted by creation time ascending

        Returns:

        List of failed outbox records

      • findAggregateIdsWithPendingRecords

         abstract List<String> findAggregateIdsWithPendingRecords(OutboxRecordStatus status, Integer batchSize)

        Finds aggregate IDs that have pending records with the specified status.

        Parameters:
        status - The status to filter by
        batchSize - Maximum number of aggregate IDs to return
        Returns:

        List of aggregate IDs with pending records

      • findAllIncompleteRecordsByAggregateId

         abstract List<OutboxRecord> findAllIncompleteRecordsByAggregateId(String aggregateId)

        Finds all incomplete records for a specific aggregate ID. Implementations must return records sorted by creation time ascending

        Parameters:
        aggregateId - The aggregate ID to search for
        Returns:

        List of incomplete outbox records for the aggregate

      • deleteById

         abstract Unit deleteById(String id)

        Deletes a record by its unique ID.

        Parameters:
        id - The unique identifier of the outbox record
      • findAggregateIdsInPartitions

         abstract List<String> findAggregateIdsInPartitions(List<Integer> partitions, OutboxRecordStatus status, Integer batchSize)

        Finds aggregate IDs that have pending records in specific partitions.

        Parameters:
        partitions - List of partition numbers to search in
        status - The status to filter by
        batchSize - Maximum number of aggregate IDs to return
        Returns:

        List of aggregate IDs with pending records in the specified partitions

      • countRecordsByPartition

         abstract Long countRecordsByPartition(Integer partition, OutboxRecordStatus status)

        Counts records in a specific partition by status.

        Parameters:
        partition - The partition number
        status - The status to count
        Returns:

        Number of records in the partition with the specified status