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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.solr.client.solrj.request.RequestWriter.ContentWritercreateJSONStringStream(Object body) deleteResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language, String term) Deletes the item by the given term from the resource with the given resource name and language.fetchResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language) Fetches the resource for the given resource name and language using the providedSolrClient.putResource(org.apache.solr.client.solrj.SolrClient solrClient, String resourceName, String language, Object body) Adds a new item to the resource with the given resource name and language using the providedSolrClient.
-
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:SolrRestManagerAPIServiceFetches the resource for the given resource name and language using the providedSolrClient.- Specified by:
fetchResourcein interfaceSolrRestManagerAPIService- Parameters:
solrClient- the SolrClientresourceName- the name of the resource, e.g. "synonyms"language- the language or version of the resource, e.g. "en"- Returns:
- the RestManagerResponse
- Throws:
IOExceptionorg.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:SolrRestManagerAPIServiceAdds a new item to the resource with the given resource name and language using the providedSolrClient. The object provided is typically a Map or a List depending on what the resource requires.- Specified by:
putResourcein interfaceSolrRestManagerAPIService- Parameters:
solrClient- the SolrClientresourceName- 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:
IOExceptionorg.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:SolrRestManagerAPIServiceDeletes the item by the given term from the resource with the given resource name and language.- Specified by:
deleteResourcein interfaceSolrRestManagerAPIService- Parameters:
solrClient- the SolrClientresourceName- 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:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
createJSONStringStream
protected org.apache.solr.client.solrj.request.RequestWriter.ContentWriter createJSONStringStream(Object body)
-