Class CharonKbDeterminationFacadeImpl

java.lang.Object
de.hybris.platform.sap.productconfig.runtime.cps.impl.CharonKbDeterminationFacadeImpl
All Implemented Interfaces:
CharonKbDeterminationFacade

public class CharonKbDeterminationFacadeImpl extends Object implements CharonKbDeterminationFacade
Default implementation of CharonKbDeterminationFacade
  • Constructor Details

    • CharonKbDeterminationFacadeImpl

      public CharonKbDeterminationFacadeImpl()
  • Method Details

    • readKbIdForDate

      public Integer readKbIdForDate(String productcode, Date kbDate)
      Description copied from interface: CharonKbDeterminationFacade
      Reads KB ID for a given product and date. It's not required that the KB for the product/date combination is unique, if multiple knowledge bases exist, the ID for the first found KB is returned
      Specified by:
      readKbIdForDate in interface CharonKbDeterminationFacade
      Parameters:
      productcode - product code
      kbDate - Validity date of KB
      Returns:
      KB ID for first matching KB
    • hasKbForDate

      public boolean hasKbForDate(String productcode, Date kbDate)
      Description copied from interface: CharonKbDeterminationFacade
      Check for knowledge bases on a given date
      Specified by:
      hasKbForDate in interface CharonKbDeterminationFacade
      Parameters:
      productcode - Product code
      kbDate - Validity date
      Returns:
      Does at least one knowledge base exist?
    • hasKBForKey

      public boolean hasKBForKey(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey)
      Description copied from interface: CharonKbDeterminationFacade
      checks the given key for existence
      Specified by:
      hasKBForKey in interface CharonKbDeterminationFacade
      Parameters:
      kbKey - key to check
      Returns:
      true, only if the given KBKey is known by the configuration engine
    • hasValidKBForKey

      public boolean hasValidKBForKey(de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey)
      Description copied from interface: CharonKbDeterminationFacade
      checks the given key existence and validity
      Specified by:
      hasValidKBForKey in interface CharonKbDeterminationFacade
      Parameters:
      kbKey - key to check
      Returns:
      true, only if the given KBKey is known by the configuration engine and valid as of today
    • parseKBKeyFromExtConfig

      public de.hybris.platform.sap.productconfig.runtime.interf.KBKey parseKBKeyFromExtConfig(String productCode, String externalcfg)
      Description copied from interface: CharonKbDeterminationFacade
      parses a KBKey from the external configuration
      Specified by:
      parseKBKeyFromExtConfig in interface CharonKbDeterminationFacade
      Parameters:
      productCode - productCode
      externalcfg - extConfig
      Returns:
      KBKey with all fields filled
    • getAllKBsOfProduct

      protected List<CPSMasterDataKBHeaderInfo> getAllKBsOfProduct(String productcode)
    • filterKBsByDate

      protected final List<CPSMasterDataKBHeaderInfo> filterKBsByDate(Date kbDate, List<CPSMasterDataKBHeaderInfo> knowledgebases)
    • isKBValidOnDate

      protected boolean isKBValidOnDate(Date kbDate, CPSMasterDataKBHeaderInfo kb)
    • isKBkeyInList

      protected boolean isKBkeyInList(List<CPSMasterDataKBHeaderInfo> knowledgebases, de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey)
    • isKBHeaderMatchingKBKey

      protected boolean isKBHeaderMatchingKBKey(CPSMasterDataKBHeaderInfo kb, de.hybris.platform.sap.productconfig.runtime.interf.KBKey kbKey)
    • getCommerceExternalConfigurationStrategy

      protected CommerceExternalConfigurationStrategy getCommerceExternalConfigurationStrategy()
      Returns:
      the commerceExternalConfigurationStrategy
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Returns:
      the objectMapper
    • getRequestErrorHandler

      protected RequestErrorHandler getRequestErrorHandler()
    • setRequestErrorHandler

      public void setRequestErrorHandler(RequestErrorHandler requestErrorHandler)
      Set the error handler for REST service calls
      Parameters:
      requestErrorHandler - For wrapping the http errors we receive from the REST service call
    • getKnowledgeBasesCacheAccessService

      protected KnowledgeBaseHeadersCacheAccessService getKnowledgeBasesCacheAccessService()
    • setKnowledgeBasesCacheAccessService

      public void setKnowledgeBasesCacheAccessService(KnowledgeBaseHeadersCacheAccessService knowledgeBasesCacheAccessService)
      Set the service to access the kb cache
      Parameters:
      knowledgeBasesCacheAccessService - the knowledgeBasesCacheAccessService to set
    • setCommerceExternalConfigurationStrategy

      public void setCommerceExternalConfigurationStrategy(CommerceExternalConfigurationStrategy commerceExternalConfigurationStrategy)
      Set the configuration strategy for external configurations
      Parameters:
      commerceExternalConfigurationStrategy - The commerceExternalConfigurationStrategy to set