Class IntegrationApiExceptionTranslationHandler

  • All Implemented Interfaces:
    com.hybris.cockpitng.service.ExceptionTranslationHandler, org.springframework.core.Ordered
    Direct Known Subclasses:
    IntegrationBackofficeExceptionTranslationHandler, WebhookExceptionTranslationHandler

    public abstract class IntegrationApiExceptionTranslationHandler
    extends java.lang.Object
    implements com.hybris.cockpitng.service.ExceptionTranslationHandler, org.springframework.core.Ordered
    An abstract class for translating target exceptions to localized error messages. Its subclass needs to overwrite methods in order to specify the target exceptions and how to acquire localized messages.
    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canHandle​(java.lang.Throwable throwable)  
      protected abstract java.lang.String convertExceptionToResourceMsg​(java.lang.Throwable exception)
      Try to get bundle resource with the information of the exception that is being handled.
      int getOrder()  
      protected abstract java.util.List<java.lang.String> getTargetedException()  
      java.lang.String toString​(java.lang.Throwable throwable)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntegrationApiExceptionTranslationHandler

        public IntegrationApiExceptionTranslationHandler()
    • Method Detail

      • canHandle

        public boolean canHandle​(java.lang.Throwable throwable)
        Specified by:
        canHandle in interface com.hybris.cockpitng.service.ExceptionTranslationHandler
      • toString

        public java.lang.String toString​(java.lang.Throwable throwable)
        Specified by:
        toString in interface com.hybris.cockpitng.service.ExceptionTranslationHandler
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • getTargetedException

        protected abstract java.util.List<java.lang.String> getTargetedException()
        Returns:
        The list of exceptions that this handler is able to handle.
      • convertExceptionToResourceMsg

        protected abstract java.lang.String convertExceptionToResourceMsg​(java.lang.Throwable exception)
        Try to get bundle resource with the information of the exception that is being handled.
        Parameters:
        exception - The exception that is being translated. Use its class name or other information as key to get bundle resource