Class PostgresExecutionRepository

java.lang.Object
com.iantapply.orchestra.adapter.postgres.PostgresExecutionRepository
All Implemented Interfaces:
com.iantapply.orchestra.port.ExecutionRepository

public final class PostgresExecutionRepository extends Object implements com.iantapply.orchestra.port.ExecutionRepository
PostgreSQL execution repository with atomic version-checked updates.
  • Constructor Details

    • PostgresExecutionRepository

      public PostgresExecutionRepository(DataSource dataSource)
      Creates an execution repository.
      Parameters:
      dataSource - database connection pool
  • Method Details

    • create

      public void create(com.iantapply.orchestra.domain.EventExecution execution)
      Specified by:
      create in interface com.iantapply.orchestra.port.ExecutionRepository
    • find

      public Optional<com.iantapply.orchestra.domain.EventExecution> find(UUID id)
      Specified by:
      find in interface com.iantapply.orchestra.port.ExecutionRepository
    • findDue

      public Collection<com.iantapply.orchestra.domain.EventExecution> findDue(Instant now, int limit)
      Specified by:
      findDue in interface com.iantapply.orchestra.port.ExecutionRepository
    • findActive

      public Collection<com.iantapply.orchestra.domain.EventExecution> findActive(int limit)
      Specified by:
      findActive in interface com.iantapply.orchestra.port.ExecutionRepository
    • compareAndSet

      public boolean compareAndSet(long expectedVersion, com.iantapply.orchestra.domain.EventExecution replacement)
      Specified by:
      compareAndSet in interface com.iantapply.orchestra.port.ExecutionRepository