Class SolrRestManagerAPIServiceImpl

java.lang.Object
com.broadleafcommerce.search.resource.service.SolrRestManagerAPIServiceImpl
All Implemented Interfaces:
SolrRestManagerAPIService

@Service("blSolrRestManagerAPIService") public class SolrRestManagerAPIServiceImpl extends Object implements SolrRestManagerAPIService
Author:
Nick Crum ncrum
  • Constructor Details

    • SolrRestManagerAPIServiceImpl

      public SolrRestManagerAPIServiceImpl()
  • Method Details

    • fetchResource

      public RestManagerResponse fetchResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language) throws IOException, org.apache.solr.client.solrj.SolrServerException
      Description copied from interface: SolrRestManagerAPIService
      Fetches the resource for the given resource name and language using the provided SolrClient.
      Specified by:
      fetchResource in interface SolrRestManagerAPIService
      Parameters:
      solrClient - the SolrClient
      resourceName - the name of the resource, e.g. "synonyms"
      language - the language or version of the resource, e.g. "en"
      Returns:
      the RestManagerResponse
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • putResource

      public RestManagerResponse putResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language, Object body) throws IOException, org.apache.solr.client.solrj.SolrServerException
      Description copied from interface: SolrRestManagerAPIService
      Adds a new item to the resource with the given resource name and language using the provided SolrClient. The object provided is typically a Map or a List depending on what the resource requires.
      Specified by:
      putResource in interface SolrRestManagerAPIService
      Parameters:
      solrClient - the SolrClient
      resourceName - the name of the resource, e.g. "synonyms"
      language - the language or version of the resource, e.g. "en"
      body - the request body
      Returns:
      the RestManageResponse
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • deleteResource

      public RestManagerResponse deleteResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language, String term) throws IOException, org.apache.solr.client.solrj.SolrServerException
      Description copied from interface: SolrRestManagerAPIService
      Deletes the item by the given term from the resource with the given resource name and language.
      Specified by:
      deleteResource in interface SolrRestManagerAPIService
      Parameters:
      solrClient - the SolrClient
      resourceName - the name of the resource, e.g. "synonyms"
      language - the language or version of the resource, e.g. "en"
      term - the key/term of the item
      Returns:
      the RestManagerResponse
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • createJSONStringStream

      protected org.apache.solr.client.solrj.request.RequestWriter.ContentWriter createJSONStringStream(Object body)