Interface EndpointListDecoder<T>

Type Parameters:
T - the type of the file in Central Dogma
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EndpointListDecoder<T>
Decodes the content of a file in Central Dogma into a list of Endpoints.
  • Field Details

    • JSON

      static final EndpointListDecoder<JsonNode> JSON
      Default EndpointListDecoder implementation for JsonNode. Retrieved object must be a JSON array (which has format as "[\"segment1\", \"segment2\"]") Each segment represents an endpoint whose format is <host>[:<port_number>[:weight]], such as:
      • "foo.com" - default port number, default weight (1000)
      • "bar.com:8080 - port number 8080, default weight (1000)
      • "10.0.2.15:0:500 - default port number, weight 500
      • "192.168.1.2:8443:700 - port number 8443, weight 700
      Note that the port number must be specified when you want to specify the weight.
    • TEXT

      static final EndpointListDecoder<String> TEXT
      Default EndpointListDecoder implementation for String. Retrieved object must be a string which is a list of segments separated by a newline character. Each segment represents an endpoint whose format is <host>[:<port_number>[:weight]], such as:
      • "foo.com" - default port number, default weight (1000)
      • "bar.com:8080 - port number 8080, default weight (1000)
      • "10.0.2.15:0:500 - default port number, weight 500
      • "192.168.1.2:8443:700 - port number 8443, weight 700
      Note that the port number must be specified when you want to specify the weight.
  • Method Details

    • decode

      List<Endpoint> decode(T object)
      Decodes an object into a set of Endpoints.
      Parameters:
      object - an object retrieved from Central Dogma.
      Returns:
      the list of Endpoints