Class IridaOAuthErrorHandler

  • All Implemented Interfaces:
    org.springframework.web.client.ResponseErrorHandler

    public class IridaOAuthErrorHandler
    extends org.springframework.web.client.DefaultResponseErrorHandler
    Error handler for use in OAuthTokenRestTemplate. Catches HTTP UNAUTHORIZED (401) errors to translate to IridaOAuthExceptions
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleError​(org.springframework.http.client.ClientHttpResponse response)
      Overriding this method to throw a IridaOAuthException in case of an HTTP UNAUTHORIZED response.
      void setRemoteAPI​(RemoteAPI remoteAPI)
      Set the RemoteAPI to return to the caller if an error occurs
      • Methods inherited from class org.springframework.web.client.DefaultResponseErrorHandler

        getCharset, getHttpStatusCode, getResponseBody, handleError, hasError, hasError, hasError
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.web.client.ResponseErrorHandler

        handleError
    • Constructor Detail

      • IridaOAuthErrorHandler

        public IridaOAuthErrorHandler()
    • Method Detail

      • handleError

        public void handleError​(org.springframework.http.client.ClientHttpResponse response)
                         throws java.io.IOException
        Overriding this method to throw a IridaOAuthException in case of an HTTP UNAUTHORIZED response.
        Specified by:
        handleError in interface org.springframework.web.client.ResponseErrorHandler
        Overrides:
        handleError in class org.springframework.web.client.DefaultResponseErrorHandler
        Throws:
        java.io.IOException
      • setRemoteAPI

        public void setRemoteAPI​(RemoteAPI remoteAPI)
        Set the RemoteAPI to return to the caller if an error occurs
        Parameters:
        remoteAPI - the RemoteAPI to include in the exception.