Class RootIoClient

java.lang.Object
io.root.patcher.RootIoClient

public class RootIoClient extends Object
HTTP client for querying the Root.io /v3/analyze/maven API, with exponential backoff retries.
  • Constructor Details

    • RootIoClient

      public RootIoClient(int maxRetries, long baseDelayMs)
      Creates a client with the given retry settings and exponential backoff.
      Parameters:
      maxRetries - maximum number of retry attempts after the initial request
      baseDelayMs - base delay in milliseconds; doubles on each subsequent attempt
  • Method Details

    • query

      public String query(String coords, String apiUrl, String apiKey)
      Query the Root.io API for a patch for the given dependency, with exponential backoff retries. Retries on network errors and 5xx responses; fails immediately on 4xx.
      Parameters:
      coords - Maven GAV string — "group:artifact:version"
      apiUrl - Root.io API base URL (e.g. "...")
      apiKey - Root.io API key (used as HTTP basic auth username)
      Returns:
      patched GAV string ("io.root.group:artifact:version"), or null if no patch
      Throws:
      org.gradle.api.GradleException - after all retries are exhausted, or immediately on 4xx