com.ibm.ecm.sample.webhook.exception

Class WebhookReceiverExceptionMapper

  • java.lang.Object
    • com.ibm.ecm.sample.webhook.exception.WebhookReceiverExceptionMapper
  • All Implemented Interfaces:
    javax.ws.rs.ext.ExceptionMapper<java.lang.Throwable>


    @Provider
    public class WebhookReceiverExceptionMapper
    extends java.lang.Object
    implements javax.ws.rs.ext.ExceptionMapper<java.lang.Throwable>
    In the event that the Content Event Webhook External Event action callout to the receiver sample application does not have the expected HMAC credential, HMACAuthenticationFilter will throw a HMACSecurityException. This class handles mapping that exception to a UNAUTHORIZED response code.

    Note that handling for other uncaught exceptions can be added to this class, or the servlet can handle the exception and return a response. It is up to the implementor to decide which approach to take with every possible exception.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      javax.ws.rs.core.Response toResponse(java.lang.Throwable t) 
      • Methods inherited from class java.lang.Object

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

      • WebhookReceiverExceptionMapper

        public WebhookReceiverExceptionMapper()
    • Method Detail

      • toResponse

        public javax.ws.rs.core.Response toResponse(java.lang.Throwable t)
        Specified by:
        toResponse in interface javax.ws.rs.ext.ExceptionMapper<java.lang.Throwable>