org.apache.solr.handler
abstract public class: RequestHandlerBase [javadoc |
source]
java.lang.Object
org.apache.solr.handler.RequestHandlerBase
All Implemented Interfaces:
SolrInfoMBean, SolrRequestHandler
Direct Known Subclasses:
MoreLikeThisHandler, StandardRequestHandler, CSVRequestHandler, CoreAdminHandler, SystemInfoHandler, LukeRequestHandler, ShowFileRequestHandler, ThreadDumpHandler, SearchHandler, StandardRequestHandler, DataImportHandler, XmlUpdateRequestHandler, DisMaxRequestHandler, SpellCheckerRequestHandler, PluginInfoHandler, DisMaxRequestHandler, PingRequestHandler, AnalysisRequestHandler, PropertiesRequestHandler, DumpRequestHandler
| Field Summary |
|---|
| long | numRequests | |
| long | numErrors | |
| protected SolrParams | defaults | |
| protected SolrParams | appends | |
| protected SolrParams | invariants | |
| Method from org.apache.solr.handler.RequestHandlerBase Summary: |
|---|
|
getCategory, getDescription, getDocs, getName, getSource, getSourceId, getStatistics, getVersion, handleRequest, handleRequestBody, init |
| Method from org.apache.solr.handler.RequestHandlerBase Detail: |
public Category getCategory() {
return Category.QUERYHANDLER;
}
|
abstract public String getDescription()
|
public URL[] getDocs() {
return null; // this can be overridden, but not required
}
|
public String getName() {
return this.getClass().getName();
}
|
abstract public String getSource()
|
abstract public String getSourceId()
|
public NamedList getStatistics() {
NamedList lst = new SimpleOrderedMap();
lst.add("requests", numRequests);
lst.add("errors", numErrors);
return lst;
}
|
abstract public String getVersion()
|
public void handleRequest(SolrQueryRequest req,
SolrQueryResponse rsp) {
numRequests++;
try {
U.setDefaults(req,defaults,appends,invariants);
handleRequestBody( req, rsp );
} catch (Exception e) {
SolrException.log(SolrCore.log,e);
rsp.setException(e);
numErrors++;
}
}
|
abstract public void handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp) throws Exception
|
public void init(NamedList args) {
// Copied from StandardRequestHandler
if( args != null ) {
Object o = args.get("defaults");
if (o != null && o instanceof NamedList) {
defaults = SolrParams.toSolrParams((NamedList)o);
}
o = args.get("appends");
if (o != null && o instanceof NamedList) {
appends = SolrParams.toSolrParams((NamedList)o);
}
o = args.get("invariants");
if (o != null && o instanceof NamedList) {
invariants = SolrParams.toSolrParams((NamedList)o);
}
}
}
|