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 Type
    Method
    Description
    boolean
    Checks whether a service with this name is already registered.
    Returns all services that currently have the given health status.
    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, 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

    • 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

      List<RegisteredServiceEntity> findAllByStatus(HealthStatus status)
      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

      boolean existsByName(String name)
      Checks whether a service with this name is already registered.
      Parameters:
      name - the service name to check
      Returns:
      true if a service with this name exists