Interface OutboxRecordRepository
-
- All Implemented Interfaces:
public interface OutboxRecordRepositoryRepository interface for managing outbox records.
Provides methods for persisting, querying, and managing outbox records in the underlying data store.
- Since:
0.1.0
Roland Beisel
-
-
Method Summary
Modifier and Type Method Description abstract OutboxRecordsave(OutboxRecord record)Saves an outbox record to the repository. abstract List<OutboxRecord>findPendingRecords()Finds all pending outbox records that are ready for processing. abstract List<OutboxRecord>findCompletedRecords()Finds all completed outbox records. abstract List<OutboxRecord>findFailedRecords()Finds all failed outbox records. abstract List<String>findAggregateIdsWithPendingRecords(OutboxRecordStatus status, Integer batchSize)Finds aggregate IDs that have pending records with the specified status. abstract List<OutboxRecord>findAllIncompleteRecordsByAggregateId(String aggregateId)Finds all incomplete records for a specific aggregate ID. abstract UnitdeleteByStatus(OutboxRecordStatus status)Deletes all records with the specified status. abstract UnitdeleteByAggregateIdAndStatus(String aggregateId, OutboxRecordStatus status)Deletes records for a specific aggregate ID and status. abstract UnitdeleteById(String id)Deletes a record by its unique ID. abstract List<String>findAggregateIdsInPartitions(List<Integer> partitions, OutboxRecordStatus status, Integer batchSize)Finds aggregate IDs that have pending records in specific partitions. abstract LongcountRecordsByPartition(Integer partition, OutboxRecordStatus status)Counts records in a specific partition by status. abstract List<OutboxRecord>findRecordsByPartition(Integer partition, OutboxRecordStatus status)Finds all records in a specific partition. -
-
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 bybatchSize- 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
-
deleteByStatus
abstract Unit deleteByStatus(OutboxRecordStatus status)
Deletes all records with the specified status.
- Parameters:
status- The status of records to delete
-
deleteByAggregateIdAndStatus
abstract Unit deleteByAggregateIdAndStatus(String aggregateId, OutboxRecordStatus status)
Deletes records for a specific aggregate ID and status.
- Parameters:
aggregateId- The aggregate IDstatus- The status of records to delete
-
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 instatus- The status to filter bybatchSize- 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 numberstatus- The status to count- Returns:
Number of records in the partition with the specified status
-
findRecordsByPartition
abstract List<OutboxRecord> findRecordsByPartition(Integer partition, OutboxRecordStatus status)
Finds all records in a specific partition.
- Parameters:
partition- The partition numberstatus- The status to filter by (optional)- Returns:
List of records in the partition
-
-
-
-