Package io.kestra.jdbc.repository
Class AbstractJdbcServiceInstanceRepository
java.lang.Object
io.kestra.jdbc.repository.AbstractJdbcRepository
io.kestra.jdbc.repository.AbstractJdbcServiceInstanceRepository
- All Implemented Interfaces:
io.kestra.core.repositories.ServiceInstanceRepositoryInterface
public abstract class AbstractJdbcServiceInstanceRepository
extends AbstractJdbcRepository
implements io.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractJdbcRepository<io.kestra.core.server.ServiceInstance> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJdbcServiceInstanceRepository(AbstractJdbcRepository<io.kestra.core.server.ServiceInstance> jdbcRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(io.kestra.core.server.ServiceInstance instance) voiddelete(org.jooq.DSLContext context, io.kestra.core.server.ServiceInstance instance) io.kestra.core.repositories.ArrayListTotal<io.kestra.core.server.ServiceInstance> find(io.micronaut.data.model.Pageable pageable, Set<io.kestra.core.server.Service.ServiceState> states, Set<io.kestra.core.server.Service.ServiceType> types) List<io.kestra.core.server.ServiceInstance> findAll()List<io.kestra.core.server.ServiceInstance> findAllInstancesBetween(io.kestra.core.server.Service.ServiceType type, Instant from, Instant to) List<io.kestra.core.server.ServiceInstance> Finds all service instances which areService.ServiceState.NOT_RUNNING.List<io.kestra.core.server.ServiceInstance> findAllInstancesInNotRunningState(org.jooq.Configuration configuration, boolean isForUpdate) Finds all service instances which areService.ServiceState.NOT_RUNNING.List<io.kestra.core.server.ServiceInstance> findAllInstancesInState(io.kestra.core.server.Service.ServiceState state) List<io.kestra.core.server.ServiceInstance> findAllInstancesInStates(Set<io.kestra.core.server.Service.ServiceState> states) List<io.kestra.core.server.ServiceInstance> findAllInstancesInStates(org.jooq.Configuration configuration, Set<io.kestra.core.server.Service.ServiceState> states, boolean isForUpdate) List<io.kestra.core.server.ServiceInstance> Finds all service instances which are NOTService.ServiceState.RUNNING.List<io.kestra.core.server.ServiceInstance> findAllNonRunningInstances(org.jooq.Configuration configuration, boolean isForUpdate) Finds all service instances which are NOTService.ServiceState.RUNNING.Optional<io.kestra.core.server.ServiceInstance> Optional<io.kestra.core.server.ServiceInstance> io.kestra.core.server.ServiceStateTransition.ResponsemayTransitionServiceTo(io.kestra.core.server.ServiceInstance instance, io.kestra.core.server.Service.ServiceState newState, String reason) io.kestra.core.server.ServiceStateTransition.ResponsemayTransitServiceTo(org.jooq.Configuration configuration, io.kestra.core.server.ServiceInstance instance, io.kestra.core.server.Service.ServiceState newState, String reason) Attempt to transition the state of a given service to given new state.io.kestra.core.server.ServiceInstancesave(io.kestra.core.server.ServiceInstance instance) voidtransaction(org.jooq.TransactionalRunnable runnable) <T> TtransactionResult(org.jooq.TransactionalCallable<T> runnable) Methods inherited from class io.kestra.jdbc.repository.AbstractJdbcRepository
buildTenantCondition, defaultFilter, defaultFilter, defaultFilter, defaultFilter, field, field, groupByFields, groupByFields, groupByFields, groupByFields, weekFromTimestampMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.kestra.core.repositories.ServiceInstanceRepositoryInterface
mayTransitionServiceTo
-
Field Details
-
jdbcRepository
-
-
Constructor Details
-
AbstractJdbcServiceInstanceRepository
public AbstractJdbcServiceInstanceRepository(AbstractJdbcRepository<io.kestra.core.server.ServiceInstance> jdbcRepository)
-
-
Method Details
-
findById
- Specified by:
findByIdin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
findById
-
findAllInstancesInState
public List<io.kestra.core.server.ServiceInstance> findAllInstancesInState(io.kestra.core.server.Service.ServiceState state) - Specified by:
findAllInstancesInStatein interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
findAllInstancesInStates
public List<io.kestra.core.server.ServiceInstance> findAllInstancesInStates(Set<io.kestra.core.server.Service.ServiceState> states) - Specified by:
findAllInstancesInStatesin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
findAllInstancesBetween
public List<io.kestra.core.server.ServiceInstance> findAllInstancesBetween(io.kestra.core.server.Service.ServiceType type, Instant from, Instant to) - Specified by:
findAllInstancesBetweenin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
findAllInstancesInStates
-
findAllNonRunningInstances
Finds all service instances which are NOTService.ServiceState.RUNNING.- Returns:
- the list of
ServiceInstance.
-
findAllNonRunningInstances
public List<io.kestra.core.server.ServiceInstance> findAllNonRunningInstances(org.jooq.Configuration configuration, boolean isForUpdate) Finds all service instances which are NOTService.ServiceState.RUNNING.- Returns:
- the list of
ServiceInstance.
-
findAllInstancesInNotRunningState
Finds all service instances which areService.ServiceState.NOT_RUNNING.- Returns:
- the list of
ServiceInstance.
-
findAllInstancesInNotRunningState
public List<io.kestra.core.server.ServiceInstance> findAllInstancesInNotRunningState(org.jooq.Configuration configuration, boolean isForUpdate) Finds all service instances which areService.ServiceState.NOT_RUNNING.- Returns:
- the list of
ServiceInstance.
-
transaction
public void transaction(org.jooq.TransactionalRunnable runnable) -
transactionResult
public <T> T transactionResult(org.jooq.TransactionalCallable<T> runnable) -
delete
public void delete(org.jooq.DSLContext context, io.kestra.core.server.ServiceInstance instance) -
delete
public void delete(io.kestra.core.server.ServiceInstance instance) - Specified by:
deletein interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
save
public io.kestra.core.server.ServiceInstance save(io.kestra.core.server.ServiceInstance instance) - Specified by:
savein interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
findAll
- Specified by:
findAllin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
find
public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.server.ServiceInstance> find(io.micronaut.data.model.Pageable pageable, Set<io.kestra.core.server.Service.ServiceState> states, Set<io.kestra.core.server.Service.ServiceType> types) - Specified by:
findin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
mayTransitionServiceTo
public io.kestra.core.server.ServiceStateTransition.Response mayTransitionServiceTo(io.kestra.core.server.ServiceInstance instance, io.kestra.core.server.Service.ServiceState newState, String reason) - Specified by:
mayTransitionServiceToin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-
mayTransitServiceTo
public io.kestra.core.server.ServiceStateTransition.Response mayTransitServiceTo(org.jooq.Configuration configuration, io.kestra.core.server.ServiceInstance instance, io.kestra.core.server.Service.ServiceState newState, String reason) Attempt to transition the state of a given service to given new state. This method may not update the service if the transition is not valid.- Parameters:
instance- the service instance.newState- the new state of the service.- Returns:
- an optional of the
ServiceInstanceorOptional.empty()if the service is not running.
-
sortMapping
- Specified by:
sortMappingin interfaceio.kestra.core.repositories.ServiceInstanceRepositoryInterface
-