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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isTooManyRequests
(jakarta.ws.rs.WebApplicationException webException) Verifies if aWebApplicationException
is due to 429 returned from invoked resource.static boolean
isTooManyRequests
(Throwable failure) Verifies if a failure is due to 429 returned from invoked resource.static boolean
isUnauthorizedOrForbidden
(jakarta.ws.rs.WebApplicationException webException) Verifies if aWebApplicationException
is due to 401 or 403 returned from invoked resource.static boolean
isUnauthorizedOrForbidden
(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:
true
is the failure is due to 401 or 403 returned from invoked resource,false
otherwise.
-
isTooManyRequests
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.
-