Class RequestErrorHandlerImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.runtime.cps.impl.RequestErrorHandlerImpl
-
- All Implemented Interfaces:
RequestErrorHandler
public class RequestErrorHandlerImpl extends java.lang.Object implements RequestErrorHandler
Default implementation ofRequestErrorHandler. Just forwards the exceptions into runtime exceptions, a specific exception text is raised for HTTP NOT FOUND
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringNO_SERVER_MESSAGE
-
Constructor Summary
Constructors Constructor Description RequestErrorHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckClientException412(com.hybris.charon.exp.HttpException ex)protected voidcheckClientException428(com.hybris.charon.exp.HttpException ex)protected voidcheckNotFound(com.hybris.charon.exp.HttpException ex)protected voidcleanUpCache(java.lang.String configId)protected CPSCachegetCache()protected java.lang.StringgetServerMessage(com.hybris.charon.exp.HttpException ex)protected voidifNotFoundThrowIllegalState(com.hybris.charon.exp.HttpException ex)protected voidlogRequestError(java.lang.String serviceName, com.hybris.charon.exp.HttpException ex)voidprocessConfigurationRuntimeException(java.lang.RuntimeException e, java.lang.String configId)Processes runtime exceptions like timeout or non-existing server.CPSConfigurationprocessCreateDefaultConfigurationError(com.hybris.charon.exp.HttpException ex)processes exception from configuration create default configuration requestPricingDocumentResultprocessCreatePricingDocumentError(com.hybris.charon.exp.HttpException ex)processes exception from create pricing document requestPricingDocumentResultprocessCreatePricingDocumentRuntimeException(java.lang.RuntimeException ex)Processes runtime exceptions like timeout or non-existing server.CPSConfigurationprocessCreateRuntimeConfigurationFromExternalError(com.hybris.charon.exp.HttpException ex)processes exception from create configuration from external requestvoidprocessDeleteConfigurationError(com.hybris.charon.exp.HttpException ex)processes exception from delete configuration requestCPSConfigurationprocessGetConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId)processes exception from configuration create default configuration requestCPSExternalConfigurationprocessGetExternalConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId)processes exception from get external configuration requestbooleanprocessHasKbError(com.hybris.charon.exp.HttpException ex)processes exception from get knowledgebase requestvoidprocessUpdateConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId)processes exception from configuration update requestvoidsetCache(CPSCache cache)
-
-
-
Field Detail
-
NO_SERVER_MESSAGE
protected static final java.lang.String NO_SERVER_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
processUpdateConfigurationError
public void processUpdateConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId) throws ConfigurationEngineExceptionDescription copied from interface:RequestErrorHandlerprocesses exception from configuration update request- Specified by:
processUpdateConfigurationErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to processconfigId- configuration runtime id of the configuration that was attempted to be updated- Throws:
ConfigurationEngineException
-
processCreateDefaultConfigurationError
public CPSConfiguration processCreateDefaultConfigurationError(com.hybris.charon.exp.HttpException ex)
Description copied from interface:RequestErrorHandlerprocesses exception from configuration create default configuration request- Specified by:
processCreateDefaultConfigurationErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to process- Returns:
- default configuration
-
processGetConfigurationError
public CPSConfiguration processGetConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId) throws ConfigurationEngineException
Description copied from interface:RequestErrorHandlerprocesses exception from configuration create default configuration request- Specified by:
processGetConfigurationErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to processconfigId- configuration runtime id of the configuration that was attempted to be retrieved- Returns:
- configuration update result
- Throws:
ConfigurationEngineException
-
processDeleteConfigurationError
public void processDeleteConfigurationError(com.hybris.charon.exp.HttpException ex)
Description copied from interface:RequestErrorHandlerprocesses exception from delete configuration request- Specified by:
processDeleteConfigurationErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to process
-
processGetExternalConfigurationError
public CPSExternalConfiguration processGetExternalConfigurationError(com.hybris.charon.exp.HttpException ex, java.lang.String configId) throws ConfigurationEngineException
Description copied from interface:RequestErrorHandlerprocesses exception from get external configuration request- Specified by:
processGetExternalConfigurationErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to processconfigId- configuration runtime id of the external configuration that was attempted to be retrieved- Returns:
- external representation of configuration
- Throws:
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:RequestErrorHandlerprocesses exception from create configuration from external request- Specified by:
processCreateRuntimeConfigurationFromExternalErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to process- Returns:
- runtime configuration
-
processCreatePricingDocumentError
public PricingDocumentResult processCreatePricingDocumentError(com.hybris.charon.exp.HttpException ex) throws PricingEngineException
Description copied from interface:RequestErrorHandlerprocesses exception from create pricing document request- Specified by:
processCreatePricingDocumentErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to process- Returns:
- pricing document result
- Throws:
PricingEngineException- which indicates the error towards higher layers
-
processHasKbError
public boolean processHasKbError(com.hybris.charon.exp.HttpException ex)
Description copied from interface:RequestErrorHandlerprocesses exception from get knowledgebase request- Specified by:
processHasKbErrorin interfaceRequestErrorHandler- Parameters:
ex- exception to process- Returns:
- whether kb exists
-
checkNotFound
protected void checkNotFound(com.hybris.charon.exp.HttpException ex) throws ConfigurationEngineException- Throws:
ConfigurationEngineException
-
ifNotFoundThrowIllegalState
protected void ifNotFoundThrowIllegalState(com.hybris.charon.exp.HttpException ex)
-
checkClientException412
protected void checkClientException412(com.hybris.charon.exp.HttpException ex) throws ConfigurationEngineException- Throws:
ConfigurationEngineException
-
checkClientException428
protected void checkClientException428(com.hybris.charon.exp.HttpException ex)
-
logRequestError
protected void logRequestError(java.lang.String serviceName, com.hybris.charon.exp.HttpException ex)
-
getServerMessage
protected java.lang.String getServerMessage(com.hybris.charon.exp.HttpException ex)
-
processCreatePricingDocumentRuntimeException
public PricingDocumentResult processCreatePricingDocumentRuntimeException(java.lang.RuntimeException ex) throws PricingEngineException
Description copied from interface:RequestErrorHandlerProcesses runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted intoPricingEngineExceptionwhile other runtime exceptions are re-thrown.- Specified by:
processCreatePricingDocumentRuntimeExceptionin interfaceRequestErrorHandler- Parameters:
ex- Runtime exception that wraps the actual root cause- Returns:
- Dummy result of the pricing call
- Throws:
PricingEngineException
-
processConfigurationRuntimeException
public void processConfigurationRuntimeException(java.lang.RuntimeException e, java.lang.String configId) throws ConfigurationEngineExceptionDescription copied from interface:RequestErrorHandlerProcesses runtime exceptions like timeout or non-existing server. Default behavior: Timeout exceptions are handled gracefully in the sense that they are converted intoConfigurationEngineExceptionwhile other runtime exceptions are re-thrown.- Specified by:
processConfigurationRuntimeExceptionin interfaceRequestErrorHandler- Parameters:
e- Runtime exception that wraps the actual root causeconfigId- configuration runtime id of the configuration that was requested- Throws:
ConfigurationEngineException
-
cleanUpCache
protected void cleanUpCache(java.lang.String configId)
-
getCache
protected CPSCache getCache()
-
setCache
public void setCache(CPSCache cache)
-
-