Interface AlertRuleRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<AlertRuleEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<AlertRuleEntity,Long>, org.springframework.data.repository.ListCrudRepository<AlertRuleEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<AlertRuleEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<AlertRuleEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<AlertRuleEntity>, org.springframework.data.repository.Repository<AlertRuleEntity,Long>

@Repository public interface AlertRuleRepository extends org.springframework.data.jpa.repository.JpaRepository<AlertRuleEntity,Long>
Spring Data JPA repository for AlertRuleEntity.

Provides finder methods for retrieving enabled rules by service ID, used by AlertEvaluationService during each alert evaluation cycle.

Author:
Nazar Montytskyi
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all alert rules for a specific service.
    Returns only the enabled alert rules for a service.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findAllByServiceId

      List<AlertRuleEntity> findAllByServiceId(Long serviceId)
      Returns all alert rules for a specific service. Used by the alert rules management page.
      Parameters:
      serviceId - the service identifier
      Returns:
      all rules for the service (enabled and disabled)
    • findAllByServiceIdAndEnabledTrue

      List<AlertRuleEntity> findAllByServiceIdAndEnabledTrue(Long serviceId)
      Returns only the enabled alert rules for a service. Used by AlertEvaluationService after every metric record is saved.
      Parameters:
      serviceId - the service identifier
      Returns:
      enabled rules to evaluate