Interface HeaderProvider

All Known Subinterfaces:
HeaderConsumer

public interface HeaderProvider
API used to obtain headers when reading propagated tracing information incoming across service boundaries.
  • Method Details

    • empty

      static HeaderProvider empty()
      Empty headers.
      Returns:
      empty headers provider
    • create

      static HeaderProvider create(Map<String,List<String>> inboundHeaders)
      Header provider from an existing map of headers (can be read only).
      Parameters:
      inboundHeaders - headers to use
      Returns:
      a new header provider
    • keys

      Iterable<String> keys()
      All keys available in the headers (header names).
      Returns:
      iterable of keys
    • get

      Optional<String> get(String key)
      Get a header based on its name.
      Parameters:
      key - name of the header
      Returns:
      first header value if present in the headers
    • getAll

      Iterable<String> getAll(String key)
      Get a header based on its name, returning all values.
      Parameters:
      key - name of the header
      Returns:
      all header values, or empty iterable if the header does not exist
    • contains

      boolean contains(String key)
      Whether a header is present.
      Parameters:
      key - name of the header
      Returns:
      true if the header exists