Class AbstractJSONAPIResult

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<java.lang.String> cores  
      protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Object>> coresInfo  
      protected java.lang.Long queryTime  
      protected java.lang.Long status  
    • 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 SOLR
      java.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 Action
      protected 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 Response
      java.lang.Long getQueryTime()
      Time to perform the requested action or command in SOLR
      java.lang.Long getStatus()
      HTTP Response code But for 200, that is being returned as 0
      protected abstract void processCoresInfoJson​(org.json.JSONObject json)
      Parses the JSON to set this Java Object values related to Core Information
      protected void processJson​(org.json.JSONObject json)
      Parses the JSON to set this Java Object values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • status

        protected java.lang.Long status
      • queryTime

        protected java.lang.Long queryTime
      • cores

        protected java.util.List<java.lang.String> cores
      • coresInfo

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Object>> coresInfo
    • Constructor Detail

      • AbstractJSONAPIResult

        public AbstractJSONAPIResult()
    • Method Detail

      • getQueryTime

        public java.lang.Long getQueryTime()
        Description copied from interface: JSONAPIResult
        Time to perform the requested action or command in SOLR
        Specified by:
        getQueryTime in interface JSONAPIResult
        Returns:
        Number of milliseconds
      • getStatus

        public java.lang.Long getStatus()
        Description copied from interface: JSONAPIResult
        HTTP Response code But for 200, that is being returned as 0
        Specified by:
        getStatus in interface JSONAPIResult
        Returns:
        Number representing an HTTP Status
      • getCores

        public java.util.List<java.lang.String> getCores()
        Description copied from interface: JSONAPIResult
        Name of the cores managed by SOLR
        Specified by:
        getCores in interface JSONAPIResult
        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: JSONAPIResult
        Information 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:
        getCoresInfo in interface JSONAPIResult
        Returns:
        Core information by core name
      • processJson

        protected void processJson​(org.json.JSONObject json)
                            throws org.json.JSONException
        Parses 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.JSONException
        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 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.JSONException
        Parses the JSON to set this Java Object values related to Core Information
        Parameters:
        json - JSONObject returned by SOLR API
        Throws:
        org.json.JSONException