Class WebAppExcUtils
java.lang.Object
it.pagopa.swclient.mil.azureservices.util.WebAppExcUtils
Verifies is a failure is due to specific HTTP status code returned by the invoked service.
- Author:
- Antonio Tarricone
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisTooManyRequests(jakarta.ws.rs.WebApplicationException webException) Verifies if aWebApplicationExceptionis due to 429 returned from invoked resource.static booleanisTooManyRequests(Throwable failure) Verifies if a failure is due to 429 returned from invoked resource.static booleanisUnauthorizedOrForbidden(jakarta.ws.rs.WebApplicationException webException) Verifies if aWebApplicationExceptionis due to 401 or 403 returned from invoked resource.static booleanisUnauthorizedOrForbidden(Throwable failure) Verifies if a failure is due to 401 or 403 returned from invoked resource.
-
Constructor Details
-
WebAppExcUtils
private WebAppExcUtils()This class has static methods only.
-
-
Method Details
-
isUnauthorizedOrForbidden
Verifies if a failure is due to 401 or 403 returned from invoked resource.
- Parameters:
failure- Failure to verify.- Returns:
trueis the failure is due to 401 or 403 returned from invoked resource,falseotherwise.
-
isTooManyRequests
Verifies if a failure is due to 429 returned from invoked resource.
- Parameters:
failure- Failure to verify.- Returns:
trueis the failure is due to 429 returned from invoked resource,falseotherwise.
-
isUnauthorizedOrForbidden
public static boolean isUnauthorizedOrForbidden(jakarta.ws.rs.WebApplicationException webException) Verifies if a
WebApplicationExceptionis due to 401 or 403 returned from invoked resource.- Parameters:
webException- Exception to verify.- Returns:
trueis the exception is due to 401 or 403 returned from invoked resource,falseotherwise.
-
isTooManyRequests
public static boolean isTooManyRequests(jakarta.ws.rs.WebApplicationException webException) Verifies if a
WebApplicationExceptionis due to 429 returned from invoked resource.- Parameters:
webException- Exeption to verify.- Returns:
trueis the exception is due to 429 returned from invoked resource,falseotherwise.
-