Interface RegisteredServiceRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<RegisteredServiceEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<RegisteredServiceEntity,,Long> org.springframework.data.repository.ListCrudRepository<RegisteredServiceEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<RegisteredServiceEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<RegisteredServiceEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<RegisteredServiceEntity>,org.springframework.data.repository.Repository<RegisteredServiceEntity,Long>
@Repository
public interface RegisteredServiceRepository
extends org.springframework.data.jpa.repository.JpaRepository<RegisteredServiceEntity,Long>
Spring Data JPA repository for
RegisteredServiceEntity.
Provides finder methods by service name (used during registration to detect duplicates) and retrieval of all active services consumed by the polling scheduler.
- Author:
- Nazar Montytskyi
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByName(String name) Checks whether a service with this name is already registered.findAllByStatus(HealthStatus status) Returns all services that currently have the given health status.findByName(String name) Finds a service by its unique logical name.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
-
findByName
Finds a service by its unique logical name. Used during registration to detect duplicates.- Parameters:
name- the service name from@MonitoredMicroservice(name = "...")- Returns:
- the entity if it exists
-
findAllByStatus
Returns all services that currently have the given health status. Used by the dashboard aggregate query (FR-3) and alert evaluation (FR-4).- Parameters:
status- the target health status- Returns:
- list of matching services
-
existsByName
Checks whether a service with this name is already registered.- Parameters:
name- the service name to check- Returns:
trueif a service with this name exists
-