diff --git a/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java b/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java index 5f586331a2b..cf744ffbc28 100644 --- a/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java +++ b/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java @@ -58,6 +58,8 @@ import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.ContentStream; import org.apache.solr.common.util.NamedList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -66,23 +68,55 @@ import org.apache.solr.common.util.NamedList; */ public class CommonsHttpSolrServer extends SolrServer { + /** + * User-Agent String as identified by the HTTP request by the {@link + * org.apache.commons.httpclient.HttpClient HttpClient} to the Solr + * server from the client. + */ public static final String AGENT = "Solr["+CommonsHttpSolrServer.class.getName()+"] 1.0"; + private static Logger log = LoggerFactory.getLogger(CommonsHttpSolrServer.class); + /** * The URL of the Solr server. */ protected String _baseURL; + + /** + * Default value: null / empty.
+ * Parameters that are added to every request regardless. This may be a place to add + * something like an authentication token. + */ protected ModifiableSolrParams _invariantParams; /** - * Default response parser is BinaryResponseParser + * Default response parser is BinaryResponseParser + * This parser represents the default Response Parser chosen to + * parse the response if the parser were not specified as part of + * the request. * @see org.apache.solr.client.solrj.impl.BinaryResponseParser */ protected ResponseParser _parser; private final HttpClient _httpClient; + + /** + * This defaults to false under the + * assumption that if you are following a redirect to get to a Solr + * installation, something is misconfigured somewhere. + */ private boolean _followRedirects = false; + + /** + * If compression is enabled, both gzip and deflate compression will + * be accepted in the HTTP response. + */ private boolean _allowCompression = false; + + /** + * Maximum number of retries to attempt in the event of transient + * errors. Default: 0 (no) retries. No more than 1 recommended. + */ private int _maxRetries = 0; /** @@ -112,7 +146,8 @@ public class CommonsHttpSolrServer extends SolrServer this(new URL(solrServerUrl)); } - /** Talk to the Solr server via the given HttpClient. The connection manager + /** + * Talk to the Solr server via the given HttpClient. The connection manager * for the client should be a MultiThreadedHttpConnectionManager if this * client is being reused across SolrServer instances, or of multiple threads * will use this SolrServer. @@ -130,10 +165,9 @@ public class CommonsHttpSolrServer extends SolrServer } /** - * @param baseURL The URL of the Solr server. For - * example, "http://localhost:8983/solr/
"
- * if you are using the standard distribution Solr webapp
- * on your local machine.
+ * @param baseURL The URL of the Solr server. For example,
+ * "http://localhost:8983/solr/
" if you are using the
+ * standard distribution Solr webapp on your local machine.
*/
public CommonsHttpSolrServer(URL baseURL)
{
@@ -144,10 +178,17 @@ public class CommonsHttpSolrServer extends SolrServer
this(baseURL, client, new BinaryResponseParser(), false);
}
+ /**
+ *
+ * @see #useMultiPartPost
+ */
public CommonsHttpSolrServer(URL baseURL, HttpClient client, boolean useMultiPartPost) {
this(baseURL, client, new BinaryResponseParser(), useMultiPartPost);
}
+ /**
+ * @see {@link #useMultiPartPost}, {@link #_parser}
+ */
public CommonsHttpSolrServer(URL baseURL, HttpClient client, ResponseParser parser, boolean useMultiPartPost) {
_baseURL = baseURL.toExternalForm();
if( _baseURL.endsWith( "/" ) ) {
@@ -197,8 +238,7 @@ public class CommonsHttpSolrServer extends SolrServer
}
- public NamedList