Class PrepareProdDoc

java.lang.Object
com.skava.search.process.config.PrepareProdDoc

@Component @Configuration @ConditionalOnProperty(prefix="skava.event.rabbitmq", name="enabled", havingValue="true") public class PrepareProdDoc extends Object

Class PrepareProdDoc

Since:
09-Jul-2018 The class is used to listen to the messages sent to pricerule
  • Field Details

  • Constructor Details

    • PrepareProdDoc

      @Autowired public PrepareProdDoc(org.apache.solr.client.solrj.SolrClient solrClient, CommonProcess commonProcess)
  • Method Details

    • prepareProductDoc

      protected void prepareProductDoc(Map<String,Object> applyPriceRuleRequests, Map<String,Object> applyPriceRuleResponse, String productId, Map<String,Object> skavaMessage) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Parameters:
      applyPriceRuleRequests - ,price rule request.
      applyPriceRuleResponse - ,price rule response.
      productId - , product Id.
      skavaMessage - , skavaMessage.
      Throws:
      org.apache.solr.client.solrj.SolrServerException - , solr exception during update/insert.
      IOException
    • constructProductDoc

      protected void constructProductDoc(long priceCollectionId, HashMap<String,Long> ruleIdAndCollectionIdMap, String productId, List<Object> requestJSON, List<Object> responseJSON, List<org.apache.solr.common.SolrInputDocument> solrDocumentsList, Map<String,Object> skavaMessage) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Parameters:
      priceCollectionId - ,price collection Id.
      productId - , product Id.
      requestJSON - , holds request JSON.
      responseJSON - holds response JSON .
      solrDocumentsList - , holds list of solr Document .
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • prepareSplPrdDoc

      protected void prepareSplPrdDoc(Map<String,Object> skavaMessage, Map<String,Object> resForProduct, com.mongodb.BasicDBObject solrObjForProduct, String indexForProduct)
      Parameters:
      skavaMessage -
      resForProduct -
      solrObjForProduct -
      indexForProduct -
    • setIndexKeys

      protected void setIndexKeys(com.mongodb.BasicDBObject solrObjForProduct, String indexForProduct, Map<String,Object> priceJSON)
      Parameters:
      solrObjForProduct -
      indexForProduct -
      priceJSON -
    • removePrices

      protected Map<String,Object> removePrices(Map<String,Object> priceJSON)
      Parameters:
      priceJSON -
      Returns:
    • getSolrCollectionName

      protected Config getSolrCollectionName(long searchCollectionId)
      Parameters:
      searchCollectionId - holds search collection Id.
      Returns:
      solr collection name .
    • setProcessPriceJson

      protected Map<String,Object> setProcessPriceJson(Map<String,Object> res, Map<String,Object> processPriceJSON)
      Parameters:
      res -
      processPriceJSON -
      Returns:
    • prepareSkuDoc

      protected void prepareSkuDoc(Map<String,Object> applyPriceRuleRequests, Map<String,Object> applyPriceRuleResponse, long priceCollectionId, long priceRuleId, long searchCollectionId, String skuId, String priceRuleVersionId) throws org.apache.solr.client.solrj.SolrServerException, IOException
      Parameters:
      applyPriceRuleRequests - , price rule request.
      applyPriceRuleResponse - , price rule response.
      priceCollectionId - , price collection Id.
      priceRuleId - , price rule Id.
      searchCollectionId - , search collection Id.
      skuId - , holds skuId.
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
    • isValidProductType

      public boolean isValidProductType(String productType)
      Method to check is valid product type
      Returns: