Class RequestErrorHandlerImpl

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

public class RequestErrorHandlerImpl extends Object implements RequestErrorHandler
Default implementation of RequestErrorHandler. Just forwards the exceptions into runtime exceptions, a specific exception text is raised for HTTP NOT FOUND
  • Field Details

  • Constructor Details

    • RequestErrorHandlerImpl

      public RequestErrorHandlerImpl()
  • Method Details

    • processUpdateConfigurationError

      public void processUpdateConfigurationError(com.hybris.charon.exp.HttpException ex, String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Description copied from interface: RequestErrorHandler
      processes exception from configuration update request
      Specified by:
      processUpdateConfigurationError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      configId - configuration runtime id of the configuration that was attempted to be updated
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • processCreateDefaultConfigurationError

      public CPSConfiguration processCreateDefaultConfigurationError(com.hybris.charon.exp.HttpException ex)
      Description copied from interface: RequestErrorHandler
      processes exception from configuration create default configuration request
      Specified by:
      processCreateDefaultConfigurationError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      Returns:
      default configuration
    • processGetConfigurationError

      public CPSConfiguration processGetConfigurationError(com.hybris.charon.exp.HttpException ex, String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Description copied from interface: RequestErrorHandler
      processes exception from configuration create default configuration request
      Specified by:
      processGetConfigurationError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      configId - configuration runtime id of the configuration that was attempted to be retrieved
      Returns:
      configuration update result
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • processDeleteConfigurationError

      public void processDeleteConfigurationError(com.hybris.charon.exp.HttpException ex)
      Description copied from interface: RequestErrorHandler
      processes exception from delete configuration request
      Specified by:
      processDeleteConfigurationError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
    • processGetExternalConfigurationError

      public CPSExternalConfiguration processGetExternalConfigurationError(com.hybris.charon.exp.HttpException ex, String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Description copied from interface: RequestErrorHandler
      processes exception from get external configuration request
      Specified by:
      processGetExternalConfigurationError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      configId - configuration runtime id of the external configuration that was attempted to be retrieved
      Returns:
      external representation of configuration
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException - Exception on calling the configuration service (e.g. when the session has expired)
    • processCreateRuntimeConfigurationFromExternalError

      public CPSConfiguration processCreateRuntimeConfigurationFromExternalError(com.hybris.charon.exp.HttpException ex)
      Description copied from interface: RequestErrorHandler
      processes exception from create configuration from external request
      Specified by:
      processCreateRuntimeConfigurationFromExternalError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      Returns:
      runtime configuration
    • processCreatePricingDocumentError

      public PricingDocumentResult processCreatePricingDocumentError(com.hybris.charon.exp.HttpException ex) throws de.hybris.platform.sap.productconfig.runtime.interf.PricingEngineException
      Description copied from interface: RequestErrorHandler
      processes exception from create pricing document request
      Specified by:
      processCreatePricingDocumentError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      Returns:
      pricing document result
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.PricingEngineException - which indicates the error towards higher layers
    • processHasKbError

      public boolean processHasKbError(com.hybris.charon.exp.HttpException ex)
      Description copied from interface: RequestErrorHandler
      processes exception from get knowledgebase request
      Specified by:
      processHasKbError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      Returns:
      whether kb exists
    • checkNotFound

      protected void checkNotFound(com.hybris.charon.exp.HttpException ex) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • ifNotFoundThrowIllegalState

      protected void ifNotFoundThrowIllegalState(com.hybris.charon.exp.HttpException ex)
    • checkClientException412

      protected void checkClientException412(com.hybris.charon.exp.HttpException ex) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • checkClientException428

      protected void checkClientException428(com.hybris.charon.exp.HttpException ex)
    • logRequestError

      protected void logRequestError(String serviceName, com.hybris.charon.exp.HttpException ex)
    • getServerMessage

      protected String getServerMessage(com.hybris.charon.exp.HttpException ex)
    • processCreatePricingDocumentRuntimeException

      public PricingDocumentResult processCreatePricingDocumentRuntimeException(RuntimeException ex) throws de.hybris.platform.sap.productconfig.runtime.interf.PricingEngineException
      Description copied from interface: RequestErrorHandler
      Processes runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted into PricingEngineException while other runtime exceptions are re-thrown.
      Specified by:
      processCreatePricingDocumentRuntimeException in interface RequestErrorHandler
      Parameters:
      ex - Runtime exception that wraps the actual root cause
      Returns:
      Dummy result of the pricing call
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.PricingEngineException
    • processConfigurationRuntimeException

      public void processConfigurationRuntimeException(RuntimeException e, String configId) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Description copied from interface: RequestErrorHandler
      Processes runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted into ConfigurationEngineException while other runtime exceptions are re-thrown.
      Specified by:
      processConfigurationRuntimeException in interface RequestErrorHandler
      Parameters:
      e - Runtime exception that wraps the actual root cause
      configId - configuration runtime id of the configuration that was requested
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • processGetItemWithGroupDetailsError

      public CPSItem processGetItemWithGroupDetailsError(com.hybris.charon.exp.HttpException ex, String configId, String itemId, List<String> groupList) throws de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
      Description copied from interface: RequestErrorHandler
      processes exception from get item with group details request
      Specified by:
      processGetItemWithGroupDetailsError in interface RequestErrorHandler
      Parameters:
      ex - exception to process
      configId - configuration runtime id of the configuration that was attempted to be retrieved
      itemId - item runtime id of the configuration that was attempted to be retrieved
      groupList - list of group names of the configuration that was attempted to be retrieved
      Returns:
      configuration update result
      Throws:
      de.hybris.platform.sap.productconfig.runtime.interf.ConfigurationEngineException
    • cleanUpCache

      protected void cleanUpCache(String configId)
    • getCache

      protected CPSCache getCache()
    • setCache

      public void setCache(CPSCache cache)