From 5067897ff5f9d6405215e9cb71771072f9a58a7b Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 24 Aug 2017 23:46:58 -0700 Subject: [PATCH] Upgrade to jax-rs 2.1.1 Also address constant TODO. --- project/pom.xml | 2 +- .../GoogleCloudStorageClientErrorRetryHandler.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/project/pom.xml b/project/pom.xml index 8b67af1e8c..e46a568557 100644 --- a/project/pom.xml +++ b/project/pom.xml @@ -231,7 +231,7 @@ 1.4.1 9.4.46.v20220331 - 2.0.1 + 2.1.1 1.8.0 diff --git a/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/handlers/GoogleCloudStorageClientErrorRetryHandler.java b/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/handlers/GoogleCloudStorageClientErrorRetryHandler.java index f47ff4cde2..013071455d 100644 --- a/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/handlers/GoogleCloudStorageClientErrorRetryHandler.java +++ b/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/handlers/GoogleCloudStorageClientErrorRetryHandler.java @@ -17,6 +17,7 @@ package org.jclouds.googlecloudstorage.handlers; import javax.inject.Singleton; +import javax.ws.rs.core.Response.Status; import org.jclouds.http.HttpCommand; import org.jclouds.http.HttpResponse; @@ -27,10 +28,6 @@ import com.google.inject.Inject; @Singleton public final class GoogleCloudStorageClientErrorRetryHandler implements HttpRetryHandler { - /** The user has sent too many requests in a given amount of time ("rate limiting"). */ - // TODO: remove when upgrading to jax-rs api 2.1 - private static final int TOO_MANY_REQUESTS = 429; - private final BackoffLimitedRetryHandler backoffHandler; @Inject @@ -40,7 +37,7 @@ public final class GoogleCloudStorageClientErrorRetryHandler implements HttpRetr @Override public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { - if (response.getStatusCode() == TOO_MANY_REQUESTS) { + if (response.getStatusCode() == Status.TOO_MANY_REQUESTS.getStatusCode()) { return backoffHandler.shouldRetryRequest(command, response); } else { return false;