Class AbstractJSONAPIResult
- java.lang.Object
-
- org.alfresco.repo.search.impl.lucene.AbstractJSONAPIResult
-
- All Implemented Interfaces:
JSONAPIResult
- Direct Known Subclasses:
SolrActionAclReportResult,SolrActionAclTxReportResult,SolrActionCheckResult,SolrActionFixResult,SolrActionNodeReportResult,SolrActionReportResult,SolrActionStatusResult,SolrActionTxReportResult,SolrCommandBackupResult
public abstract class AbstractJSONAPIResult extends java.lang.Object implements JSONAPIResult
JSON returned from SOLR API Parser This class defines common properties and performs response header parsing. An abstract method is provided for implementers to parse Core Information.- Since:
- 6.2
- Author:
- aborroy
-
-
Constructor Summary
Constructors Constructor Description AbstractJSONAPIResult()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getCores()Name of the cores managed by SOLRjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>getCoresInfo()Information from the cores to be exposed in JMX Beans The names and the structure of the properties depend on the type of the Actionprotected java.util.Map<java.lang.String,java.lang.Object>getPropertyValueMap(org.json.JSONObject json)Creates a property-value Map from a JSON Object containing properties and values This method provides the right input for MBeans to expose the SOLR response values from the Responsejava.lang.LonggetQueryTime()Time to perform the requested action or command in SOLRjava.lang.LonggetStatus()HTTP Response code But for 200, that is being returned as 0protected abstract voidprocessCoresInfoJson(org.json.JSONObject json)Parses the JSON to set this Java Object values related to Core Informationprotected voidprocessJson(org.json.JSONObject json)Parses the JSON to set this Java Object values
-
-
-
Method Detail
-
getQueryTime
public java.lang.Long getQueryTime()
Description copied from interface:JSONAPIResultTime to perform the requested action or command in SOLR- Specified by:
getQueryTimein interfaceJSONAPIResult- Returns:
- Number of milliseconds
-
getStatus
public java.lang.Long getStatus()
Description copied from interface:JSONAPIResultHTTP Response code But for 200, that is being returned as 0- Specified by:
getStatusin interfaceJSONAPIResult- Returns:
- Number representing an HTTP Status
-
getCores
public java.util.List<java.lang.String> getCores()
Description copied from interface:JSONAPIResultName of the cores managed by SOLR- Specified by:
getCoresin interfaceJSONAPIResult- Returns:
- A list with the names of the cores
-
getCoresInfo
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getCoresInfo()
Description copied from interface:JSONAPIResultInformation from the cores to be exposed in JMX Beans The names and the structure of the properties depend on the type of the Action- Specified by:
getCoresInfoin interfaceJSONAPIResult- Returns:
- Core information by core name
-
processJson
protected void processJson(org.json.JSONObject json) throws org.json.JSONExceptionParses the JSON to set this Java Object values- Parameters:
json- JSONObject returned by SOLR API- Throws:
org.json.JSONException
-
getPropertyValueMap
protected java.util.Map<java.lang.String,java.lang.Object> getPropertyValueMap(org.json.JSONObject json) throws org.json.JSONExceptionCreates a property-value Map from a JSON Object containing properties and values This method provides the right input for MBeans to expose the SOLR response values from the Response- Parameters:
json- Simple JSON Object containing only properties- Returns:
- Property-value Map
- Throws:
org.json.JSONException
-
processCoresInfoJson
protected abstract void processCoresInfoJson(org.json.JSONObject json) throws org.json.JSONExceptionParses the JSON to set this Java Object values related to Core Information- Parameters:
json- JSONObject returned by SOLR API- Throws:
org.json.JSONException
-
-