dsmiley commented on code in PR #3248:
URL: https://github.com/apache/solr/pull/3248#discussion_r1987294113
##########
solr/solrj/src/java/org/apache/solr/client/solrj/ResponseParser.java:
##########
@@ -16,45 +16,31 @@
*/
package org.apache.solr.client.solrj;
+import java.io.IOException;
import java.io.InputStream;
-import java.io.Reader;
import java.util.Collection;
-import java.util.Set;
import org.apache.solr.common.util.NamedList;
/**
+ * SolrJ Solr response parser.
+ *
* @since solr 1.3
*/
public abstract class ResponseParser {
- public abstract String getWriterType(); // for example: wt=XML, JSON, etc
- public abstract NamedList<Object> processResponse(InputStream body, String
encoding);
+ /** The writer type placed onto the request as the {@code wt} param. */
+ public abstract String getWriterType(); // for example: wt=XML, JSON, etc
- public abstract NamedList<Object> processResponse(Reader reader);
-
- /**
- * A well-behaved ResponseParser will return its content-type.
- *
- * @return the content-type this parser expects to parse
- * @deprecated use {@link #getContentTypes()} instead
- */
- @Deprecated
- public String getContentType() {
- return null;
- }
+ public abstract NamedList<Object> processResponse(InputStream body, String
encoding)
+ throws IOException;
/**
* A well-behaved ResponseParser will return the content-types it supports.
*
- * @return the content-type values that this parser is capable of parsing.
+ * @return the content-type values that this parser is capable of parsing.
Never null. Empty means
+ * no enforcement.
Review Comment:
I could easily imagine a misalignment between the response from Solr and the
parser (different format). This acts as a sanity check instead of blindly
parsing what we could rule out with a friendly error message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]