Interface ServiceRegistry


public interface ServiceRegistry
Defines a registry of downstream services
  • Method Details

    • register

      void register(ServiceTarget serviceTarget, Map<String,String> configurations)
      Register a service target in the registry
      Parameters:
      serviceTarget - the service target
      configurations - any configurations applicable for the service
    • deregister

      void deregister(String service, ServiceType serviceType)
      De-register a service from the registry
      Parameters:
      service - the service name
    • getService

      Service getService(String service)
      Gets a registered service by name
      Parameters:
      service - the name of the service
      Returns:
      the service instance or null if not found
    • saveState

      void saveState(String service, boolean healthy, String message)
      Saves the current state of the service
      Parameters:
      service - the service to save the state
      healthy - whether it is healthy (true for healthy, false otherwise)
      message - Optional state message (ignored if healthy)
    • getState

      List<State> getState(String service, int count)
      Gets the state of the given service
      Parameters:
      service - the service name
      count - the number of states to get
      Returns:
      the last count states of the given service
    • getEntries

      Map<String,Service> getEntries(ServiceType serviceType)
      Get a map of all registered services and their configurations
      Parameters:
      serviceType - the type of service to get
      Returns:
      a map of all registered services and their configurations
    • update

      void update(String target, String option, String value)