Class AbstractJdbcFlowRepository

java.lang.Object
io.kestra.jdbc.repository.AbstractJdbcRepository
io.kestra.jdbc.repository.AbstractJdbcFlowRepository
All Implemented Interfaces:
io.kestra.core.repositories.FlowRepositoryInterface

public abstract class AbstractJdbcFlowRepository extends AbstractJdbcRepository implements io.kestra.core.repositories.FlowRepositoryInterface
  • Field Details

  • Constructor Details

    • AbstractJdbcFlowRepository

      public AbstractJdbcFlowRepository(AbstractJdbcRepository<io.kestra.core.models.flows.Flow> jdbcRepository, io.micronaut.context.ApplicationContext applicationContext)
  • Method Details

    • findById

      public Optional<io.kestra.core.models.flows.Flow> findById(String tenantId, String namespace, String id, Optional<Integer> revision, Boolean allowDeleted)
      Specified by:
      findById in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findByIdWithoutAcl

      public Optional<io.kestra.core.models.flows.Flow> findByIdWithoutAcl(String tenantId, String namespace, String id, Optional<Integer> revision)
      Specified by:
      findByIdWithoutAcl in interface io.kestra.core.repositories.FlowRepositoryInterface
    • fromLastRevision

      protected org.jooq.Table<org.jooq.Record> fromLastRevision(boolean asterisk)
    • revisionDefaultFilter

      protected org.jooq.Condition revisionDefaultFilter(String tenantId)
    • noAclDefaultFilter

      protected org.jooq.Condition noAclDefaultFilter(String tenantId)
    • defaultExecutionFilter

      protected org.jooq.Condition defaultExecutionFilter(String tenantId)
    • findByIdWithSource

      public Optional<io.kestra.core.models.flows.FlowWithSource> findByIdWithSource(String tenantId, String namespace, String id, Optional<Integer> revision, Boolean allowDeleted)
      Specified by:
      findByIdWithSource in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findRevisions

      public List<io.kestra.core.models.flows.FlowWithSource> findRevisions(String tenantId, String namespace, String id)
      Specified by:
      findRevisions in interface io.kestra.core.repositories.FlowRepositoryInterface
    • count

      public int count(String tenantId)
      Specified by:
      count in interface io.kestra.core.repositories.FlowRepositoryInterface
    • countForNamespace

      public int countForNamespace(String tenantId, @Nullable String namespace)
      Specified by:
      countForNamespace in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findAll

      public List<io.kestra.core.models.flows.Flow> findAll(String tenantId)
      Specified by:
      findAll in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findAllForAllTenants

      public List<io.kestra.core.models.flows.Flow> findAllForAllTenants()
      Specified by:
      findAllForAllTenants in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findAllWithSource

      public List<io.kestra.core.models.flows.FlowWithSource> findAllWithSource(String tenantId)
      Specified by:
      findAllWithSource in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findAllWithSourceForAllTenants

      public List<io.kestra.core.models.flows.FlowWithSource> findAllWithSourceForAllTenants()
      Specified by:
      findAllWithSourceForAllTenants in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findByNamespace

      public List<io.kestra.core.models.flows.Flow> findByNamespace(String tenantId, String namespace)
      Specified by:
      findByNamespace in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findByNamespacePrefix

      public List<io.kestra.core.models.flows.Flow> findByNamespacePrefix(String tenantId, String namespacePrefix)
      Specified by:
      findByNamespacePrefix in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findByNamespaceExecutable

      public List<io.kestra.core.models.flows.FlowForExecution> findByNamespaceExecutable(String tenantId, String namespace)
      Specified by:
      findByNamespaceExecutable in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findByNamespaceWithSource

      public List<io.kestra.core.models.flows.FlowWithSource> findByNamespaceWithSource(String tenantId, String namespace)
      Specified by:
      findByNamespaceWithSource in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findCondition

      protected abstract org.jooq.Condition findCondition(String query, Map<String,String> labels)
    • find

      public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.flows.Flow> find(io.micronaut.data.model.Pageable pageable, @Nullable String query, @Nullable String tenantId, @Nullable List<io.kestra.core.models.flows.FlowScope> scope, @Nullable String namespace, @Nullable Map<String,String> labels)
      Specified by:
      find in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findWithSource

      public List<io.kestra.core.models.flows.FlowWithSource> findWithSource(@Nullable String query, @Nullable String tenantId, @Nullable List<io.kestra.core.models.flows.FlowScope> scope, @Nullable String namespace, @Nullable Map<String,String> labels)
      Specified by:
      findWithSource in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findSourceCodeCondition

      protected abstract org.jooq.Condition findSourceCodeCondition(String query)
    • findSourceCode

      public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.SearchResult<io.kestra.core.models.flows.Flow>> findSourceCode(io.micronaut.data.model.Pageable pageable, @Nullable String query, @Nullable String tenantId, @Nullable String namespace)
      Specified by:
      findSourceCode in interface io.kestra.core.repositories.FlowRepositoryInterface
    • create

      public io.kestra.core.models.flows.FlowWithSource create(io.kestra.core.models.flows.Flow flow, String flowSource, io.kestra.core.models.flows.Flow flowWithDefaults) throws jakarta.validation.ConstraintViolationException
      Specified by:
      create in interface io.kestra.core.repositories.FlowRepositoryInterface
      Throws:
      jakarta.validation.ConstraintViolationException
    • update

      public io.kestra.core.models.flows.FlowWithSource update(io.kestra.core.models.flows.Flow flow, io.kestra.core.models.flows.Flow previous, String flowSource, io.kestra.core.models.flows.Flow flowWithDefaults) throws jakarta.validation.ConstraintViolationException
      Specified by:
      update in interface io.kestra.core.repositories.FlowRepositoryInterface
      Throws:
      jakarta.validation.ConstraintViolationException
    • delete

      public io.kestra.core.models.flows.Flow delete(io.kestra.core.models.flows.Flow flow)
      Specified by:
      delete in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findDistinctNamespace

      public List<String> findDistinctNamespace(String tenantId)
      Specified by:
      findDistinctNamespace in interface io.kestra.core.repositories.FlowRepositoryInterface
    • findDistinctNamespaceExecutable

      public List<String> findDistinctNamespaceExecutable(String tenantId)
      Specified by:
      findDistinctNamespaceExecutable in interface io.kestra.core.repositories.FlowRepositoryInterface
    • lastRevision

      public Integer lastRevision(String tenantId, String namespace, String id)
      Specified by:
      lastRevision in interface io.kestra.core.repositories.FlowRepositoryInterface