org.apache.solr.response
Class GenericBinaryResponseWriter
java.lang.Object
org.apache.solr.response.BaseResponseWriter
org.apache.solr.response.GenericBinaryResponseWriter
- All Implemented Interfaces:
- BinaryQueryResponseWriter, QueryResponseWriter, NamedListInitializedPlugin
public abstract class GenericBinaryResponseWriter
- extends BaseResponseWriter
- implements BinaryQueryResponseWriter
A generic QueryResponseWriter
implementation that requires a user to
implement the
getSingleResponseWriter(OutputStream, SolrQueryRequest, SolrQueryResponse)
that defines a BaseResponseWriter.SingleResponseWriter
to handle the binary output.
- Since:
- 1.5
- Version:
- $Id: GenericBinaryResponseWriter.java 1004075 2010-10-04 00:36:21Z rmuir $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericBinaryResponseWriter
public GenericBinaryResponseWriter()
write
public void write(OutputStream out,
SolrQueryRequest request,
SolrQueryResponse response)
throws IOException
- Writes the binary output data using the
BaseResponseWriter.SingleResponseWriter
provided by a call to
getSingleResponseWriter(OutputStream, SolrQueryRequest, SolrQueryResponse)
.
- Specified by:
write
in interface BinaryQueryResponseWriter
- Parameters:
out
- The OutputStream
to write the binary data to.request
- The provided SolrQueryRequest
.response
- The provided SolrQueryResponse
.
- Throws:
IOException
getSingleResponseWriter
public abstract BaseResponseWriter.SingleResponseWriter getSingleResponseWriter(OutputStream out,
SolrQueryRequest request,
SolrQueryResponse response)
- Users of this class should implement this method to define a
BaseResponseWriter.SingleResponseWriter
responsible for writing the binary output
given a SolrDocumentList
or doc-by-doc, given a
SolrInputDocument
.
- Parameters:
out
- The OutputStream
to write the binary data response to.request
- The provided SolrQueryRequest
.response
- The provided SolrQueryResponse
.
- Returns:
- A
BaseResponseWriter.SingleResponseWriter
that will be used to generate the
response output from this QueryResponseWriter
.
write
public void write(Writer writer,
SolrQueryRequest request,
SolrQueryResponse response)
throws IOException
- Just to throw Exception So that the eimplementing classes do not have to do the same
- Specified by:
write
in interface QueryResponseWriter
- Throws:
IOException