/** * Constructs an instance with the given parameters. * * Caution: retryPolicyFactory and metrics params must be thread-safe if multiple threads are * concurrently calling the same {@link RetryingSolrServer}. */ public RetryingSolrServer(SolrClient solrServer, RetryPolicyFactory retryPolicyFactory, MetricsFacade metrics) { if (solrServer == null) { throw new IllegalArgumentException("solrServer param must not be null"); } this.solrServer = solrServer; if (retryPolicyFactory == null) { throw new IllegalArgumentException("retryPolicyFactory param must not be null"); } this.retryPolicyFactory = retryPolicyFactory; if (metrics == null) { metrics = new NullMetricsFacade(); } this.metrics = metrics; }