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 TypeMethodDescriptionfindAllByServiceId(Long serviceId) Returns all alert rules for a specific service.findAllByServiceIdAndEnabledTrue(Long serviceId) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAllByServiceId
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
Returns only the enabled alert rules for a service. Used byAlertEvaluationServiceafter every metric record is saved.- Parameters:
serviceId- the service identifier- Returns:
- enabled rules to evaluate
-