java.lang.Object
io.confluent.kafka.schemaregistry.client.rest.utils.UrlList

public class UrlList extends Object
This class manages a set of urls for accessing an upstream registry. It basically maintains a pointer to a known good url which can be accessed through current(). When a request against the current url fails, the fail(String) method is invoked, and we'll move on to the next url (returning back to the start if we have to).
  • Constructor Details

    • UrlList

      public UrlList(List<String> urls)
    • UrlList

      public UrlList(String url)
  • Method Details

    • randomizeIndex

      public void randomizeIndex()
    • urls

      public List<String> urls()
    • current

      public String current()
      Get the current url
      Returns:
      the url
    • fail

      public void fail(String url)
      Declare the given url as failed. This will cause the urls to rotate, so that the next request will be done against a new url (if one exists).
      Parameters:
      url - the url that has failed
    • size

      public int size()
      The number of unique urls contained in this collection.
      Returns:
      the count of urls
    • toString

      public String toString()
      Overrides:
      toString in class Object