Interface DiscoveryContext<T>

All Known Implementing Classes:
GenericDiscoveryContext, IntegerDiscoveryContext, MapDiscoveryContext, StringDiscoveryContext

public interface DiscoveryContext<T>
Bridge between the specifics of your needs and the generic implementation
  • Method Details

    • getInstanceRefreshMs

      int getInstanceRefreshMs()
      Return the threshold in milliseconds to consider a registration stale
      Returns:
      number of milliseconds
    • getServiceDiscovery

      ServiceDiscovery<T> getServiceDiscovery()
      Return the service singleton
      Returns:
      service
    • marshallJson

      void marshallJson(com.fasterxml.jackson.databind.node.ObjectNode node, String fieldName, T payload) throws Exception
      Serialize your payload
      Parameters:
      node - the node to serialize into
      fieldName - field name to use
      payload - the payload value (can be null)
      Throws:
      Exception - any errors
    • unMarshallJson

      T unMarshallJson(com.fasterxml.jackson.databind.JsonNode node) throws Exception
      Deserialize your payload
      Parameters:
      node - the node that has the payload
      Returns:
      the payload or null
      Throws:
      Exception - any errors
    • getProviderStrategy

      ProviderStrategy<T> getProviderStrategy()
      Return the provider strategy to use for DiscoveryResource.getAny(String)
      Returns:
      strategy