Package com.skava.search.process.config
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPrepareProdDoc
(org.apache.solr.client.solrj.SolrClient solrClient, CommonProcess commonProcess) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) protected Config
getSolrCollectionName
(long searchCollectionId) boolean
isValidProductType
(String productType) Method to check is valid product typeprotected void
prepareProductDoc
(Map<String, Object> applyPriceRuleRequests, Map<String, Object> applyPriceRuleResponse, String productId, Map<String, Object> skavaMessage) protected void
prepareSkuDoc
(Map<String, Object> applyPriceRuleRequests, Map<String, Object> applyPriceRuleResponse, long priceCollectionId, long priceRuleId, long searchCollectionId, String skuId, String priceRuleVersionId) protected void
prepareSplPrdDoc
(Map<String, Object> skavaMessage, Map<String, Object> resForProduct, com.mongodb.BasicDBObject solrObjForProduct, String indexForProduct) removePrices
(Map<String, Object> priceJSON) protected void
setIndexKeys
(com.mongodb.BasicDBObject solrObjForProduct, String indexForProduct, Map<String, Object> priceJSON)
-
Field Details
-
PARAM_COLLECTION
PARAM_COLLECTION- See Also:
-
PARAM_BUNDLE
PARAM_BUNDLE- See Also:
-
PARAM_FIXEDPRICEBUNDLE
PARAM_FIXEDPRICEBUNDLE- See Also:
-
BUNDLE_PRICE
- See Also:
-
FLOOR_PRICE
- See Also:
-
-
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, throws org.apache.solr.client.solrj.SolrServerException, IOExceptionObject> applyPriceRuleResponse, String productId, Map<String, Object> skavaMessage) - 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, throws org.apache.solr.client.solrj.SolrServerException, IOExceptionObject> skavaMessage) - 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
- Parameters:
priceJSON
-- Returns:
-
getSolrCollectionName
- 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, throws org.apache.solr.client.solrj.SolrServerException, IOExceptionObject> applyPriceRuleResponse, long priceCollectionId, long priceRuleId, long searchCollectionId, String skuId, String priceRuleVersionId) - 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
Method to check is valid product type- Returns:
-