You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ot...@apache.org on 2009/01/14 05:53:50 UTC

svn commit: r734326 - /lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java

Author: otis
Date: Tue Jan 13 20:53:50 2009
New Revision: 734326

URL: http://svn.apache.org/viewvc?rev=734326&view=rev
Log:
SOLR-958 - Javadoc improvements

Modified:
    lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java

Modified: lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java?rev=734326&r1=734325&r2=734326&view=diff
==============================================================================
--- lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java (original)
+++ lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java Tue Jan 13 20:53:50 2009
@@ -29,7 +29,15 @@
 import java.util.zip.GZIPInputStream;
 import java.util.zip.InflaterInputStream;
 
-import org.apache.commons.httpclient.*;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpConnectionManager;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
+import org.apache.commons.httpclient.NoHttpResponseException;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
 import org.apache.commons.httpclient.methods.PostMethod;
@@ -65,6 +73,11 @@
    */
   protected String _baseURL;
   protected ModifiableSolrParams _invariantParams;
+  
+  /**
+   * Default response parser is BinaryResponseParser 
+   * @see org.apache.solr.client.solrj.impl.BinaryResponseParser
+   */
   protected ResponseParser _parser;
   
   private final HttpClient _httpClient;
@@ -73,6 +86,8 @@
   private int _maxRetries = 0;
   
   /**
+   * Default value: <b> false </b> 
+   * <p>
    * If set to false, add the query parameters as URL-encoded parameters to the
    * POST request in a single part. If set to true, create a new part of a
    * multi-part request for each parameter.
@@ -125,15 +140,14 @@
     this(baseURL, null, new BinaryResponseParser(), false);
   }
 
-  public CommonsHttpSolrServer(URL baseURL, HttpClient client){
+  public CommonsHttpSolrServer(URL baseURL, HttpClient client) {
     this(baseURL, client, new BinaryResponseParser(), false);
   }
-  
-  public CommonsHttpSolrServer(URL baseURL, HttpClient client, boolean useMultiPartPost){
+
+  public CommonsHttpSolrServer(URL baseURL, HttpClient client, boolean useMultiPartPost) {
     this(baseURL, client, new BinaryResponseParser(), useMultiPartPost);
   }
 
-
   public CommonsHttpSolrServer(URL baseURL, HttpClient client, ResponseParser parser, boolean useMultiPartPost) {
     _baseURL = baseURL.toExternalForm();
     if( _baseURL.endsWith( "/" ) ) {
@@ -153,7 +167,6 @@
       this.setMaxTotalConnections( 128 ); // 20
     }
 
-    // by default use the binary response parser
     _parser = parser;
     
     this.useMultiPartPost = useMultiPartPost;
@@ -420,8 +433,9 @@
   }
 
   /**
-   * Note: Setting this value is not thread-safe.
-   * @param processor The {@link org.apache.solr.client.solrj.ResponseParser}
+   * Note: This setter method is <b>not thread-safe</b>.
+   * @param processor 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.SolrRequest#getResponseParser()
    */
   public void setParser(ResponseParser processor) {
     _parser = processor;
@@ -478,9 +492,9 @@
   }
 
   /**
-   *  set maximum number of retries to attempt in the event of
-   *  transient errors.  Default: 0 (no) retries. No more than 1
-   *  recommended.
+   * set maximum number of retries to attempt in the event of
+   * transient errors.  Default: 0 (no) retries. No more than 1
+   * recommended.
    */
   public void setMaxRetries( int maxRetries ) {
     _maxRetries = maxRetries;