Class WebAppExcUtils

java.lang.Object
it.pagopa.swclient.mil.azureservices.util.WebAppExcUtils

public class WebAppExcUtils extends Object

Verifies is a failure is due to specific HTTP status code returned by the invoked service.

Author:
Antonio Tarricone
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    This class has static methods only.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isTooManyRequests(jakarta.ws.rs.WebApplicationException webException)
    Verifies if a WebApplicationException is due to 429 returned from invoked resource.
    static boolean
    Verifies if a failure is due to 429 returned from invoked resource.
    static boolean
    isUnauthorizedOrForbidden(jakarta.ws.rs.WebApplicationException webException)
    Verifies if a WebApplicationException is due to 401 or 403 returned from invoked resource.
    static boolean
    Verifies if a failure is due to 401 or 403 returned from invoked resource.

    Methods inherited from class java.lang.Object

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

    • WebAppExcUtils

      private WebAppExcUtils()

      This class has static methods only.

  • Method Details

    • isUnauthorizedOrForbidden

      public static boolean isUnauthorizedOrForbidden(Throwable failure)

      Verifies if a failure is due to 401 or 403 returned from invoked resource.

      Parameters:
      failure - Failure to verify.
      Returns:
      true is the failure is due to 401 or 403 returned from invoked resource, false otherwise.
    • isTooManyRequests

      public static boolean isTooManyRequests(Throwable failure)

      Verifies if a failure is due to 429 returned from invoked resource.

      Parameters:
      failure - Failure to verify.
      Returns:
      true is the failure is due to 429 returned from invoked resource, false otherwise.
    • isUnauthorizedOrForbidden

      public static boolean isUnauthorizedOrForbidden(jakarta.ws.rs.WebApplicationException webException)

      Verifies if a WebApplicationException is due to 401 or 403 returned from invoked resource.

      Parameters:
      webException - Exception to verify.
      Returns:
      true is the exception is due to 401 or 403 returned from invoked resource, false otherwise.
    • isTooManyRequests

      public static boolean isTooManyRequests(jakarta.ws.rs.WebApplicationException webException)

      Verifies if a WebApplicationException is due to 429 returned from invoked resource.

      Parameters:
      webException - Exeption to verify.
      Returns:
      true is the exception is due to 429 returned from invoked resource, false otherwise.