Class PostgresExecutionRepository
java.lang.Object
com.iantapply.orchestra.adapter.postgres.PostgresExecutionRepository
- All Implemented Interfaces:
ExecutionRepository
PostgreSQL execution repository with atomic version-checked updates.
-
Constructor Summary
ConstructorsConstructorDescriptionPostgresExecutionRepository(DataSource dataSource) Creates an execution repository. -
Method Summary
Modifier and TypeMethodDescriptionbooleancompareAndSet(long expectedVersion, EventExecution replacement) Replaces an execution only if its current version equals the expected version.voidcreate(EventExecution execution) Persists a new execution.Finds one execution.findActive(int limit) Finds execution state eligible for startup recovery.Finds runnable work due on or before a time.
-
Constructor Details
-
PostgresExecutionRepository
Creates an execution repository.- Parameters:
dataSource- database connection pool
-
-
Method Details
-
create
Description copied from interface:ExecutionRepositoryPersists a new execution.- Specified by:
createin interfaceExecutionRepository- Parameters:
execution- new execution to persist
-
find
Description copied from interface:ExecutionRepositoryFinds one execution.- Specified by:
findin interfaceExecutionRepository- Parameters:
id- execution identifier- Returns:
- matching execution, if present
-
findDue
Description copied from interface:ExecutionRepositoryFinds runnable work due on or before a time.- Specified by:
findDuein interfaceExecutionRepository- Parameters:
now- inclusive due-time boundarylimit- maximum results- Returns:
- runnable executions ordered by due time when supported
-
findActive
Description copied from interface:ExecutionRepositoryFinds execution state eligible for startup recovery.- Specified by:
findActivein interfaceExecutionRepository- Parameters:
limit- maximum results- Returns:
- executions eligible for startup recovery
-
compareAndSet
Description copied from interface:ExecutionRepositoryReplaces an execution only if its current version equals the expected version.- Specified by:
compareAndSetin interfaceExecutionRepository- Parameters:
expectedVersion- version observed by the callerreplacement- complete replacement value- Returns:
- whether the replacement was persisted
-