Apache Solr open-source search software
SOLR-457: SolrJ updates - allow client to pass HttpClient, change interfaces to classes, use InputStream for XML parser, make XML factory static
Yonik Seeley4c9faf1c008b
diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/ResponseParser.java b/client/java/solrj/src/org/apache/solr/client/solrj/ResponseParser.javaindex 0e797c113b8..1a99847d4e1 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/ResponseParser.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/ResponseParser.java@@ -18,6 +18,8 @@package org.apache.solr.client.solrj;import java.io.Reader;+import java.io.InputStream;+import java.io.InputStreamReader;import org.apache.solr.common.util.NamedList;@@ -26,8 +28,11 @@ import org.apache.solr.common.util.NamedList;* @version $Id$* @since solr 1.3*/-public interface ResponseParser+public abstract class ResponseParser{- String getWriterType(); // for example: wt=XML, JSON, etc- NamedList<Object> processResponse( Reader body );+ public abstract String getWriterType(); // for example: wt=XML, JSON, etc++ public abstract NamedList<Object> processResponse(InputStream body, String encoding);++ public abstract NamedList<Object> processResponse(Reader reader);}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/SolrRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/SolrRequest.javaindex cdb2c78f18f..f37372778f7 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/SolrRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/SolrRequest.java@@ -29,17 +29,53 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public interface SolrRequest extends Serializable+public abstract class SolrRequest implements Serializable{public enum METHOD {GET,POST};-- public String getPath();- public String getCore(); // the name of requested core- public METHOD getMethod();- public SolrParams getParams();- public Collection<ContentStream> getContentStreams() throws IOException;- public SolrResponse process( SolrServer server ) throws SolrServerException, IOException;++ private METHOD method = METHOD.GET;+ private String path = null;+ private String core = null;++ //---------------------------------------------------------+ //---------------------------------------------------------++ public SolrRequest( METHOD m, String path )+ {+ this.method = m;+ this.path = path;+ }++ //---------------------------------------------------------+ //---------------------------------------------------------++ public METHOD getMethod() {+ return method;+ }+ public void setMethod(METHOD method) {+ this.method = method;+ }++ public String getPath() {+ return path;+ }+ public void setPath(String path) {+ this.path = path;+ }++ public String getCore() {+ return core;+ }++ public void setCore(String core) {+ this.core = core;+ }+++ public abstract SolrParams getParams();+ public abstract Collection<ContentStream> getContentStreams() throws IOException;+ public abstract SolrResponse process( SolrServer server ) throws SolrServerException, IOException;}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/SolrResponse.java b/client/java/solrj/src/org/apache/solr/client/solrj/SolrResponse.javaindex ee24e128a77..aa6e4dcbea5 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/SolrResponse.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/SolrResponse.java@@ -27,8 +27,8 @@ import org.apache.solr.common.util.NamedList;* @version $Id$* @since solr 1.3*/-public interface SolrResponse extends Serializable+public abstract class SolrResponse implements Serializable{- long getElapsedTime();- NamedList<Object> getResponse();+ public abstract long getElapsedTime();+ public abstract NamedList<Object> getResponse();}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java b/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.javaindex 23407e7eac6..0e9ffa58dcf 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java@@ -165,6 +165,7 @@ public class EmbeddedSolrServer extends SolrServerQueryResponseWriter responseWriter = core.getQueryResponseWriter(req);StringWriter out = new StringWriter();responseWriter.write(out, req, rsp);+ // TODO: writers might be able to output binary somedayreq.close();return _processor.processResponse( new StringReader( out.toString() ) );diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java b/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.javaindex 685bf73f92b..4b2b1ee2212 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java@@ -29,14 +29,7 @@ import java.util.Iterator;import java.util.zip.GZIPInputStream;import java.util.zip.InflaterInputStream;-import org.apache.commons.httpclient.Header;-import org.apache.commons.httpclient.HttpClient;-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.*;import org.apache.commons.httpclient.methods.GetMethod;import org.apache.commons.httpclient.methods.InputStreamRequestEntity;import org.apache.commons.httpclient.methods.PostMethod;@@ -88,6 +81,15 @@ public class CommonsHttpSolrServer extends SolrServerthis(new URL(solrServerUrl));}+ /** 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.+ */+ public CommonsHttpSolrServer(String solrServerUrl, HttpClient httpClient) throws MalformedURLException {+ this(new URL(solrServerUrl), httpClient);+ }+/*** @param baseURL The URL of the Solr server. For* example, "<code>http://localhost:8983/solr/</code>"@@ -96,17 +98,26 @@ public class CommonsHttpSolrServer extends SolrServer*/public CommonsHttpSolrServer(URL baseURL){+ this(baseURL, null);+ }+++ private CommonsHttpSolrServer(URL baseURL, HttpClient client) {this._baseURL = baseURL.toExternalForm();if( this._baseURL.endsWith( "/" ) ) {this._baseURL = this._baseURL.substring( 0, this._baseURL.length()-1 );}-- this._httpClient = createHttpClient();-- // increase the default connections- this.setDefaultMaxConnectionsPerHost( 32 ); // 2- this.setMaxTotalConnections( 128 ); // 20-++ _httpClient = (client == null) ? new HttpClient(new MultiThreadedHttpConnectionManager()) : client;++ if (client == null) {+ // set some better defaults if we created a new connection manager and client++ // increase the default connections+ this.setDefaultMaxConnectionsPerHost( 32 ); // 2+ this.setMaxTotalConnections( 128 ); // 20+ }+// by default use the XML one_processor = new XMLResponseParser();@@ -115,14 +126,7 @@ public class CommonsHttpSolrServer extends SolrServer_invariantParams.set( CommonParams.WT, _processor.getWriterType() );_invariantParams.set( CommonParams.VERSION, "2.2" );}-- /**- * This can be overridden to add certificates etc- */- protected HttpClient createHttpClient()- {- return new HttpClient( new MultiThreadedHttpConnectionManager() );- }+//------------------------------------------------------------------------//------------------------------------------------------------------------@@ -320,8 +324,7 @@ public class CommonsHttpSolrServer extends SolrServer}}}- Reader reader = new InputStreamReader( respBody, charset );- return _processor.processResponse( reader );+ return _processor.processResponse(respBody, charset);}catch (HttpException e) {throw new SolrServerException( e );@@ -362,11 +365,15 @@ public class CommonsHttpSolrServer extends SolrServer_processor = processor;}- public MultiThreadedHttpConnectionManager getConnectionManager() {- return (MultiThreadedHttpConnectionManager)_httpClient.getHttpConnectionManager();+ public HttpClient getHttpClient() {+ return _httpClient;+ }++ private HttpConnectionManager getConnectionManager() {+ return _httpClient.getHttpConnectionManager();}- /** set connectionTimeout on the underlying MultiThreadedHttpConnectionManager */+ /** set connectionTimeout on the underlying HttpConnectionManager */public void setConnectionTimeout(int timeout) {getConnectionManager().getParams().setConnectionTimeout(timeout);}@@ -376,17 +383,17 @@ public class CommonsHttpSolrServer extends SolrServer_httpClient.getParams().setConnectionManagerTimeout(timeout);}- /** set soTimeout (read timeout) on the underlying MultiThreadedHttpConnectionManager. This is desirable for queries, but probably not for indexing. */+ /** set soTimeout (read timeout) on the underlying HttpConnectionManager. This is desirable for queries, but probably not for indexing. */public void setSoTimeout(int timeout) {getConnectionManager().getParams().setSoTimeout(timeout);}- /** set maxConnectionsPerHost on the underlying MultiThreadedHttpConnectionManager */+ /** set maxConnectionsPerHost on the underlying HttpConnectionManager */public void setDefaultMaxConnectionsPerHost(int connections) {getConnectionManager().getParams().setDefaultMaxConnectionsPerHost(connections);}- /** set maxTotalConnection on the underlying MultiThreadedHttpConnectionManager */+ /** set maxTotalConnection on the underlying HttpConnectionManager */public void setMaxTotalConnections(int connections) {getConnectionManager().getParams().setMaxTotalConnections(connections);}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/impl/XMLResponseParser.java b/client/java/solrj/src/org/apache/solr/client/solrj/impl/XMLResponseParser.javaindex f17c214b967..ff6a36d493f 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/impl/XMLResponseParser.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/impl/XMLResponseParser.java@@ -18,6 +18,7 @@package org.apache.solr.client.solrj.impl;import java.io.Reader;+import java.io.InputStream;import java.util.ArrayList;import java.util.Date;import java.util.List;@@ -40,14 +41,14 @@ import org.apache.solr.common.util.NamedList;* @version $Id$* @since solr 1.3*/-public class XMLResponseParser implements ResponseParser+public class XMLResponseParser extends ResponseParser{public static Logger log = Logger.getLogger(XMLResponseParser.class.getName());-- XMLInputFactory factory;-- public XMLResponseParser()- {++ // reuse the factory among all parser instances so things like string caches+ // won't be duplicated+ static final XMLInputFactory factory;+ static {factory = XMLInputFactory.newInstance();try {// The java 1.6 bundled stax parser (sjsxp) does not currently have a thread-safe@@ -64,25 +65,43 @@ public class XMLResponseParser implements ResponseParserlog.fine( "Unable to set the 'reuse-instance' property for the input factory: "+factory );}}++ public XMLResponseParser() {}public String getWriterType(){return "xml";}+ public NamedList<Object> processResponse(Reader in) {+ XMLStreamReader parser = null;+ try {+ parser = factory.createXMLStreamReader(in);+ } catch (XMLStreamException e) {+ throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "parsing error", e);+ }++ return processResponse(parser);+ }++ public NamedList<Object> processResponse(InputStream in, String encoding)+ {+ XMLStreamReader parser = null;+ try {+ parser = factory.createXMLStreamReader(in, encoding);+ } catch (XMLStreamException e) {+ throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "parsing error", e);+ }++ return processResponse(parser);+ }+/*** parse the text into a named list...*/- public NamedList<Object> processResponse( Reader in )+ private NamedList<Object> processResponse(XMLStreamReader parser){- XMLStreamReader parser = null;- try {-// String txt = IOUtils.toString( in );-// in = new StringReader( txt );-// System.out.println( "TEXT:"+txt );-- parser = factory.createXMLStreamReader(in);-+ try {NamedList<Object> response = null;for (int event = parser.next();event != XMLStreamConstants.END_DOCUMENT;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXMLRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXMLRequest.javanew file mode 100644index 00000000000..933d4cb283b--- /dev/null+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXMLRequest.java@@ -0,0 +1,62 @@+/**+ * Licensed to the Apache Software Foundation (ASF) under one or more+ * contributor license agreements. See the NOTICE file distributed with+ * this work for additional information regarding copyright ownership.+ * The ASF licenses this file to You under the Apache License, Version 2.0+ * (the "License"); you may not use this file except in compliance with+ * the License. You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package org.apache.solr.client.solrj.request;++import java.io.IOException;+import java.util.Collection;++import org.apache.solr.client.solrj.SolrServer;+import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;+import org.apache.solr.client.solrj.response.UpdateResponse;+import org.apache.solr.client.solrj.util.ClientUtils;+import org.apache.solr.common.params.SolrParams;+import org.apache.solr.common.util.ContentStream;++/**+ * Send arbitrary XML to a request handler+ *+ * @version $Id$+ * @since solr 1.3+ */+public class DirectXmlRequest extends SolrRequest+{+ final String xml;++ public DirectXmlRequest( String path, String body )+ {+ super( METHOD.POST, path );+ xml = body;+ }++ public Collection<ContentStream> getContentStreams() {+ return ClientUtils.toContentStreams( xml, ClientUtils.TEXT_XML );+ }++ public SolrParams getParams() {+ return null;+ }++ public UpdateResponse process( SolrServer server ) throws SolrServerException, IOException+ {+ long startTime = System.currentTimeMillis();+ UpdateResponse res = new UpdateResponse( server.request( this ) );+ res.setElapsedTime( System.currentTimeMillis()-startTime );+ return res;+ }+}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXmlRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXmlRequest.javaindex 7fb6cc5d4d6..933d4cb283b 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXmlRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/DirectXmlRequest.java@@ -22,6 +22,7 @@ import java.util.Collection;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.UpdateResponse;import org.apache.solr.client.solrj.util.ClientUtils;import org.apache.solr.common.params.SolrParams;@@ -33,7 +34,7 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public class DirectXmlRequest extends RequestBase+public class DirectXmlRequest extends SolrRequest{final String xml;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/LukeRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/LukeRequest.javaindex 4146c9902f8..50c0a47ddb1 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/LukeRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/LukeRequest.java@@ -24,6 +24,7 @@ import java.util.List;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.LukeResponse;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.ModifiableSolrParams;@@ -35,7 +36,7 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public class LukeRequest extends RequestBase+public class LukeRequest extends SolrRequest{private List<String> fields;private int count = -1;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.javaindex 411a2daabaf..59997b19617 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java@@ -22,6 +22,7 @@ import java.util.Collection;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.MultiCoreResponse;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.params.MultiCoreParams;@@ -34,7 +35,7 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public class MultiCoreRequest extends RequestBase+public class MultiCoreRequest extends SolrRequest{private MultiCoreParams.MultiCoreAction action = null;private String core = null;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/QueryRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/QueryRequest.javaindex 8876c2d0035..86356395018 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/QueryRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/QueryRequest.java@@ -21,6 +21,7 @@ import java.util.Collection;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.QueryResponse;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.SolrParams;@@ -31,7 +32,7 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public class QueryRequest extends RequestBase+public class QueryRequest extends SolrRequest{private SolrParams query;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/RequestBase.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/RequestBase.javadeleted file mode 100644index 6c5d474522d..00000000000--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/RequestBase.java+++ /dev/null@@ -1,66 +0,0 @@-/**- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--package org.apache.solr.client.solrj.request;--import org.apache.solr.client.solrj.SolrRequest;--/**- *- * @version $Id$- * @since solr 1.3- */-public abstract class RequestBase implements SolrRequest-{- private METHOD method = METHOD.GET;- private String path = null;- private String core = null;-- //---------------------------------------------------------- //----------------------------------------------------------- public RequestBase( METHOD m, String path )- {- this.method = m;- this.path = path;- }-- //---------------------------------------------------------- //----------------------------------------------------------- public METHOD getMethod() {- return method;- }- public void setMethod(METHOD method) {- this.method = method;- }-- public String getPath() {- return path;- }- public void setPath(String path) {- this.path = path;- }-- public String getCore() {- return core;- }-- public void setCore(String core) {- this.core = core;- }-}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/SolrPing.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/SolrPing.javaindex d21b14731be..aff782dc280 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/SolrPing.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/SolrPing.java@@ -22,9 +22,9 @@ import java.util.Collection;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.SolrPingResponse;import org.apache.solr.common.params.ModifiableSolrParams;-import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.ContentStream;/**@@ -32,7 +32,7 @@ import org.apache.solr.common.util.ContentStream;* @version $Id$* @since solr 1.3*/-public class SolrPing extends RequestBase+public class SolrPing extends SolrRequest{private ModifiableSolrParams params;diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java b/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.javaindex f2297f3a2c4..4f9370cd36f 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java@@ -25,6 +25,7 @@ import java.util.List;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.response.UpdateResponse;import org.apache.solr.client.solrj.util.ClientUtils;import org.apache.solr.common.SolrInputDocument;@@ -39,7 +40,7 @@ import org.apache.solr.common.util.XML;* @version $Id$* @since solr 1.3*/-public class UpdateRequest extends RequestBase+public class UpdateRequest extends SolrRequest{public enum ACTION {COMMIT,@@ -139,6 +140,7 @@ public class UpdateRequest extends RequestBaseif( documents != null && documents.size() > 0 ) {writer.write("<add ");writer.write("allowDups=\"" + allowDups + "\" ");+ // TODO: remove these when deprecations are removedwriter.write("overwriteCommitted=\"" + overwriteCommitted + "\" ");writer.write("overwritePending=\"" + overwritePending + "\">");for (SolrInputDocument doc : documents ) {@@ -243,6 +245,7 @@ public class UpdateRequest extends RequestBasethis.allowDups = allowDups;}+ @Deprecatedpublic boolean isOverwriteCommitted() {return overwriteCommitted;}@@ -255,6 +258,7 @@ public class UpdateRequest extends RequestBasethis.overwriteCommitted = overwriteCommitted;}+ @Deprecatedpublic boolean isOverwritePending() {return overwritePending;}diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java b/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.javaindex b6dda7b3837..851c1609531 100644--- a/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java+++ b/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java@@ -25,7 +25,7 @@ import org.apache.solr.common.util.NamedList;* @version $Id$* @since solr 1.3*/-public abstract class SolrResponseBase implements SolrResponse+public abstract class SolrResponseBase extends SolrResponse{private long elapsedTime = -1;private NamedList<Object> response = null;