diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml
index cda06a43fb4e..c48a91f39d76 100644
--- a/google-cloud-bigquery/pom.xml
+++ b/google-cloud-bigquery/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
${project.groupId}
google-cloud-storage
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java
index e54163a6e849..ab92d6c91e99 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java
@@ -18,7 +18,7 @@
import static com.google.common.base.Preconditions.checkArgument;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.FieldSelector;
import com.google.cloud.FieldSelector.Helper;
import com.google.cloud.Service;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java
index 95c5a16bb275..e28d2b619524 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java
@@ -18,8 +18,8 @@
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Objects;
import java.util.Set;
@@ -30,7 +30,7 @@
* @see Google Cloud
* BigQuery error codes
*/
-public final class BigQueryException extends BaseServiceException {
+public final class BigQueryException extends BaseHttpServiceException {
// see: https://cloud.google.com/bigquery/troubleshooting-errors
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(
@@ -47,17 +47,17 @@ public BigQueryException(int code, String message) {
}
public BigQueryException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
this.error = null;
}
public BigQueryException(int code, String message, BigQueryError error) {
- super(code, message, error != null ? error.getReason() : null, true);
+ super(code, message, error != null ? error.getReason() : null, true, RETRYABLE_ERRORS);
this.error = error;
}
public BigQueryException(IOException exception) {
- super(exception, true);
+ super(exception, true, RETRYABLE_ERRORS);
BigQueryError error = null;
if (getReason() != null) {
error = new BigQueryError(getReason(), getLocation(), getMessage(), getDebugInfo());
@@ -74,11 +74,6 @@ public BigQueryError getError() {
return error;
}
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
- }
-
@Override
public boolean equals(Object obj) {
if (obj == this) {
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
index 001bc1354cd4..b769c38d9081 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
@@ -24,7 +24,7 @@
import com.google.api.services.bigquery.model.TableDataInsertAllRequest.Rows;
import com.google.api.services.bigquery.model.TableRow;
import com.google.cloud.BaseService;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.PageImpl.NextPageFetcher;
import com.google.cloud.RetryHelper;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java
index cafa0d3d8563..f3fdf2c6030f 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.bigquery;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java
index 0db54e836c00..f9434f9d4170 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java
@@ -18,7 +18,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption;
import com.google.cloud.bigquery.BigQuery.DatasetOption;
import com.google.cloud.bigquery.BigQuery.TableListOption;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java
index 9fd88c6d0d2a..7fb92cce63c8 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java
@@ -18,7 +18,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery.JobOption;
import com.google.cloud.bigquery.BigQuery.TableDataListOption;
import com.google.cloud.bigquery.BigQuery.TableOption;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
index 0f27b463523d..bc98bb1795d7 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
@@ -49,9 +49,9 @@
import com.google.api.services.bigquery.model.TableList;
import com.google.api.services.bigquery.model.TableReference;
import com.google.api.services.bigquery.model.TableRow;
-import com.google.cloud.HttpTransportOptions;
import com.google.cloud.bigquery.BigQueryException;
import com.google.cloud.bigquery.BigQueryOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java
index 605f8c08b49e..dccc53d7c2e2 100644
--- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java
+++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java
@@ -16,13 +16,12 @@
package com.google.cloud.bigquery.testing;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.auth.oauth2.ServiceAccountCredentials;
-import com.google.cloud.HttpTransportOptions;
-import com.google.api.gax.core.RetrySettings;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryException;
import com.google.cloud.bigquery.BigQueryOptions;
-
+import com.google.cloud.http.HttpTransportOptions;
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java
index b811243a4136..de6c8d4bed95 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java
@@ -44,7 +44,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new BigQueryException(502, "message");
assertEquals(502, exception.getCode());
@@ -52,7 +51,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new BigQueryException(503, "message");
assertEquals(503, exception.getCode());
@@ -60,7 +58,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new BigQueryException(504, "message");
assertEquals(504, exception.getCode());
@@ -68,7 +65,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new BigQueryException(400, "message");
assertEquals(400, exception.getCode());
@@ -76,7 +72,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
BigQueryError error = new BigQueryError("reason", null, null);
exception = new BigQueryException(504, "message", error);
@@ -85,7 +80,6 @@ public void testBigqueryException() {
assertEquals("reason", exception.getReason());
assertEquals(error, exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException("socketTimeoutMessage");
exception = new BigQueryException(cause);
@@ -94,7 +88,6 @@ public void testBigqueryException() {
assertEquals("socketTimeoutMessage", exception.getMessage());
assertEquals(cause, exception.getCause());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new BigQueryException(504, "message", cause);
@@ -103,7 +96,6 @@ public void testBigqueryException() {
assertNull(exception.getReason());
assertNull(exception.getError());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
@@ -147,7 +139,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(503, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -162,7 +153,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(BigQueryException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java
index c4c15926f702..b9c59688f2a4 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java
@@ -32,7 +32,7 @@
import com.google.api.services.bigquery.model.TableDataInsertAllRequest;
import com.google.api.services.bigquery.model.TableDataInsertAllResponse;
import com.google.api.services.bigquery.model.TableRow;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.ServiceOptions;
import com.google.cloud.WriteChannel;
import com.google.cloud.bigquery.InsertAllRequest.RowToInsert;
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java
index d10686841627..548d39ff099d 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.bigquery;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -28,7 +28,7 @@ public class BigQueryOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- BigQueryOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ BigQueryOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java
index 453767c62671..69a0713b21a0 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java
index f011c671d07a..95d9f99ad35f 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.bigquery.InsertAllRequest.RowToInsert;
import com.google.common.collect.ImmutableList;
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
index 4a381fb3932f..d4d0f374cdef 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
@@ -24,7 +24,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.WaitForOption;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.DatasetField;
diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java
index bfac8bb4bc3d..7347ffb014bf 100644
--- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java
+++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java
@@ -19,7 +19,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption;
import com.google.cloud.bigquery.BigQueryOptions;
diff --git a/google-cloud-compute/pom.xml b/google-cloud-compute/pom.xml
index d6b7df1ff4cd..0053b99df0e2 100644
--- a/google-cloud-compute/pom.xml
+++ b/google-cloud-compute/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.apis
google-api-services-compute
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java
index 700bc916ca8d..3d9f064b2009 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java
@@ -20,7 +20,7 @@
import com.google.cloud.FieldSelector;
import com.google.cloud.FieldSelector.Helper;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Service;
import com.google.cloud.compute.AttachedDisk.PersistentDiskConfiguration;
import com.google.cloud.compute.NetworkInterface.AccessConfig;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeException.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeException.java
index c0d801624c1e..adacfb81a259 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeException.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeException.java
@@ -18,34 +18,29 @@
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
/**
* Compute Engine service exception.
*/
-public class ComputeException extends BaseServiceException {
+public class ComputeException extends BaseHttpServiceException {
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(new Error(500, null));
private static final long serialVersionUID = -8039359778707845810L;
ComputeException(int code, String message) {
- super(code, message, null, true, null);
+ super(code, message, null, true, RETRYABLE_ERRORS, null);
}
ComputeException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
}
public ComputeException(IOException exception) {
- super(exception, true);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(exception, true, RETRYABLE_ERRORS);
}
/**
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java
index 2ed72f444d73..cfcd0834edc2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java
@@ -20,7 +20,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import com.google.cloud.BaseService;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.PageImpl.NextPageFetcher;
import com.google.cloud.RetryHelper;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeOptions.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeOptions.java
index 31ab253a1244..dfe418a5fb3f 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeOptions.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.compute;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/spi/v1/HttpComputeRpc.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/spi/v1/HttpComputeRpc.java
index eccbee1481c0..2b95d94750cd 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/spi/v1/HttpComputeRpc.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/spi/v1/HttpComputeRpc.java
@@ -68,7 +68,7 @@
import com.google.api.services.compute.model.Tags;
import com.google.api.services.compute.model.Zone;
import com.google.api.services.compute.model.ZoneList;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.compute.ComputeException;
import com.google.cloud.compute.ComputeOptions;
import com.google.common.collect.ImmutableList;
diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/testing/RemoteComputeHelper.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/testing/RemoteComputeHelper.java
index 19a2a1bac855..e99918650fd2 100644
--- a/google-cloud-compute/src/main/java/com/google/cloud/compute/testing/RemoteComputeHelper.java
+++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/testing/RemoteComputeHelper.java
@@ -17,8 +17,8 @@
package com.google.cloud.compute.testing;
import com.google.auth.oauth2.ServiceAccountCredentials;
-import com.google.cloud.HttpTransportOptions;
-import com.google.api.gax.core.RetrySettings;
+import com.google.cloud.http.HttpTransportOptions;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.compute.ComputeOptions;
import java.io.IOException;
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeExceptionTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeExceptionTest.java
index 0d5b271a475d..c807a659620c 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeExceptionTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeExceptionTest.java
@@ -43,21 +43,18 @@ public void testResourceManagerException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new ComputeException(403, "message");
assertEquals(403, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException();
exception = new ComputeException(cause);
assertNull(exception.getReason());
assertNull(exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new ComputeException(403, "message", cause);
@@ -65,7 +62,6 @@ public void testResourceManagerException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
}
@@ -81,7 +77,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(500, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -96,7 +91,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(ComputeException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeImplTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeImplTest.java
index fbf635bb01f2..3882c575f22f 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeImplTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeImplTest.java
@@ -25,7 +25,7 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.ServiceOptions;
import com.google.cloud.compute.NetworkInterface.AccessConfig;
import com.google.cloud.compute.spi.v1.ComputeRpc;
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeOptionsTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeOptionsTest.java
index 48f34419d87d..a10a16b8183e 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeOptionsTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/ComputeOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.compute;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,7 +29,7 @@ public class ComputeOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- ComputeOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ ComputeOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java
index 3fe32d2bfa96..d4ce6b5a7bb5 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java
@@ -23,7 +23,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.compute.Address;
import com.google.cloud.compute.AddressId;
import com.google.cloud.compute.AddressInfo;
diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/testing/RemoteComputeHelperTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/testing/RemoteComputeHelperTest.java
index a8f6dd907c70..03d6bfe28fa5 100644
--- a/google-cloud-compute/src/test/java/com/google/cloud/compute/testing/RemoteComputeHelperTest.java
+++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/testing/RemoteComputeHelperTest.java
@@ -21,7 +21,7 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.compute.ComputeOptions;
import com.google.cloud.compute.testing.RemoteComputeHelper.ComputeHelperException;
diff --git a/google-cloud-core-grpc/pom.xml b/google-cloud-core-grpc/pom.xml
new file mode 100644
index 000000000000..af23786393f2
--- /dev/null
+++ b/google-cloud-core-grpc/pom.xml
@@ -0,0 +1,92 @@
+
+
+ 4.0.0
+ google-cloud-core-grpc
+ 1.0.0-rc2-SNAPSHOT
+ jar
+ Google Cloud Core gRPC
+ https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-grpc
+
+ Core gRPC module for the google-cloud.
+
+
+ com.google.cloud
+ google-cloud-pom
+ 0.14.1-alpha-SNAPSHOT
+
+
+ google-cloud-core-grpc
+ ${project.version}
+
+
+
+ com.google.cloud
+ google-cloud-core
+ ${core.version}
+
+
+ com.google.guava
+ guava
+
+
+ junit
+ junit
+ test
+
+
+ org.easymock
+ easymock
+ 3.4
+ test
+
+
+ com.google.protobuf
+ protobuf-java
+
+
+ com.google.protobuf
+ protobuf-java-util
+
+
+ io.grpc
+ grpc-protobuf
+ ${grpc.version}
+
+
+ com.google.api
+ gax-grpc
+
+
+ com.google.truth
+ truth
+ 0.30
+ test
+
+
+ com.google.guava
+ guava-testlib
+ 19.0
+ test
+
+
+
+
+
+ org.codehaus.mojo
+ properties-maven-plugin
+ 1.0-alpha-2
+
+
+ generate-resources
+
+ write-project-properties
+
+
+ ${project.build.outputDirectory}/com/google/cloud/project.properties
+
+
+
+
+
+
+
diff --git a/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java b/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java
new file mode 100644
index 000000000000..fcefe6a8e951
--- /dev/null
+++ b/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.grpc;
+
+import com.google.api.client.http.HttpResponseException;
+import com.google.api.gax.grpc.ApiException;
+import com.google.cloud.BaseServiceException;
+import com.google.common.base.MoreObjects;
+import java.io.IOException;
+import java.util.Collections;
+
+/**
+ * Base class for all exceptions from grpc-based services.
+ */
+public class BaseGrpcServiceException extends BaseServiceException {
+
+ private static final long serialVersionUID = -2685197215731335549L;
+
+ public BaseGrpcServiceException(String message, Throwable cause, int code, boolean retryable) {
+ super(ExceptionData.newBuilder().setMessage(message).setCause(cause).setCode(code)
+ .setRetryable(retryable).build());
+ }
+
+ public BaseGrpcServiceException(IOException exception, boolean idempotent) {
+ super(makeExceptionData(exception, idempotent));
+ }
+
+ private static ExceptionData makeExceptionData(IOException exception, boolean idempotent) {
+ int code = UNKNOWN_CODE;
+ Boolean retryable = null;
+ if (exception instanceof HttpResponseException) {
+ // In cases where an exception is an instance of HttpResponseException,
+ // check the status code to determine whether it's retryable
+ code = ((HttpResponseException) exception).getStatusCode();
+ retryable = BaseServiceException
+ .isRetryable(code, null, idempotent, Collections.emptySet());
+ }
+ return ExceptionData.newBuilder()
+ .setMessage(exception.getMessage())
+ .setCause(exception)
+ .setRetryable(MoreObjects
+ .firstNonNull(retryable, BaseServiceException.isRetryable(idempotent, exception)))
+ .setCode(code)
+ .setReason(null)
+ .setLocation(null)
+ .setDebugInfo(null)
+ .build();
+ }
+
+ public BaseGrpcServiceException(ApiException apiException) {
+ super(ExceptionData.newBuilder()
+ .setMessage(apiException.getMessage())
+ .setCause(apiException)
+ .setRetryable(apiException.isRetryable())
+ .setCode(apiException.getStatusCode().value())
+ .setReason(apiException.getStatusCode().name())
+ .setLocation(null)
+ .setDebugInfo(null)
+ .build());
+ }
+}
diff --git a/google-cloud-core/src/main/java/com/google/cloud/GrpcTransportOptions.java b/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java
similarity index 94%
rename from google-cloud-core/src/main/java/com/google/cloud/GrpcTransportOptions.java
rename to google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java
index 15fb9a7311ce..14df14531766 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/GrpcTransportOptions.java
+++ b/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java
@@ -14,18 +14,20 @@
* limitations under the License.
*/
-package com.google.cloud;
+package com.google.cloud.grpc;
import static com.google.common.base.MoreObjects.firstNonNull;
+import com.google.api.core.InternalApi;
import com.google.api.gax.core.FixedCredentialsProvider;
-import com.google.api.gax.core.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.InstantiatingChannelProvider;
import com.google.api.gax.grpc.UnaryCallSettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.auth.Credentials;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
+import com.google.cloud.NoCredentials;
+import com.google.cloud.ServiceOptions;
+import com.google.cloud.TransportOptions;
import io.grpc.internal.SharedResourceHolder;
import io.grpc.internal.SharedResourceHolder.Resource;
import java.io.IOException;
@@ -92,8 +94,8 @@ public interface ExecutorFactory {
void release(T executor);
}
- @VisibleForTesting
- static class DefaultExecutorFactory implements ExecutorFactory {
+ @InternalApi
+ public static class DefaultExecutorFactory implements ExecutorFactory {
private static final DefaultExecutorFactory INSTANCE = new DefaultExecutorFactory();
diff --git a/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java b/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java
new file mode 100644
index 000000000000..c7ce99bb3920
--- /dev/null
+++ b/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.grpc;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import com.google.api.gax.grpc.ApiException;
+import com.google.cloud.BaseServiceException;
+import com.google.cloud.RetryHelper;
+import io.grpc.Status.Code;
+import java.io.IOException;
+import java.net.SocketException;
+import java.net.SocketTimeoutException;
+import org.junit.Test;
+
+public class BaseGrpcServiceExceptionTest {
+
+ private static final int CODE = 1;
+ private static final String MESSAGE = "some message";
+ private static final boolean NOT_RETRYABLE = false;
+ private static final boolean IDEMPOTENT = true;
+
+ @Test
+ public void testBaseServiceException() {
+ BaseGrpcServiceException serviceException = null;
+
+ IOException exception = new SocketTimeoutException();
+ serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT);
+ assertTrue(serviceException.isRetryable());
+ assertNull(serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+ assertNull(serviceException.getReason());
+ assertNull(serviceException.getLocation());
+ assertNull(serviceException.getDebugInfo());
+
+ exception = new SocketException();
+ serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT);
+ assertTrue(serviceException.isRetryable());
+ assertNull(serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+ assertNull(serviceException.getReason());
+ assertNull(serviceException.getLocation());
+ assertNull(serviceException.getDebugInfo());
+
+ exception = new IOException("insufficient data written");
+ serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT);
+ assertTrue(serviceException.isRetryable());
+ assertEquals("insufficient data written", serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+ assertNull(serviceException.getReason());
+ assertNull(serviceException.getLocation());
+ assertNull(serviceException.getDebugInfo());
+
+ Exception cause = new IllegalArgumentException("bad arg");
+ ApiException apiException = new ApiException(MESSAGE, cause, Code.INTERNAL, NOT_RETRYABLE);
+ serviceException = new BaseGrpcServiceException(apiException);
+ assertFalse(serviceException.isRetryable());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(apiException, serviceException.getCause());
+ assertEquals(Code.INTERNAL.value(), serviceException.getCode());
+ assertEquals(Code.INTERNAL.name(), serviceException.getReason());
+ assertNull(serviceException.getLocation());
+ assertNull(serviceException.getDebugInfo());
+ }
+
+ @Test
+ public void testTranslateAndThrow() throws Exception {
+ IOException exception = new SocketTimeoutException();
+ BaseGrpcServiceException cause = new BaseGrpcServiceException(exception, IDEMPOTENT);
+ RetryHelper.RetryHelperException exceptionMock =
+ createMock(RetryHelper.RetryHelperException.class);
+ expect(exceptionMock.getCause()).andReturn(cause).times(2);
+ replay(exceptionMock);
+ try {
+ BaseServiceException.translate(exceptionMock);
+ } catch (BaseServiceException ex) {
+ assertEquals(0, ex.getCode());
+ assertNull(ex.getMessage());
+ assertTrue(ex.isRetryable());
+ } finally {
+ verify(exceptionMock);
+ }
+ }
+
+}
diff --git a/google-cloud-core/src/test/java/com/google/cloud/GrpcTransportOptionsTest.java b/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java
similarity index 92%
rename from google-cloud-core/src/test/java/com/google/cloud/GrpcTransportOptionsTest.java
rename to google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java
index 1bcc54af6a91..7aff66b2d643 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/GrpcTransportOptionsTest.java
+++ b/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java
@@ -14,16 +14,15 @@
* limitations under the License.
*/
-package com.google.cloud;
+package com.google.cloud.grpc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import com.google.cloud.GrpcTransportOptions.DefaultExecutorFactory;
-import com.google.cloud.GrpcTransportOptions.ExecutorFactory;
+import com.google.cloud.grpc.GrpcTransportOptions.DefaultExecutorFactory;
+import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
import java.util.concurrent.ScheduledExecutorService;
import org.easymock.EasyMock;
import org.junit.Test;
diff --git a/google-cloud-core-http/pom.xml b/google-cloud-core-http/pom.xml
new file mode 100644
index 000000000000..a23ea864ef5a
--- /dev/null
+++ b/google-cloud-core-http/pom.xml
@@ -0,0 +1,132 @@
+
+
+ 4.0.0
+ google-cloud-core-http
+ 1.0.0-rc2-SNAPSHOT
+ jar
+ Google Cloud Core HTTP
+ https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http
+
+ Core http module for the google-cloud.
+
+
+ com.google.cloud
+ google-cloud-pom
+ 0.14.1-alpha-SNAPSHOT
+
+
+ google-cloud-core-http
+ ${project.version}
+
+
+
+ com.google.cloud
+ google-cloud-core
+ ${core.version}
+
+
+ com.google.auth
+ google-auth-library-credentials
+
+
+ com.google.auth
+ google-auth-library-oauth2-http
+
+
+ com.google.guava
+ guava-jdk5
+
+
+
+
+ com.google.http-client
+ google-http-client
+ compile
+
+
+ com.google.oauth-client
+ google-oauth-client
+ compile
+
+
+ com.google.guava
+ guava
+
+
+ com.google.api-client
+ google-api-client
+ compile
+
+
+ guava-jdk5
+ com.google.guava
+
+
+
+
+ com.google.http-client
+ google-http-client-appengine
+ compile
+
+
+ guava-jdk5
+ com.google.guava
+
+
+
+
+ com.google.http-client
+ google-http-client-jackson
+ compile
+
+
+ guava-jdk5
+ com.google.guava
+
+
+
+
+ junit
+ junit
+ test
+
+
+ org.easymock
+ easymock
+ 3.4
+ test
+
+
+ com.google.truth
+ truth
+ 0.30
+ test
+
+
+ com.google.guava
+ guava-testlib
+ 19.0
+ test
+
+
+
+
+
+ org.codehaus.mojo
+ properties-maven-plugin
+ 1.0-alpha-2
+
+
+ generate-resources
+
+ write-project-properties
+
+
+ ${project.build.outputDirectory}/com/google/cloud/project.properties
+
+
+
+
+
+
+
diff --git a/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java b/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java
new file mode 100644
index 000000000000..b1ffa2983815
--- /dev/null
+++ b/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.http;
+
+import com.google.api.client.googleapis.json.GoogleJsonError;
+import com.google.api.client.googleapis.json.GoogleJsonResponseException;
+import com.google.api.client.http.HttpResponseException;
+import com.google.cloud.BaseServiceException;
+import com.google.common.base.MoreObjects;
+import java.io.IOException;
+import java.util.Set;
+
+/**
+ * Base class for all exceptions from http-based services.
+ */
+public class BaseHttpServiceException extends BaseServiceException {
+
+ private static final long serialVersionUID = -5793034110344127954L;
+ public static final int UNKNOWN_CODE = 0;
+
+ public BaseHttpServiceException(IOException exception, boolean idempotent,
+ Set retryableErrors) {
+ super(makeExceptionData(exception, idempotent, retryableErrors));
+ }
+
+ private static ExceptionData makeExceptionData(IOException exception, boolean idempotent,
+ Set retryableErrors) {
+ int code = UNKNOWN_CODE;
+ String reason = null;
+ String location = null;
+ String debugInfo = null;
+ Boolean retryable = null;
+ if (exception instanceof HttpResponseException) {
+ if (exception instanceof GoogleJsonResponseException) {
+ GoogleJsonError jsonError = ((GoogleJsonResponseException) exception).getDetails();
+ if (jsonError != null) {
+ BaseServiceException.Error error = new BaseServiceException.Error(jsonError.getCode(),
+ reason(jsonError));
+ code = error.getCode();
+ reason = error.getReason();
+ retryable = error.isRetryable(idempotent, retryableErrors);
+ if (reason != null) {
+ GoogleJsonError.ErrorInfo errorInfo = jsonError.getErrors().get(0);
+ location = errorInfo.getLocation();
+ debugInfo = (String) errorInfo.get("debugInfo");
+ }
+ } else {
+ code = ((GoogleJsonResponseException) exception).getStatusCode();
+ }
+ } else {
+ // In cases where an exception is an instance of HttpResponseException but not
+ // an instance of GoogleJsonResponseException, check the status code to determine whether it's retryable
+ code = ((HttpResponseException) exception).getStatusCode();
+ retryable = BaseServiceException.isRetryable(code, null, idempotent, retryableErrors);
+ }
+ }
+ return ExceptionData.newBuilder()
+ .setMessage(message(exception))
+ .setCause(exception)
+ .setRetryable(MoreObjects
+ .firstNonNull(retryable, BaseServiceException.isRetryable(idempotent, exception)))
+ .setCode(code)
+ .setReason(reason)
+ .setLocation(location)
+ .setDebugInfo(debugInfo)
+ .build();
+ }
+
+ public BaseHttpServiceException(GoogleJsonError googleJsonError, boolean idempotent,
+ Set retryableErrors) {
+ super(makeExceptionData(googleJsonError, idempotent, retryableErrors));
+ }
+
+ private static ExceptionData makeExceptionData(GoogleJsonError googleJsonError, boolean idempotent,
+ Set retryableErrors) {
+ int code = googleJsonError.getCode();
+ String reason = reason(googleJsonError);
+
+ ExceptionData.Builder exceptionData = ExceptionData.newBuilder();
+ exceptionData
+ .setMessage(googleJsonError.getMessage())
+ .setCause(null)
+ .setRetryable(BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors))
+ .setCode(code)
+ .setReason(reason);
+ if (reason != null) {
+ GoogleJsonError.ErrorInfo errorInfo = googleJsonError.getErrors().get(0);
+ exceptionData.setLocation(errorInfo.getLocation());
+ exceptionData.setDebugInfo((String) errorInfo.get("debugInfo"));
+ } else {
+ exceptionData.setLocation(null);
+ exceptionData.setDebugInfo(null);
+ }
+ return exceptionData.build();
+ }
+
+ public BaseHttpServiceException(int code, String message, String reason, boolean idempotent,
+ Set retryableErrors) {
+ this(code, message, reason, idempotent, retryableErrors, null);
+ }
+
+ public BaseHttpServiceException(int code, String message, String reason, boolean idempotent,
+ Set retryableErrors, Throwable cause) {
+ super(ExceptionData.newBuilder()
+ .setMessage(message)
+ .setCause(cause)
+ .setRetryable(BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors))
+ .setCode(code)
+ .setReason(reason)
+ .setLocation(null)
+ .setDebugInfo(null)
+ .build());
+ }
+
+ private static String reason(GoogleJsonError error) {
+ if (error.getErrors() != null && !error.getErrors().isEmpty()) {
+ return error.getErrors().get(0).getReason();
+ }
+ return null;
+ }
+
+ private static String message(IOException exception) {
+ if (exception instanceof GoogleJsonResponseException) {
+ GoogleJsonError details = ((GoogleJsonResponseException) exception).getDetails();
+ if (details != null) {
+ return details.getMessage();
+ }
+ }
+ return exception.getMessage();
+ }
+
+}
diff --git a/google-cloud-core/src/main/java/com/google/cloud/HttpTransportOptions.java b/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java
similarity index 97%
rename from google-cloud-core/src/main/java/com/google/cloud/HttpTransportOptions.java
rename to google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java
index a2a99a28d910..1a4f25158edf 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/HttpTransportOptions.java
+++ b/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.cloud;
+package com.google.cloud.http;
import static com.google.common.base.MoreObjects.firstNonNull;
@@ -27,6 +27,9 @@
import com.google.auth.Credentials;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.http.HttpTransportFactory;
+import com.google.cloud.NoCredentials;
+import com.google.cloud.ServiceOptions;
+import com.google.cloud.TransportOptions;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Objects;
diff --git a/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java b/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java
new file mode 100644
index 000000000000..0031f32e36da
--- /dev/null
+++ b/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.http;
+
+import static com.google.cloud.BaseServiceException.UNKNOWN_CODE;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import com.google.api.client.googleapis.json.GoogleJsonError;
+import com.google.cloud.BaseServiceException;
+import com.google.cloud.RetryHelper;
+import com.google.common.collect.ImmutableSet;
+import java.io.IOException;
+import java.net.SocketException;
+import java.net.SocketTimeoutException;
+import java.util.Collections;
+import java.util.Set;
+import org.junit.Test;
+
+public class BaseHttpServiceExceptionTest {
+
+ private static final int CODE = 1;
+ private static final int CODE_NO_REASON = 2;
+ private static final String MESSAGE = "some message";
+ private static final String REASON = "some reason";
+ private static final boolean RETRYABLE = true;
+ private static final boolean IDEMPOTENT = true;
+ private static final boolean NOT_IDEMPOTENT = false;
+ private static final Set EMPTY_RETRYABLE_ERRORS =
+ Collections.emptySet();
+
+ private static class CustomServiceException extends BaseHttpServiceException {
+
+ private static final long serialVersionUID = -195251309124875103L;
+
+ public CustomServiceException(int code, String message, String reason, boolean idempotent) {
+ super(code, message, reason, idempotent, RETRYABLE_ERRORS);
+ }
+
+ private static final Set RETRYABLE_ERRORS = ImmutableSet
+ .of(new Error(CODE, REASON), new Error(null, REASON),
+ new Error(CODE_NO_REASON, null));
+ }
+
+ @Test
+ public void testBaseServiceException() {
+ BaseServiceException serviceException = new BaseHttpServiceException(CODE, MESSAGE, REASON,
+ IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertFalse(serviceException.isRetryable());
+ assertNull(serviceException.getCause());
+
+ serviceException = new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT,
+ EMPTY_RETRYABLE_ERRORS);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertFalse(serviceException.isRetryable());
+ assertNull(serviceException.getCause());
+
+ Exception cause = new RuntimeException();
+ serviceException = new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT,
+ EMPTY_RETRYABLE_ERRORS, cause);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertFalse(serviceException.isRetryable());
+ assertEquals(cause, serviceException.getCause());
+
+ serviceException = new BaseHttpServiceException(CODE, MESSAGE, REASON, NOT_IDEMPOTENT,
+ EMPTY_RETRYABLE_ERRORS, cause);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertFalse(serviceException.isRetryable());
+ assertEquals(cause, serviceException.getCause());
+
+ IOException exception = new SocketTimeoutException();
+ serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ assertTrue(serviceException.isRetryable());
+ assertNull(serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+
+ exception = new SocketException();
+ serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ assertTrue(serviceException.isRetryable());
+ assertNull(serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+
+ exception = new IOException("insufficient data written");
+ serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ assertTrue(serviceException.isRetryable());
+ assertEquals("insufficient data written", serviceException.getMessage());
+ assertEquals(exception, serviceException.getCause());
+
+ GoogleJsonError error = new GoogleJsonError();
+ error.setCode(CODE);
+ error.setMessage(MESSAGE);
+ serviceException = new BaseHttpServiceException(error, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertFalse(serviceException.isRetryable());
+
+ serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
+ assertEquals(CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertEquals(RETRYABLE, serviceException.isRetryable());
+
+ serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT);
+ assertEquals(CODE_NO_REASON, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertNull(serviceException.getReason());
+ assertEquals(RETRYABLE, serviceException.isRetryable());
+
+ serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT);
+ assertEquals(UNKNOWN_CODE, serviceException.getCode());
+ assertEquals(MESSAGE, serviceException.getMessage());
+ assertEquals(REASON, serviceException.getReason());
+ assertEquals(RETRYABLE, serviceException.isRetryable());
+ }
+
+ @Test
+ public void testTranslateAndThrow() throws Exception {
+ BaseServiceException cause =
+ new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS);
+ RetryHelper.RetryHelperException exceptionMock =
+ createMock(RetryHelper.RetryHelperException.class);
+ expect(exceptionMock.getCause()).andReturn(cause).times(2);
+ replay(exceptionMock);
+ try {
+ BaseServiceException.translate(exceptionMock);
+ } catch (BaseServiceException ex) {
+ assertEquals(CODE, ex.getCode());
+ assertEquals(MESSAGE, ex.getMessage());
+ assertFalse(ex.isRetryable());
+ } finally {
+ verify(exceptionMock);
+ }
+ }
+
+
+}
diff --git a/google-cloud-core/src/test/java/com/google/cloud/HttpTransportOptionsTest.java b/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java
similarity index 94%
rename from google-cloud-core/src/test/java/com/google/cloud/HttpTransportOptionsTest.java
rename to google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java
index 4d828ea6e729..4240aa9172a0 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/HttpTransportOptionsTest.java
+++ b/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.cloud;
+package com.google.cloud.http;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
@@ -22,7 +22,8 @@
import static org.junit.Assert.assertTrue;
import com.google.auth.http.HttpTransportFactory;
-import com.google.cloud.HttpTransportOptions.DefaultHttpTransportFactory;
+import com.google.cloud.ServiceOptions;
+import com.google.cloud.http.HttpTransportOptions.DefaultHttpTransportFactory;
import java.util.regex.Pattern;
import org.easymock.EasyMock;
import org.junit.Test;
diff --git a/google-cloud-core/pom.xml b/google-cloud-core/pom.xml
index 27860ab674b5..c17f4b0ff1a2 100644
--- a/google-cloud-core/pom.xml
+++ b/google-cloud-core/pom.xml
@@ -19,67 +19,10 @@
${project.version}
-
- com.google.auth
- google-auth-library-credentials
-
-
- com.google.auth
- google-auth-library-oauth2-http
-
-
- com.google.guava
- guava-jdk5
-
-
-
-
- com.google.http-client
- google-http-client
- compile
-
-
- com.google.oauth-client
- google-oauth-client
- compile
-
com.google.guava
guava
-
- com.google.api-client
- google-api-client
- compile
-
-
- guava-jdk5
- com.google.guava
-
-
-
-
- com.google.http-client
- google-http-client-appengine
- compile
-
-
- guava-jdk5
- com.google.guava
-
-
-
-
- com.google.http-client
- google-http-client-jackson
- compile
-
-
- guava-jdk5
- com.google.guava
-
-
-
junit
junit
@@ -103,28 +46,15 @@
test
- com.google.protobuf
- protobuf-java
-
-
- com.google.protobuf
- protobuf-java-util
-
-
- io.grpc
- grpc-protobuf
- ${grpc.version}
+ com.google.api
+ api-common
+ ${api-common.version}
com.google.api
gax
${gax.version}
-
- com.google.api
- api-common
- ${api-common.version}
-
com.google.api.grpc
grpc-google-common-protos
diff --git a/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java b/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java
index f72783cf87b9..8048b9e18f88 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java
@@ -19,8 +19,8 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.InternalApi;
-import com.google.api.gax.core.AsyncPage;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.AsyncPage;
+import com.google.api.gax.paging.Page;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.Uninterruptibles;
import java.io.Serializable;
diff --git a/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java b/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java
index 0e2c6156c106..f7ded9900b6f 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java
@@ -16,18 +16,13 @@
package com.google.cloud;
-import com.google.api.client.googleapis.json.GoogleJsonError;
-import com.google.api.client.googleapis.json.GoogleJsonResponseException;
-import com.google.api.client.http.HttpResponseException;
-import com.google.api.gax.grpc.ApiException;
+import com.google.api.core.InternalApi;
import com.google.common.base.MoreObjects;
-
import java.io.IOException;
import java.io.Serializable;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.security.cert.CertificateException;
-import java.util.Collections;
import java.util.Objects;
import java.util.Set;
import javax.net.ssl.SSLHandshakeException;
@@ -43,11 +38,131 @@ public class BaseServiceException extends RuntimeException {
private final int code;
private final boolean retryable;
private final String reason;
- private final boolean idempotent;
private final String location;
private final String debugInfo;
- protected static final class Error implements Serializable {
+ @InternalApi
+ public static final class ExceptionData implements Serializable {
+ private static final long serialVersionUID = 2222230861338426753L;
+
+ private final String message;
+ private final Throwable cause;
+ private final int code;
+ private final boolean retryable;
+ private final String reason;
+ private final String location;
+ private final String debugInfo;
+
+ private ExceptionData(String message, Throwable cause, int code, boolean retryable,
+ String reason, String location, String debugInfo) {
+ this.message = message;
+ this.cause = cause;
+ this.code = code;
+ this.retryable = retryable;
+ this.reason = reason;
+ this.location = location;
+ this.debugInfo = debugInfo;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Throwable getCause() {
+ return cause;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public boolean isRetryable() {
+ return retryable;
+ }
+
+ public String getReason() {
+ return reason;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getDebugInfo() {
+ return debugInfo;
+ }
+
+ public static Builder newBuilder() {
+ return new Builder();
+ }
+
+ public static ExceptionData from(int code, String message, String reason, boolean retryable) {
+ return from(code, message, reason, retryable, null);
+ }
+
+ public static ExceptionData from(int code, String message, String reason, boolean retryable,
+ Throwable cause) {
+ return newBuilder().setCode(code).setMessage(message).setReason(reason)
+ .setRetryable(retryable).setCause(cause).build();
+ }
+
+ @InternalApi
+ public static final class Builder {
+
+ private String message;
+ private Throwable cause;
+ private int code;
+ private boolean retryable;
+ private String reason;
+ private String location;
+ private String debugInfo;
+
+ private Builder() {}
+
+ public Builder setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ public Builder setCause(Throwable cause) {
+ this.cause = cause;
+ return this;
+ }
+
+ public Builder setCode(int code) {
+ this.code = code;
+ return this;
+ }
+
+ public Builder setRetryable(boolean retryable) {
+ this.retryable = retryable;
+ return this;
+ }
+
+ public Builder setReason(String reason) {
+ this.reason = reason;
+ return this;
+ }
+
+ public Builder setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ public Builder setDebugInfo(String debugInfo) {
+ this.debugInfo = debugInfo;
+ return this;
+ }
+
+ public ExceptionData build() {
+ return new ExceptionData(message, cause, code, retryable, reason, location,
+ debugInfo);
+ }
+ }
+ }
+
+ @InternalApi
+ public static final class Error implements Serializable {
private static final long serialVersionUID = -4019600198652965721L;
@@ -91,15 +206,9 @@ public String getReason() {
return reason;
}
- boolean isRetryable(boolean idempotent, Set retryableErrors) {
- for (Error retryableError : retryableErrors) {
- if ((retryableError.getCode() == null || retryableError.getCode().equals(this.getCode()))
- && (retryableError.getReason() == null
- || retryableError.getReason().equals(this.getReason()))) {
- return idempotent || retryableError.isRejected();
- }
- }
- return false;
+ @InternalApi
+ public boolean isRetryable(boolean idempotent, Set retryableErrors) {
+ return BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors);
}
@Override
@@ -113,104 +222,45 @@ public int hashCode() {
}
}
- public BaseServiceException(IOException exception, boolean idempotent) {
- super(message(exception), exception);
- int code = UNKNOWN_CODE;
- String reason = null;
- String location = null;
- String debugInfo = null;
- Boolean retryable = null;
- if (exception instanceof HttpResponseException) {
- if (exception instanceof GoogleJsonResponseException) {
- GoogleJsonError jsonError = ((GoogleJsonResponseException) exception).getDetails();
- if (jsonError != null) {
- Error error = new Error(jsonError.getCode(), reason(jsonError));
- code = error.code;
- reason = error.reason;
- retryable = isRetryable(idempotent, error);
- if (reason != null) {
- GoogleJsonError.ErrorInfo errorInfo = jsonError.getErrors().get(0);
- location = errorInfo.getLocation();
- debugInfo = (String) errorInfo.get("debugInfo");
- }
- } else {
- code = ((GoogleJsonResponseException) exception).getStatusCode();
- }
- } else {
- // In cases where an exception is an instance of HttpResponseException but not
- // an instance of GoogleJsonResponseException, check the status code to determine whether it's retryable
- code = ((HttpResponseException) exception).getStatusCode();
- retryable = isRetryable(idempotent, new Error(code, null));
- }
- }
- this.retryable = MoreObjects.firstNonNull(retryable, isRetryable(idempotent, exception));
- this.code = code;
- this.reason = reason;
- this.idempotent = idempotent;
- this.location = location;
- this.debugInfo = debugInfo;
- }
- public BaseServiceException(GoogleJsonError googleJsonError, boolean idempotent) {
- super(googleJsonError.getMessage());
- Error error = new Error(googleJsonError.getCode(), reason(googleJsonError));
- this.code = error.code;
- this.reason = error.reason;
- this.retryable = isRetryable(idempotent, error);
- if (this.reason != null) {
- GoogleJsonError.ErrorInfo errorInfo = googleJsonError.getErrors().get(0);
- this.location = errorInfo.getLocation();
- this.debugInfo = (String) errorInfo.get("debugInfo");
- } else {
- this.location = null;
- this.debugInfo = null;
+ @InternalApi
+ public static boolean isRetryable(Integer code, String reason, boolean idempotent,
+ Set retryableErrors) {
+ for (Error retryableError : retryableErrors) {
+ if ((retryableError.getCode() == null || retryableError.getCode().equals(code))
+ && (retryableError.getReason() == null
+ || retryableError.getReason().equals(reason))) {
+ return idempotent || retryableError.isRejected();
+ }
}
- this.idempotent = idempotent;
+ return false;
}
- public BaseServiceException(int code, String message, String reason, boolean idempotent) {
- this(code, message, reason, idempotent, null);
- }
-
- public BaseServiceException(int code, String message, String reason, boolean idempotent,
- Throwable cause) {
- super(message, cause);
- this.code = code;
- this.reason = reason;
- this.idempotent = idempotent;
- this.retryable = isRetryable(idempotent, new Error(code, reason));
- this.location = null;
- this.debugInfo = null;
- }
-
- public BaseServiceException(ApiException apiException, boolean idempotent) {
- super(apiException.getMessage(), apiException);
- this.code = apiException.getStatusCode().value();
- this.reason = apiException.getStatusCode().name();
- this.idempotent = idempotent;
- this.retryable = apiException.isRetryable();
- this.location = null;
- this.debugInfo = null;
- }
-
-
- protected Set getRetryableErrors() {
- return Collections.emptySet();
- }
-
- protected boolean isRetryable(boolean idempotent, Error error) {
- return error.isRetryable(idempotent, getRetryableErrors());
- }
-
- protected boolean isRetryable(boolean idempotent, IOException exception) {
+ @InternalApi
+ public static boolean isRetryable(boolean idempotent, IOException exception) {
boolean exceptionIsRetryable = exception instanceof SocketTimeoutException
|| exception instanceof SocketException
|| (exception instanceof SSLHandshakeException
- && !(exception.getCause() instanceof CertificateException))
+ && !(exception.getCause() instanceof CertificateException))
|| "insufficient data written".equals(exception.getMessage());
return idempotent && exceptionIsRetryable;
}
+ @InternalApi
+ public static void translate(RetryHelper.RetryHelperException ex) {
+ if (ex.getCause() instanceof BaseServiceException) {
+ throw (BaseServiceException) ex.getCause();
+ }
+ }
+
+ public BaseServiceException(ExceptionData exceptionData) {
+ super(exceptionData.getMessage(), exceptionData.getCause());
+ this.code = exceptionData.getCode();
+ this.reason = exceptionData.getReason();
+ this.retryable = exceptionData.isRetryable();
+ this.location = exceptionData.getLocation();
+ this.debugInfo = exceptionData.getDebugInfo();
+ }
/**
* Returns the code associated with this exception.
@@ -236,14 +286,6 @@ public boolean isRetryable() {
}
- /**
- * Returns {@code true} when the operation that caused this exception had no side effects.
- */
- public boolean isIdempotent() {
- return idempotent;
- }
-
-
/**
* Returns the service location where the error causing the exception occurred. Returns {@code
* null} if not available.
@@ -252,8 +294,8 @@ public String getLocation() {
return location;
}
-
- protected String getDebugInfo() {
+ @InternalApi
+ public String getDebugInfo() {
return debugInfo;
}
@@ -271,37 +313,12 @@ public boolean equals(Object obj) {
&& code == other.code
&& retryable == other.retryable
&& Objects.equals(reason, other.reason)
- && idempotent == other.idempotent
&& Objects.equals(location, other.location)
&& Objects.equals(debugInfo, other.debugInfo);
}
@Override
public int hashCode() {
- return Objects.hash(getCause(), getMessage(), code, retryable, reason, idempotent, location,
- debugInfo);
- }
-
- private static String reason(GoogleJsonError error) {
- if (error.getErrors() != null && !error.getErrors().isEmpty()) {
- return error.getErrors().get(0).getReason();
- }
- return null;
- }
-
- private static String message(IOException exception) {
- if (exception instanceof GoogleJsonResponseException) {
- GoogleJsonError details = ((GoogleJsonResponseException) exception).getDetails();
- if (details != null) {
- return details.getMessage();
- }
- }
- return exception.getMessage();
- }
-
- protected static void translate(RetryHelper.RetryHelperException ex) {
- if (ex.getCause() instanceof BaseServiceException) {
- throw (BaseServiceException) ex.getCause();
- }
+ return Objects.hash(getCause(), getMessage(), code, retryable, reason, location, debugInfo);
}
}
diff --git a/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java b/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java
index e49e1e75a615..b7309aab5dd2 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java
@@ -17,7 +17,7 @@
package com.google.cloud;
import com.google.api.core.InternalApi;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.ImmutableMap;
import java.io.Serializable;
diff --git a/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java b/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java
index 7ee7fb358329..2e9434a0d21d 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java
@@ -17,7 +17,7 @@
package com.google.cloud;
import com.google.api.core.ApiClock;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.retrying.DirectRetryingExecutor;
import com.google.api.gax.retrying.ExponentialRetryAlgorithm;
diff --git a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
index 0db8f08c4d76..0e20848962f9 100644
--- a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
+++ b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java
@@ -23,8 +23,9 @@
import com.google.api.core.ApiClock;
import com.google.api.core.CurrentMillisClock;
+import com.google.api.core.InternalApi;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.auth.Credentials;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.spi.ServiceRpcFactory;
@@ -558,7 +559,8 @@ private void readObject(ObjectInputStream input) throws IOException, ClassNotFou
}
@SuppressWarnings("unchecked")
- static T newInstance(String className) throws IOException, ClassNotFoundException {
+ @InternalApi
+ public static T newInstance(String className) throws IOException, ClassNotFoundException {
try {
return (T) Class.forName(className).newInstance();
} catch (InstantiationException | IllegalAccessException e) {
@@ -599,7 +601,8 @@ protected RetrySettings defaultRetrySettings() {
return getDefaultRetrySettings();
}
- static T getFromServiceLoader(Class extends T> clazz, T defaultInstance) {
+ @InternalApi
+ public static T getFromServiceLoader(Class extends T> clazz, T defaultInstance) {
return Iterables.getFirst(ServiceLoader.load(clazz), defaultInstance);
}
diff --git a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
index 021a694a733e..50f19725c897 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java
@@ -20,7 +20,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
-import com.google.api.gax.core.AsyncPage;
+import com.google.api.gax.paging.AsyncPage;
import com.google.common.collect.ImmutableList;
import org.junit.Test;
diff --git a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
index 7992f9e803d5..80476fdb0345 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java
@@ -26,15 +26,10 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.client.googleapis.json.GoogleJsonError;
+import com.google.cloud.BaseServiceException.ExceptionData;
import com.google.common.collect.ImmutableSet;
-
-import org.junit.Test;
-
-import java.io.IOException;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
import java.util.Set;
+import org.junit.Test;
/**
* Tests for {@link BaseServiceException}.
@@ -45,114 +40,84 @@ public class BaseServiceExceptionTest {
private static final int CODE_NO_REASON = 2;
private static final String MESSAGE = "some message";
private static final String REASON = "some reason";
+ private static final boolean NOT_RETRYABLE = false;
private static final boolean RETRYABLE = true;
private static final boolean IDEMPOTENT = true;
+ private static final String DEBUG_INFO = "debugInfo";
+ private static final String LOCATION = "location";
+
private static class CustomServiceException extends BaseServiceException {
private static final long serialVersionUID = -195251309124875103L;
public CustomServiceException(int code, String message, String reason, boolean idempotent) {
- super(code, message, reason, idempotent);
+ super(ExceptionData.from(code, message, reason,
+ BaseServiceException.isRetryable(code, reason, idempotent, RETRYABLE_ERRORS)));
}
- @Override
- protected Set getRetryableErrors() {
- return ImmutableSet.of(new Error(CODE, REASON), new Error(null, REASON),
- new Error(CODE_NO_REASON, null));
- }
+ private static final Set RETRYABLE_ERRORS = ImmutableSet
+ .of(new Error(CODE, REASON),
+ new Error(null, REASON),
+ new Error(CODE_NO_REASON, null));
}
@Test
public void testBaseServiceException() {
- BaseServiceException serviceException = new BaseServiceException(CODE, MESSAGE, REASON,
- IDEMPOTENT);
+ BaseServiceException serviceException =
+ new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE));
assertEquals(CODE, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertEquals(REASON, serviceException.getReason());
assertFalse(serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
- assertNull(serviceException.getCause());
-
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
- assertEquals(CODE, serviceException.getCode());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertEquals(REASON, serviceException.getReason());
- assertFalse(serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
assertNull(serviceException.getCause());
Exception cause = new RuntimeException();
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, cause);
+ serviceException =
+ new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE, cause));
assertEquals(CODE, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertEquals(REASON, serviceException.getReason());
assertFalse(serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
assertEquals(cause, serviceException.getCause());
- serviceException = new BaseServiceException(CODE, MESSAGE, REASON, false, cause);
+ serviceException =
+ new BaseServiceException(
+ ExceptionData.newBuilder()
+ .setMessage(MESSAGE).setCause(cause).setCode(CODE)
+ .setReason(REASON).setRetryable(RETRYABLE).setDebugInfo(DEBUG_INFO)
+ .setLocation(LOCATION)
+ .build());
assertEquals(CODE, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertEquals(REASON, serviceException.getReason());
- assertFalse(serviceException.isRetryable());
- assertFalse(serviceException.isIdempotent());
- assertEquals(cause, serviceException.getCause());
-
- IOException exception = new SocketTimeoutException();
- serviceException = new BaseServiceException(exception, true);
- assertTrue(serviceException.isRetryable());
- assertTrue(serviceException.isIdempotent());
- assertNull(serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- exception = new SocketException();
- serviceException = new BaseServiceException(exception, true);
assertTrue(serviceException.isRetryable());
- assertTrue(serviceException.isIdempotent());
- assertNull(serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- exception = new IOException("insufficient data written");
- serviceException = new BaseServiceException(exception, true);
- assertTrue(serviceException.isRetryable());
- assertTrue(serviceException.isIdempotent());
- assertEquals("insufficient data written", serviceException.getMessage());
- assertEquals(exception, serviceException.getCause());
-
- GoogleJsonError error = new GoogleJsonError();
- error.setCode(CODE);
- error.setMessage(MESSAGE);
- serviceException = new BaseServiceException(error, true);
- assertEquals(CODE, serviceException.getCode());
- assertEquals(MESSAGE, serviceException.getMessage());
- assertFalse(serviceException.isRetryable());
- assertTrue(serviceException.isIdempotent());
+ assertEquals(cause, serviceException.getCause());
+ assertEquals(DEBUG_INFO, serviceException.getDebugInfo());
+ assertEquals(LOCATION, serviceException.getLocation());
serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
assertEquals(CODE, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertEquals(REASON, serviceException.getReason());
- assertEquals(RETRYABLE, serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
+ assertTrue(serviceException.isRetryable());
serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT);
assertEquals(CODE_NO_REASON, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertNull(serviceException.getReason());
- assertEquals(RETRYABLE, serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
+ assertTrue(serviceException.isRetryable());
serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT);
assertEquals(UNKNOWN_CODE, serviceException.getCode());
assertEquals(MESSAGE, serviceException.getMessage());
assertEquals(REASON, serviceException.getReason());
- assertEquals(RETRYABLE, serviceException.isRetryable());
- assertEquals(IDEMPOTENT, serviceException.isIdempotent());
+ assertTrue(serviceException.isRetryable());
}
@Test
public void testTranslateAndThrow() throws Exception {
- BaseServiceException cause = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT);
+ BaseServiceException cause =
+ new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE));
RetryHelper.RetryHelperException exceptionMock =
createMock(RetryHelper.RetryHelperException.class);
expect(exceptionMock.getCause()).andReturn(cause).times(2);
@@ -163,7 +128,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(CODE, ex.getCode());
assertEquals(MESSAGE, ex.getMessage());
assertFalse(ex.isRetryable());
- assertEquals(IDEMPOTENT, ex.isIdempotent());
} finally {
verify(exceptionMock);
}
diff --git a/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java b/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java
index 8fb26bc8ce36..3ce49a8e6fff 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java
@@ -21,6 +21,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import com.google.cloud.BaseServiceException.ExceptionData;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
@@ -64,7 +65,8 @@ public void testError() {
} catch (NullPointerException exc) {
// expected
}
- BaseServiceException ex = new BaseServiceException(0, "message", "reason", false);
+ BaseServiceException ex =
+ new BaseServiceException(ExceptionData.from(0, "message", "reason", false));
result.error(ex);
try {
result.get();
@@ -76,7 +78,8 @@ public void testError() {
@Test
public void testNotifyError() {
- final BaseServiceException ex = new BaseServiceException(0, "message", "reason", false);
+ final BaseServiceException ex =
+ new BaseServiceException(ExceptionData.from(0, "message", "reason", false));
assertFalse(result.completed());
BatchResult.Callback callback =
EasyMock.createStrictMock(BatchResult.Callback.class);
diff --git a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
index a5ffadf4d6eb..2193981ae8ea 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java
@@ -18,7 +18,7 @@
import static org.junit.Assert.assertEquals;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.common.collect.ImmutableList;
import org.junit.Test;
diff --git a/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java b/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java
index 11bdae8b2807..11f2dc1eebcb 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java
@@ -16,7 +16,8 @@
package com.google.cloud;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.cloud.BaseServiceException.ExceptionData;
import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor;
import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor.ValueType;
import com.google.common.collect.ImmutableList;
@@ -28,7 +29,7 @@
public class SerializationTest extends BaseSerializationTest {
private static final BaseServiceException BASE_SERVICE_EXCEPTION =
- new BaseServiceException(42, "message", "reason", true);
+ new BaseServiceException(ExceptionData.from(42, "message", "reason", false));
private static final ExceptionHandler EXCEPTION_HANDLER = ExceptionHandler.getDefaultInstance();
private static final Identity IDENTITY = Identity.allAuthenticatedUsers();
private static final PageImpl PAGE =
diff --git a/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java
index e7f3a451580e..7abfc8a49baa 100644
--- a/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java
+++ b/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java
@@ -186,7 +186,7 @@ public TestServiceRpcFactory getDefaultRpcFactory() {
@Override
public TransportOptions getDefaultTransportOptions() {
- return HttpTransportOptions.newBuilder().build();
+ return new TransportOptions() {};
}
}
diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml
index fda4ae05f8ae..d684e1a04362 100644
--- a/google-cloud-datastore/pom.xml
+++ b/google-cloud-datastore/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.cloud.datastore
datastore-v1-protos
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java
index 739d87ec002e..5f8d585b7029 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java
@@ -18,8 +18,8 @@
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
@@ -29,7 +29,7 @@
* @see Google Cloud
* Datastore error codes
*/
-public final class DatastoreException extends BaseServiceException {
+public final class DatastoreException extends BaseHttpServiceException {
// see https://cloud.google.com/datastore/docs/concepts/errors#Error_Codes"
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(
@@ -43,21 +43,16 @@ public DatastoreException(int code, String message, String reason) {
}
public DatastoreException(int code, String message, String reason, Throwable cause) {
- super(code, message, reason, true, cause);
+ super(code, message, reason, true, RETRYABLE_ERRORS, cause);
}
public DatastoreException(int code, String message, String reason, boolean idempotent,
Throwable cause) {
- super(code, message, reason, idempotent, cause);
+ super(code, message, reason, idempotent, RETRYABLE_ERRORS, cause);
}
public DatastoreException(IOException exception) {
- super(exception, true);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(exception, true, RETRYABLE_ERRORS);
}
/**
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java
index 65b0a94025e2..216647dc27c7 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreImpl.java
@@ -16,7 +16,7 @@
package com.google.cloud.datastore;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.BaseService;
import com.google.cloud.ExceptionHandler;
import com.google.cloud.RetryHelper;
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
index 75ac99473abc..10a127e770b0 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
@@ -18,7 +18,7 @@
import static com.google.cloud.datastore.Validator.validateNamespace;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/HttpDatastoreRpc.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/HttpDatastoreRpc.java
index 2d7fb437155e..da294dd011b5 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/HttpDatastoreRpc.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/HttpDatastoreRpc.java
@@ -19,7 +19,7 @@
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.datastore.DatastoreException;
import com.google.cloud.datastore.DatastoreOptions;
import com.google.datastore.v1.AllocateIdsRequest;
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
index 10b4fa98de2c..d53fd52d95e2 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/RemoteDatastoreHelper.java
@@ -16,9 +16,9 @@
package com.google.cloud.datastore.testing;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.api.core.InternalApi;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.datastore.Datastore;
import com.google.cloud.datastore.DatastoreOptions;
import com.google.cloud.datastore.Key;
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreExceptionTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreExceptionTest.java
index 63691d9d3e71..15b77825f8c9 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreExceptionTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreExceptionTest.java
@@ -44,28 +44,24 @@ public void testDatastoreException() throws Exception {
assertEquals("ABORTED", exception.getReason());
assertEquals("message", exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new DatastoreException(4, "message", "DEADLINE_EXCEEDED");
assertEquals(4, exception.getCode());
assertEquals("DEADLINE_EXCEEDED", exception.getReason());
assertEquals("message", exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new DatastoreException(14, "message", "UNAVAILABLE");
assertEquals(14, exception.getCode());
assertEquals("UNAVAILABLE", exception.getReason());
assertEquals("message", exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new DatastoreException(2, "message", "INTERNAL");
assertEquals(2, exception.getCode());
assertEquals("INTERNAL", exception.getReason());
assertEquals("message", exception.getMessage());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException("socketTimeoutMessage");
exception = new DatastoreException(cause);
@@ -74,7 +70,6 @@ public void testDatastoreException() throws Exception {
assertEquals("socketTimeoutMessage", exception.getMessage());
assertEquals(cause, exception.getCause());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DatastoreException(2, "message", "INTERNAL", cause);
@@ -82,7 +77,6 @@ public void testDatastoreException() throws Exception {
assertEquals("INTERNAL", exception.getReason());
assertEquals("message", exception.getMessage());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
}
@@ -99,7 +93,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(14, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -114,7 +107,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(DatastoreException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
index 7b32fbf7f518..a79e9ca840f1 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
@@ -20,10 +20,9 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import com.google.cloud.GrpcTransportOptions;
-import com.google.cloud.datastore.spi.v1.DatastoreRpc;
+import com.google.cloud.TransportOptions;
import com.google.cloud.datastore.spi.DatastoreRpcFactory;
-
+import com.google.cloud.datastore.spi.v1.DatastoreRpc;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Rule;
@@ -90,6 +89,6 @@ public void testToBuilder() throws Exception {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- DatastoreOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ DatastoreOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-dns/pom.xml b/google-cloud-dns/pom.xml
index 2ef8bd67887f..de67a5575b14 100644
--- a/google-cloud-dns/pom.xml
+++ b/google-cloud-dns/pom.xml
@@ -26,6 +26,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.apis
google-api-services-dns
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java
index 8da867fb8b52..7bbfe1a91ebc 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java
@@ -18,7 +18,7 @@
import com.google.cloud.FieldSelector;
import com.google.cloud.FieldSelector.Helper;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Service;
import com.google.cloud.dns.spi.v1.DnsRpc;
import com.google.common.collect.ImmutableList;
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java
index 84ab7a71a6fc..624e6ee2aed0 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java
@@ -26,7 +26,7 @@
import com.google.api.services.dns.model.Project;
import com.google.api.services.dns.model.ResourceRecordSet;
import com.google.api.services.dns.model.ResourceRecordSetsListResponse;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.dns.spi.v1.DnsRpc;
import com.google.cloud.dns.spi.v1.RpcBatch;
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsException.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsException.java
index 8a06c8b98529..a049ba157e8f 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsException.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsException.java
@@ -19,15 +19,15 @@
import com.google.api.client.googleapis.json.GoogleJsonError;
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
/**
* DNS service exception.
*/
-public final class DnsException extends BaseServiceException {
+public final class DnsException extends BaseHttpServiceException {
// see: https://cloud.google.com/dns/troubleshooting
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(
@@ -40,20 +40,15 @@ public final class DnsException extends BaseServiceException {
private static final long serialVersionUID = 490302380416260252L;
public DnsException(IOException exception, boolean idempotent) {
- super(exception, idempotent);
+ super(exception, idempotent, RETRYABLE_ERRORS);
}
public DnsException(GoogleJsonError error, boolean idempotent) {
- super(error, idempotent);
+ super(error, idempotent, RETRYABLE_ERRORS);
}
public DnsException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
}
/**
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java
index 55e7403a505d..d3656d3659e1 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java
@@ -24,7 +24,7 @@
import com.google.api.services.dns.model.Project;
import com.google.api.services.dns.model.ResourceRecordSet;
import com.google.cloud.BaseService;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.RetryHelper;
import com.google.cloud.dns.spi.v1.DnsRpc;
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java
index 7a187f006d23..c2d448b6e64b 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.dns;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java
index 37afd01bc602..dbd5329bf810 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java
@@ -19,7 +19,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.api.services.dns.model.ManagedZone;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import java.io.IOException;
import java.io.ObjectInputStream;
diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/spi/v1/HttpDnsRpc.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/spi/v1/HttpDnsRpc.java
index 9b2bcfab3e2d..c89ef17a17f7 100644
--- a/google-cloud-dns/src/main/java/com/google/cloud/dns/spi/v1/HttpDnsRpc.java
+++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/spi/v1/HttpDnsRpc.java
@@ -33,7 +33,7 @@
import com.google.api.services.dns.model.Project;
import com.google.api.services.dns.model.ResourceRecordSet;
import com.google.api.services.dns.model.ResourceRecordSetsListResponse;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.dns.DnsException;
import com.google.cloud.dns.DnsOptions;
import java.io.IOException;
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsBatchTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsBatchTest.java
index 79d0362e5aac..fe239b6e9aa6 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsBatchTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsBatchTest.java
@@ -32,7 +32,7 @@
import com.google.api.services.dns.model.Project;
import com.google.api.services.dns.model.ResourceRecordSet;
import com.google.api.services.dns.model.ResourceRecordSetsListResponse;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.dns.spi.v1.DnsRpc;
import com.google.cloud.dns.spi.v1.RpcBatch;
import com.google.common.collect.ImmutableList;
@@ -150,7 +150,6 @@ public void testListZones() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -227,7 +226,6 @@ public void testCreateZone() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -278,7 +276,6 @@ public void testGetZone() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -341,7 +338,6 @@ public void testDeleteZone() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertFalse(ex.isIdempotent());
}
}
@@ -383,7 +379,6 @@ public void testGetProject() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -428,7 +423,6 @@ public void testListRecordSets() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -497,7 +491,6 @@ public void testListChangeRequests() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -574,7 +567,6 @@ public void testGetChangeRequest() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertTrue(ex.isIdempotent());
}
}
@@ -652,7 +644,6 @@ public void testApplyChangeRequest() {
fail("Should throw a DnsException on error.");
} catch (DnsException ex) {
// expected
- assertFalse(ex.isIdempotent());
}
}
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsExceptionTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsExceptionTest.java
index 7da8bac8d090..f133ca9a79ee 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsExceptionTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsExceptionTest.java
@@ -45,7 +45,6 @@ public void testDnsException() throws Exception {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DnsException(502, "message", cause);
@@ -53,7 +52,6 @@ public void testDnsException() throws Exception {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DnsException(503, "message", cause);
@@ -61,7 +59,6 @@ public void testDnsException() throws Exception {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DnsException(429, "message", cause);
@@ -69,7 +66,6 @@ public void testDnsException() throws Exception {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DnsException(404, "message", cause);
@@ -77,7 +73,6 @@ public void testDnsException() throws Exception {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new DnsException(cause, true);
@@ -86,7 +81,6 @@ public void testDnsException() throws Exception {
assertEquals("socketTimeoutMessage", exception.getMessage());
assertEquals(cause, exception.getCause());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
GoogleJsonError error = new GoogleJsonError();
@@ -96,7 +90,6 @@ public void testDnsException() throws Exception {
assertEquals(503, exception.getCode());
assertEquals("message", exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
}
@Test
@@ -114,7 +107,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals("message", ex.getMessage());
assertEquals(timeoutException, ex.getCause());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -129,7 +121,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(DnsException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsImplTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsImplTest.java
index 4d8ac749b25e..59959ab75607 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsImplTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsImplTest.java
@@ -23,7 +23,7 @@
import com.google.api.services.dns.model.Change;
import com.google.api.services.dns.model.ManagedZone;
import com.google.api.services.dns.model.ResourceRecordSet;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.ServiceOptions;
import com.google.cloud.dns.spi.v1.DnsRpc;
import com.google.cloud.dns.spi.DnsRpcFactory;
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsOptionsTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsOptionsTest.java
index 1d29dd394679..02f7f4759f45 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsOptionsTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/DnsOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.dns;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,7 +29,7 @@ public class DnsOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- DnsOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ DnsOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java
index 3477ba5223a6..b60b8beb3d75 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java
@@ -30,7 +30,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.common.collect.ImmutableList;
import org.junit.After;
diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/it/ITDnsTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/it/ITDnsTest.java
index 64027431fcc3..93d4a945bf3c 100644
--- a/google-cloud-dns/src/test/java/com/google/cloud/dns/it/ITDnsTest.java
+++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/it/ITDnsTest.java
@@ -23,7 +23,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.dns.ChangeRequest;
import com.google.cloud.dns.ChangeRequestInfo;
import com.google.cloud.dns.Dns;
diff --git a/google-cloud-errorreporting/pom.xml b/google-cloud-errorreporting/pom.xml
index e1b604f6823e..e855d30281ef 100644
--- a/google-cloud-errorreporting/pom.xml
+++ b/google-cloud-errorreporting/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-error-reporting-v1beta1
diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java
index d9957280cd12..58eb1b714563 100644
--- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java
+++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java
index 2a19501bcff6..227195e71bbe 100644
--- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java
+++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java
@@ -21,7 +21,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java
index 0345a85d1b43..c8511f6ff080 100644
--- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java
+++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java
index dc0f7a6d6d5f..227c0dac1765 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java
@@ -16,8 +16,8 @@
package com.google.cloud.errorreporting.spi.v1beta1;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup;
import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest;
import com.google.devtools.clouderrorreporting.v1beta1.GroupName;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java
index bfd56e754cb0..85b40fb15a37 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java
@@ -19,8 +19,8 @@
import static com.google.cloud.errorreporting.spi.v1beta1.PagedResponseWrappers.ListGroupStatsPagedResponse;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsRequest;
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java
index 089090bcd822..19d5b86de1a1 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.errorreporting.spi.v1beta1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java
index 2f9077117529..737b4d67ae74 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.errorreporting.spi.v1beta1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java
index f2c634bebb56..7da1f11a4c9c 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.errorreporting.spi.v1beta1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java
index 93a5d3524b58..d4f8752b9195 100644
--- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java
+++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java
@@ -16,8 +16,8 @@
package com.google.cloud.errorreporting.spi.v1beta1;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.devtools.clouderrorreporting.v1beta1.ProjectName;
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest;
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java
index dffe5728f1d9..aedea209bc3a 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java
@@ -23,7 +23,7 @@
package com.google.cloud.examples.bigquery.snippets;
import com.google.api.client.util.Charsets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption;
import com.google.cloud.bigquery.BigQuery.DatasetListOption;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/DatasetSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/DatasetSnippets.java
index 1d3725799580..b05ccfd8f31f 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/DatasetSnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/DatasetSnippets.java
@@ -22,7 +22,7 @@
package com.google.cloud.examples.bigquery.snippets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.Dataset;
import com.google.cloud.bigquery.Dataset.Builder;
import com.google.cloud.bigquery.Field;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/TableSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/TableSnippets.java
index d84bdee9865d..ea6ad8dc4b53 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/TableSnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/TableSnippets.java
@@ -22,7 +22,7 @@
package com.google.cloud.examples.bigquery.snippets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.WaitForOption;
import com.google.cloud.bigquery.BigQuery.JobField;
import com.google.cloud.bigquery.BigQuery.JobOption;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java
index 3fb235278aab..9e7291a0b6c1 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java
@@ -16,7 +16,7 @@
package com.google.cloud.examples.compute;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.compute.Address;
import com.google.cloud.compute.AddressId;
import com.google.cloud.compute.AddressInfo;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java
index be1e5009e72f..cdc6625d528a 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/dns/snippets/ManipulateZonesAndRecordSets.java
@@ -22,7 +22,7 @@
package com.google.cloud.examples.dns.snippets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.dns.ChangeRequest;
import com.google.cloud.dns.ChangeRequestInfo;
import com.google.cloud.dns.Dns;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/LoggingExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/LoggingExample.java
index f774fd38ec94..d9304f53ac6f 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/LoggingExample.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/LoggingExample.java
@@ -16,7 +16,7 @@
package com.google.cloud.examples.logging;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
import com.google.cloud.logging.LogEntry;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListMetrics.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListMetrics.java
index 491d366cfcc3..3dbc22f49d45 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListMetrics.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListMetrics.java
@@ -16,7 +16,7 @@
package com.google.cloud.examples.logging.snippets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.logging.Logging;
import com.google.cloud.logging.LoggingOptions;
import com.google.cloud.logging.Metric;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListSinks.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListSinks.java
index 36fcb9b776d5..3a80c27cacb6 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListSinks.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListSinks.java
@@ -16,7 +16,7 @@
package com.google.cloud.examples.logging.snippets;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.logging.Logging;
import com.google.cloud.logging.LoggingOptions;
import com.google.cloud.logging.Sink;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java
index e9b32ed888fd..d623a0368bad 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java
@@ -22,10 +22,10 @@
package com.google.cloud.examples.logging.snippets;
-import com.google.api.gax.core.AsyncPage;
+import com.google.api.gax.paging.AsyncPage;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.logging.LogEntry;
import com.google.cloud.logging.Logging;
import com.google.cloud.logging.Logging.EntryListOption;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/WriteAndListLogEntries.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/WriteAndListLogEntries.java
index ef1cd586ff55..46ea6d82f2e4 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/WriteAndListLogEntries.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/WriteAndListLogEntries.java
@@ -17,7 +17,7 @@
package com.google.cloud.examples.logging.snippets;
import com.google.cloud.MonitoredResource;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.logging.LogEntry;
import com.google.cloud.logging.Logging;
import com.google.cloud.logging.Logging.EntryListOption;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java
index 6ce7254e63b3..51102c668a89 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java
@@ -24,7 +24,7 @@
import static java.nio.charset.StandardCharsets.UTF_8;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Acl;
import com.google.cloud.storage.Acl.User;
import com.google.cloud.storage.Blob;
diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java
index 9833d54a0aad..c8b2bfd3afb7 100644
--- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java
+++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java
@@ -27,7 +27,7 @@
import com.google.auth.ServiceAccountSigner;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.BatchResult;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.ReadChannel;
import com.google.cloud.WriteChannel;
import com.google.cloud.storage.Acl;
diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITBigQuerySnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITBigQuerySnippets.java
index 896d71f020c2..48bbdf084cf3 100644
--- a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITBigQuerySnippets.java
+++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITBigQuerySnippets.java
@@ -22,7 +22,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption;
import com.google.cloud.bigquery.Dataset;
diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITDatasetSnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITDatasetSnippets.java
index 38d372f70881..83619a6a936f 100644
--- a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITDatasetSnippets.java
+++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITDatasetSnippets.java
@@ -22,7 +22,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption;
import com.google.cloud.bigquery.Dataset;
diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITTableSnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITTableSnippets.java
index f145b0222772..50ab1be4cbf0 100644
--- a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITTableSnippets.java
+++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITTableSnippets.java
@@ -22,7 +22,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQuery.TableDataListOption;
import com.google.cloud.bigquery.BigQuery.TableField;
diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/storage/snippets/ITStorageSnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/storage/snippets/ITStorageSnippets.java
index b13cb2d909ff..e86154749d16 100644
--- a/google-cloud-examples/src/test/java/com/google/cloud/examples/storage/snippets/ITStorageSnippets.java
+++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/storage/snippets/ITStorageSnippets.java
@@ -25,7 +25,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Acl;
import com.google.cloud.storage.Acl.Role;
import com.google.cloud.storage.Acl.User;
diff --git a/google-cloud-language/pom.xml b/google-cloud-language/pom.xml
index f6bfa0d4a706..4612b78d0252 100644
--- a/google-cloud-language/pom.xml
+++ b/google-cloud-language/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-language-v1
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java
index 4280c9977030..3f2b4f64a340 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta2/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta2/LanguageServiceSettings.java
index 5d7513a91353..c7256038c303 100644
--- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta2/LanguageServiceSettings.java
+++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta2/LanguageServiceSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java
index 3d7fe8efa52d..af4ec6289444 100644
--- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java
+++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java
@@ -16,8 +16,8 @@
package com.google.cloud.language.spi.v1;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.cloud.language.v1.AnalyzeEntitiesRequest;
import com.google.cloud.language.v1.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1.AnalyzeSentimentRequest;
diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java
index 4adb439dbef5..9795fb7393cc 100644
--- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java
+++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.language.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/LanguageServiceClientTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/LanguageServiceClientTest.java
index b0c4c5969c4b..e54470857125 100644
--- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/LanguageServiceClientTest.java
+++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/LanguageServiceClientTest.java
@@ -16,8 +16,8 @@
package com.google.cloud.language.spi.v1beta2;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.cloud.language.v1beta2.AnalyzeEntitiesRequest;
import com.google.cloud.language.v1beta2.AnalyzeEntitiesResponse;
import com.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest;
diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/MockLanguageService.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/MockLanguageService.java
index e3e4b89cb978..2ed8e069f061 100644
--- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/MockLanguageService.java
+++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta2/MockLanguageService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.language.spi.v1beta2;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-logging/pom.xml b/google-cloud-logging/pom.xml
index 53a1254a3ca1..0e7fcf2c233b 100644
--- a/google-cloud-logging/pom.xml
+++ b/google-cloud-logging/pom.xml
@@ -29,6 +29,15 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
+
+ com.google.api
+ gax-grpc
+
com.google.api.grpc
grpc-google-cloud-logging-v2
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java
index 562728cae901..cfd18384e43d 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java
@@ -17,10 +17,10 @@
package com.google.cloud.logging;
import com.google.api.core.ApiFuture;
-import com.google.api.gax.core.AsyncPage;
+import com.google.api.gax.paging.AsyncPage;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Service;
import com.google.common.collect.ImmutableMap;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java
index 54aa9ae2badf..852c9cc40678 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java
@@ -17,15 +17,13 @@
package com.google.cloud.logging;
import com.google.api.gax.grpc.ApiException;
-import com.google.cloud.BaseServiceException;
-
+import com.google.cloud.grpc.BaseGrpcServiceException;
import java.io.IOException;
-import java.util.Set;
/**
* Logging service exception.
*/
-public final class LoggingException extends BaseServiceException {
+public final class LoggingException extends BaseGrpcServiceException {
private static final long serialVersionUID = 449689219311927047L;
@@ -33,12 +31,7 @@ public LoggingException(IOException ex, boolean idempotent) {
super(ex, idempotent);
}
- public LoggingException(ApiException apiException, boolean idempotent) {
- super(apiException, idempotent);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return null;
+ public LoggingException(ApiException apiException) {
+ super(apiException);
}
}
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java
index 309bffefcaef..78e5c32c4796 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java
@@ -29,12 +29,12 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
-import com.google.api.gax.core.AsyncPage;
+import com.google.api.gax.paging.AsyncPage;
import com.google.cloud.AsyncPageImpl;
import com.google.cloud.BaseService;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.logging.spi.v2.LoggingRpc;
import com.google.common.base.Function;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java
index feb7cdcacac7..074c09b696d7 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.logging;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.grpc.GrpcTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigSettings.java
index e819db077bf7..8bd5243dbc33 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigSettings.java
@@ -20,7 +20,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java
index d32b6d385e90..eb262cfb2599 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java
@@ -26,8 +26,8 @@
import com.google.api.gax.grpc.FixedExecutorProvider;
import com.google.api.gax.grpc.ProviderManager;
import com.google.api.gax.grpc.UnaryCallSettings;
-import com.google.cloud.GrpcTransportOptions;
-import com.google.cloud.GrpcTransportOptions.ExecutorFactory;
+import com.google.cloud.grpc.GrpcTransportOptions;
+import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
import com.google.cloud.NoCredentials;
import com.google.cloud.logging.LoggingException;
import com.google.cloud.logging.LoggingOptions;
@@ -138,7 +138,7 @@ public V apply(ApiException exception) {
if (returnNullOnSet.contains(exception.getStatusCode())) {
return null;
}
- throw new LoggingException(exception, idempotent);
+ throw new LoggingException(exception);
}
});
}
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingSettings.java
index 0f620065ff64..e9da4290d6d7 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingSettings.java
@@ -24,11 +24,11 @@
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.batching.PartitionKey;
import com.google.api.gax.batching.RequestBuilder;
-import com.google.api.gax.core.FlowControlSettings;
-import com.google.api.gax.core.FlowController.LimitExceededBehavior;
+import com.google.api.gax.batching.FlowControlSettings;
+import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.BatchedRequestIssuer;
import com.google.api.gax.grpc.BatchingCallSettings;
import com.google.api.gax.grpc.BatchingDescriptor;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsSettings.java
index ce922b31e044..7450bbbb96b8 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsSettings.java
@@ -20,7 +20,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java
index 0b654be54123..b0bf7edb86a3 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java
@@ -17,8 +17,8 @@
package com.google.cloud.logging.testing;
import com.google.auth.oauth2.ServiceAccountCredentials;
-import com.google.cloud.GrpcTransportOptions;
-import com.google.api.gax.core.RetrySettings;
+import com.google.cloud.grpc.GrpcTransportOptions;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.logging.LoggingOptions;
import java.io.IOException;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java
index 75f394572a70..0c91c861b275 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java
@@ -22,8 +22,8 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.AsyncPage;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.AsyncPage;
+import com.google.api.gax.paging.Page;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
import com.google.cloud.logging.Logging.EntryListOption;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java
index 3b572b473559..fd1f982ba725 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java
@@ -27,10 +27,10 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.SettableApiFuture;
-import com.google.api.gax.core.AsyncPage;
+import com.google.api.gax.paging.AsyncPage;
import com.google.cloud.MonitoredResource;
import com.google.cloud.MonitoredResourceDescriptor;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.ServiceOptions;
import com.google.cloud.logging.Logging.EntryListOption;
import com.google.cloud.logging.Logging.ListOption;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingOptionsTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingOptionsTest.java
index 588c9c4c35dc..4c01aec6157c 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingOptionsTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.logging;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,7 +29,7 @@ public class LoggingOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- LoggingOptions.newBuilder().setTransportOptions(HttpTransportOptions.newBuilder().build());
+ LoggingOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/SerializationTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/SerializationTest.java
index 297e0c928827..6d012503f550 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/SerializationTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/SerializationTest.java
@@ -17,7 +17,7 @@
package com.google.cloud.logging;
import com.google.cloud.BaseSerializationTest;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.grpc.GrpcTransportOptions;
import com.google.cloud.MonitoredResource;
import com.google.cloud.NoCredentials;
import com.google.cloud.Restorable;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java
index 377901cfe6c1..445c081f4cfc 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java
@@ -18,8 +18,8 @@
import static com.google.cloud.logging.spi.v2.PagedResponseWrappers.ListSinksPagedResponse;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.api.resourcenames.ResourceName;
import com.google.common.collect.Lists;
import com.google.logging.v2.CreateSinkRequest;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java
index f7b67047d457..c3a4daa939ee 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java
@@ -20,8 +20,8 @@
import com.google.api.MonitoredResource;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.logging.v2.DeleteLogRequest;
import com.google.logging.v2.ListLogEntriesRequest;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java
index 766ad0319a76..fb27df8555df 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java
@@ -18,8 +18,8 @@
import static com.google.cloud.logging.spi.v2.PagedResponseWrappers.ListLogMetricsPagedResponse;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.logging.v2.CreateLogMetricRequest;
import com.google.logging.v2.DeleteLogMetricRequest;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java
index 77bc3e75cbc7..26790ffd2211 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.logging.spi.v2;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java
index bec8a7526b10..e2868bb37cc0 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.logging.spi.v2;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java
index 1bdc6ff0f4be..c40b1845cc54 100644
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java
+++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.logging.spi.v2;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-monitoring/pom.xml b/google-cloud-monitoring/pom.xml
index f9ac710577e3..78103f2961ec 100644
--- a/google-cloud-monitoring/pom.xml
+++ b/google-cloud-monitoring/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-monitoring-v3
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java
index a5ba6c5cde24..60c35d0c066e 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java
@@ -22,7 +22,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java
index bdc30551a7d6..d0febb702d36 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java
@@ -24,7 +24,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java
index 497d4cee827f..800c08ebbd57 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java
@@ -19,8 +19,8 @@
import com.google.api.MonitoredResource;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.monitoring.v3.CreateGroupRequest;
import com.google.monitoring.v3.DeleteGroupRequest;
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java
index 27bae083fba1..31e775a4f202 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java
@@ -22,8 +22,8 @@
import com.google.api.MetricDescriptor;
import com.google.api.MonitoredResourceDescriptor;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.monitoring.v3.CreateMetricDescriptorRequest;
import com.google.monitoring.v3.CreateTimeSeriesRequest;
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java
index f92f815cad23..9ed06a88d1c7 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.monitoring.spi.v3;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java
index 004db5a4cbc5..ede4735cb8b9 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.monitoring.spi.v3;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-pubsub/pom.xml b/google-cloud-pubsub/pom.xml
index a17e2b015a05..53fd79e39241 100644
--- a/google-cloud-pubsub/pom.xml
+++ b/google-cloud-pubsub/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-pubsub-v1
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java
index 5e8eb411b0ba..e7d583db9085 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java
@@ -17,10 +17,10 @@
package com.google.cloud.pubsub.spi.v1;
import com.google.api.core.ApiClock;
-import com.google.api.gax.core.FlowController;
-import com.google.api.gax.core.FlowController.FlowControlException;
+import com.google.api.gax.core.Distribution;
+import com.google.api.gax.batching.FlowController;
+import com.google.api.gax.batching.FlowController.FlowControlException;
import com.google.api.gax.grpc.InstantiatingExecutorProvider;
-import com.google.api.stats.Distribution;
import com.google.cloud.pubsub.spi.v1.MessageDispatcher.OutstandingMessagesBatch.OutstandingMessage;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
index 65bf82f2603f..b3b78f20c658 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
@@ -18,8 +18,8 @@
import com.google.api.core.AbstractApiService;
import com.google.api.core.ApiClock;
-import com.google.api.gax.core.FlowController;
-import com.google.api.stats.Distribution;
+import com.google.api.gax.batching.FlowController;
+import com.google.api.gax.core.Distribution;
import com.google.cloud.pubsub.spi.v1.MessageDispatcher.AckProcessor;
import com.google.cloud.pubsub.spi.v1.MessageDispatcher.PendingModifyAckDeadline;
import com.google.common.collect.Lists;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
index 2251510fe39d..5426dd62af5f 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
@@ -19,9 +19,9 @@
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
-import com.google.api.gax.core.FlowControlSettings;
-import com.google.api.gax.core.FlowController;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.batching.FlowControlSettings;
+import com.google.api.gax.batching.FlowController;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.core.SettableApiFuture;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java
index b8cd7e042432..feedd69a970e 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java
@@ -18,8 +18,8 @@
import com.google.api.core.AbstractApiService;
import com.google.api.core.ApiClock;
-import com.google.api.gax.core.FlowController;
-import com.google.api.stats.Distribution;
+import com.google.api.gax.batching.FlowController;
+import com.google.api.gax.core.Distribution;
import com.google.cloud.pubsub.spi.v1.MessageDispatcher.AckProcessor;
import com.google.cloud.pubsub.spi.v1.MessageDispatcher.PendingModifyAckDeadline;
import com.google.common.annotations.VisibleForTesting;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java
index 9d14c1bbeee3..2eb6bc025e8d 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java
@@ -20,13 +20,13 @@
import com.google.api.core.ApiClock;
import com.google.api.core.ApiService;
import com.google.api.core.CurrentMillisClock;
-import com.google.api.gax.core.FlowControlSettings;
-import com.google.api.gax.core.FlowController;
+import com.google.api.gax.batching.FlowControlSettings;
+import com.google.api.gax.batching.FlowController;
+import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
+import com.google.api.gax.core.Distribution;
import com.google.api.gax.grpc.ChannelProvider;
-import com.google.api.gax.core.FlowController.LimitExceededBehavior;
import com.google.api.gax.grpc.ExecutorProvider;
import com.google.api.gax.grpc.InstantiatingExecutorProvider;
-import com.google.api.stats.Distribution;
import com.google.auth.Credentials;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.annotations.VisibleForTesting;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminSettings.java
index e4d642be0326..1f008fd8a7ff 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminSettings.java
@@ -21,7 +21,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/TopicAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/TopicAdminSettings.java
index e2096cbb2423..9ddf444985fa 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/TopicAdminSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/TopicAdminSettings.java
@@ -22,11 +22,11 @@
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.gax.batching.PartitionKey;
import com.google.api.gax.batching.RequestBuilder;
-import com.google.api.gax.core.FlowControlSettings;
-import com.google.api.gax.core.FlowController.LimitExceededBehavior;
+import com.google.api.gax.batching.FlowControlSettings;
+import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.BatchedRequestIssuer;
import com.google.api.gax.grpc.BatchingCallSettings;
import com.google.api.gax.grpc.BatchingDescriptor;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java
index 5a61c6e0414f..628b6f511109 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.pubsub.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java
index 8f30e5e3371a..7052c4cd1188 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.pubsub.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java
index 25606da6b1f9..19afb5b6fe4e 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.pubsub.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherImplTest.java
index 9a11993120b5..80c61b1ecf02 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherImplTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherImplTest.java
@@ -23,8 +23,8 @@
import com.google.api.gax.batching.BatchingSettings;
import com.google.api.core.ApiFuture;
-import com.google.api.gax.core.FlowControlSettings;
-import com.google.api.gax.core.FlowController.LimitExceededBehavior;
+import com.google.api.gax.batching.FlowControlSettings;
+import com.google.api.gax.batching.FlowController.LimitExceededBehavior;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ExecutorProvider;
import com.google.api.gax.grpc.FixedExecutorProvider;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminClientTest.java
index eb2f7b13599e..27f481a3551e 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminClientTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriptionAdminClientTest.java
@@ -18,12 +18,12 @@
import static com.google.cloud.pubsub.spi.v1.PagedResponseWrappers.ListSnapshotsPagedResponse;
import static com.google.cloud.pubsub.spi.v1.PagedResponseWrappers.ListSubscriptionsPagedResponse;
-import com.google.api.gax.core.ApiStreamObserver;
+import com.google.api.gax.grpc.ApiStreamObserver;
import com.google.api.gax.grpc.ApiException;
import com.google.api.gax.grpc.StreamingCallable;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
-import com.google.api.gax.testing.MockStreamObserver;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockStreamObserver;
import com.google.common.collect.Lists;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/TopicAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/TopicAdminClientTest.java
index 8db6bc9800a3..1ecda925ef81 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/TopicAdminClientTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/TopicAdminClientTest.java
@@ -19,8 +19,8 @@
import static com.google.cloud.pubsub.spi.v1.PagedResponseWrappers.ListTopicsPagedResponse;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
diff --git a/google-cloud-resourcemanager/pom.xml b/google-cloud-resourcemanager/pom.xml
index 9d443632c4d3..b07dfc5917b5 100644
--- a/google-cloud-resourcemanager/pom.xml
+++ b/google-cloud-resourcemanager/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.apis
google-api-services-cloudresourcemanager
diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
index 71237a210945..977e54836440 100644
--- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
+++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
@@ -18,7 +18,7 @@
import com.google.cloud.FieldSelector;
import com.google.cloud.FieldSelector.Helper;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Policy;
import com.google.cloud.Service;
import com.google.cloud.resourcemanager.spi.v1beta1.ResourceManagerRpc;
diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
index 97165cacfe7a..4dec1a243ff8 100644
--- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
+++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
@@ -18,8 +18,8 @@
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
@@ -29,7 +29,7 @@
* @see Google Cloud
* Resource Manager error codes
*/
-public final class ResourceManagerException extends BaseServiceException {
+public final class ResourceManagerException extends BaseHttpServiceException {
// see https://cloud.google.com/resource-manager/v1/errors/core_errors
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(
@@ -51,16 +51,11 @@ public ResourceManagerException(int code, String message) {
}
public ResourceManagerException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
}
public ResourceManagerException(IOException exception) {
- super(exception, true);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(exception, true, RETRYABLE_ERRORS);
}
/**
diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
index 2fd581c9c746..65e05f51d9b6 100644
--- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
+++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
@@ -20,7 +20,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import com.google.cloud.BaseService;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.PageImpl.NextPageFetcher;
import com.google.cloud.Policy;
diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java
index 66c832a290c6..38acb91d52aa 100644
--- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java
+++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.resourcemanager;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.java
index 08ff101ab5f4..2db5acde3420 100644
--- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.java
+++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.java
@@ -31,7 +31,7 @@
import com.google.api.services.cloudresourcemanager.model.SetIamPolicyRequest;
import com.google.api.services.cloudresourcemanager.model.TestIamPermissionsRequest;
import com.google.api.services.cloudresourcemanager.model.TestIamPermissionsResponse;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.resourcemanager.ResourceManagerException;
import com.google.cloud.resourcemanager.ResourceManagerOptions;
import com.google.common.collect.ImmutableList;
diff --git a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerExceptionTest.java b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerExceptionTest.java
index 2f32c3b03ed5..7d409b259ed2 100644
--- a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerExceptionTest.java
+++ b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerExceptionTest.java
@@ -43,35 +43,30 @@ public void testResourceManagerException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new ResourceManagerException(503, "message");
assertEquals(503, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new ResourceManagerException(429, "message");
assertEquals(429, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new ResourceManagerException(403, "message");
assertEquals(403, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException();
exception = new ResourceManagerException(cause);
assertNull(exception.getReason());
assertNull(exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new ResourceManagerException(404, "message", cause);
@@ -79,7 +74,6 @@ public void testResourceManagerException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
}
@@ -95,7 +89,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(503, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -110,7 +103,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(ResourceManagerException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerImplTest.java b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerImplTest.java
index 2a646943d3e4..4dfd799ff4d3 100644
--- a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerImplTest.java
+++ b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerImplTest.java
@@ -26,7 +26,7 @@
import static org.junit.Assert.fail;
import com.google.cloud.Identity;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Policy;
import com.google.cloud.Role;
import com.google.cloud.resourcemanager.ProjectInfo.ResourceId;
diff --git a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerOptionsTest.java b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerOptionsTest.java
index 86224747fe77..0d3dba40552d 100644
--- a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerOptionsTest.java
+++ b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ResourceManagerOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.resourcemanager;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,8 +29,7 @@ public class ResourceManagerOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- ResourceManagerOptions.newBuilder()
- .setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ ResourceManagerOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml
index ad8889d0f2eb..f824c9a3d295 100644
--- a/google-cloud-spanner/pom.xml
+++ b/google-cloud-spanner/pom.xml
@@ -79,6 +79,15 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
+
+ com.google.api
+ gax-grpc
+
com.google.api.grpc
grpc-google-cloud-spanner-v1
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java
index 71f617fa46cc..fe3cb7e3c526 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java
@@ -16,7 +16,7 @@
package com.google.cloud.spanner;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Options.ListOption;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java
index 7d2f7e0f12b4..44488489de51 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java
@@ -16,7 +16,7 @@
package com.google.cloud.spanner;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata;
import java.util.Map;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceAdminClient.java
index 40e93bc4b393..901926bdd4fa 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceAdminClient.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceAdminClient.java
@@ -16,7 +16,7 @@
package com.google.cloud.spanner;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Options.ListOption;
import com.google.spanner.admin.instance.v1.CreateInstanceMetadata;
import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java
index b3b8cd99fbe8..eebb4fc1a24e 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java
@@ -18,8 +18,8 @@
import static com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException;
-import com.google.cloud.GrpcTransportOptions;
-import com.google.cloud.GrpcTransportOptions.ExecutorFactory;
+import com.google.cloud.grpc.GrpcTransportOptions;
+import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
import com.google.cloud.Timestamp;
import com.google.cloud.spanner.Options.QueryOption;
import com.google.cloud.spanner.Options.ReadOption;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerException.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerException.java
index 4d9169307d52..64c9543be291 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerException.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerException.java
@@ -17,15 +17,15 @@
package com.google.cloud.spanner;
import com.google.cloud.BaseServiceException;
+import com.google.cloud.grpc.BaseGrpcServiceException;
import com.google.common.base.Preconditions;
import javax.annotation.Nullable;
/** Base exception type for all exceptions produced by the Cloud Spanner service. */
-public class SpannerException extends BaseServiceException {
+public class SpannerException extends BaseGrpcServiceException {
private static final long serialVersionUID = 20150916L;
private final ErrorCode code;
- private final boolean retryable;
/** Private constructor. Use {@link SpannerExceptionFactory} to create instances. */
SpannerException(
@@ -34,8 +34,7 @@ public class SpannerException extends BaseServiceException {
boolean retryable,
@Nullable String message,
@Nullable Throwable cause) {
- super(code.getCode(), message, null /* reason */, false /* idempotent */, cause);
- this.retryable = retryable;
+ super(message, cause, code.getCode(), retryable);
if (token != DoNotConstructDirectly.ALLOWED) {
throw new AssertionError("Do not construct directly: use SpannerExceptionFactory");
}
@@ -47,12 +46,6 @@ public ErrorCode getErrorCode() {
return code;
}
- /** Returns {@code true} if this exception indicates that the operation may succeed if retried. */
- @Override
- public boolean isRetryable() {
- return retryable;
- }
-
enum DoNotConstructDirectly {
ALLOWED
}
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
index 7168834777d0..6eefec10e8c4 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
@@ -32,7 +32,7 @@
import com.google.cloud.BaseService;
import com.google.cloud.ByteArray;
import com.google.cloud.Date;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.PageImpl.NextPageFetcher;
import com.google.cloud.Timestamp;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
index f051e351beab..75042cc2530e 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.spanner;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.grpc.GrpcTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java
index c4d910cba6ca..3c3ad838c612 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java
@@ -29,7 +29,7 @@
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.cloud.GrpcTransportOptions.ExecutorFactory;
+import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
import com.google.cloud.spanner.SessionPool.Clock;
import com.google.cloud.spanner.SessionPool.PooledSession;
import com.google.common.util.concurrent.ListenableFuture;
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java
index 1f315426faf0..6e2f665485b6 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java
@@ -19,7 +19,7 @@
import static com.google.cloud.spanner.SpannerMatchers.isSpannerException;
import static com.google.common.truth.Truth.assertThat;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Database;
import com.google.cloud.spanner.DatabaseAdminClient;
import com.google.cloud.spanner.ErrorCode;
diff --git a/google-cloud-speech/pom.xml b/google-cloud-speech/pom.xml
index 4d9417c60efc..1774b0ba49a1 100644
--- a/google-cloud-speech/pom.xml
+++ b/google-cloud-speech/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-speech-v1beta1
diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1/SpeechSettings.java
index ad34b9acae39..03c273ca757c 100644
--- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1/SpeechSettings.java
+++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1/SpeechSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java
index c1e1a382b892..e75c8a5e1755 100644
--- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java
+++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/MockSpeech.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/MockSpeech.java
index a61901c66644..4ff1a93edde6 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/MockSpeech.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/MockSpeech.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.speech.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/SpeechClientTest.java
index 60badf54b8a4..23202865a5c9 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/SpeechClientTest.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1/SpeechClientTest.java
@@ -15,12 +15,12 @@
*/
package com.google.cloud.speech.spi.v1;
-import com.google.api.gax.core.ApiStreamObserver;
+import com.google.api.gax.grpc.ApiStreamObserver;
import com.google.api.gax.grpc.ApiException;
import com.google.api.gax.grpc.StreamingCallable;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
-import com.google.api.gax.testing.MockStreamObserver;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockStreamObserver;
import com.google.cloud.speech.v1.LongRunningRecognizeRequest;
import com.google.cloud.speech.v1.LongRunningRecognizeResponse;
import com.google.cloud.speech.v1.RecognitionAudio;
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java
index e88a46d11355..32571cd851f9 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.speech.spi.v1beta1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java
index cc30143dc6de..ee0574c72c83 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java
@@ -15,12 +15,12 @@
*/
package com.google.cloud.speech.spi.v1beta1;
-import com.google.api.gax.core.ApiStreamObserver;
+import com.google.api.gax.grpc.ApiStreamObserver;
import com.google.api.gax.grpc.ApiException;
import com.google.api.gax.grpc.StreamingCallable;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
-import com.google.api.gax.testing.MockStreamObserver;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockStreamObserver;
import com.google.cloud.speech.v1beta1.AsyncRecognizeRequest;
import com.google.cloud.speech.v1beta1.AsyncRecognizeResponse;
import com.google.cloud.speech.v1beta1.RecognitionAudio;
diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml
index ab2b10ce1c84..e7b964df8508 100644
--- a/google-cloud-storage/pom.xml
+++ b/google-cloud-storage/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.apis
google-api-services-storage
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
index f0808385acd2..5b552c954eeb 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
@@ -21,7 +21,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Acl.Entity;
import com.google.cloud.storage.Storage.BlobGetOption;
import com.google.cloud.storage.Storage.BlobListOption;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
index 2b4b9a38995b..00efcfb79965 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java
@@ -19,7 +19,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.auth.ServiceAccountSigner;
import com.google.auth.ServiceAccountSigner.SigningException;
import com.google.cloud.FieldSelector;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java
index 0bf43b57faee..bec844ff9a76 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageException.java
@@ -19,8 +19,8 @@
import com.google.api.client.googleapis.json.GoogleJsonError;
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
@@ -30,7 +30,7 @@
* @see Google Cloud
* Storage error codes
*/
-public final class StorageException extends BaseServiceException {
+public final class StorageException extends BaseHttpServiceException {
// see: https://cloud.google.com/storage/docs/resumable-uploads-xml#practices
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(
@@ -49,20 +49,15 @@ public StorageException(int code, String message) {
}
public StorageException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
}
public StorageException(IOException exception) {
- super(exception, true);
+ super(exception, true, RETRYABLE_ERRORS);
}
public StorageException(GoogleJsonError error) {
- super(error, true);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(error, true, RETRYABLE_ERRORS);
}
/**
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java
index 1c4b5f98e4e3..3d08dc01e191 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java
@@ -33,7 +33,7 @@
import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.UTF_8;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.api.services.storage.model.BucketAccessControl;
import com.google.api.services.storage.model.ObjectAccessControl;
import com.google.api.services.storage.model.StorageObject;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
index e885ebf5d54d..21567235d495 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java
@@ -16,7 +16,7 @@
package com.google.cloud.storage;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java
index a20f8d093b7f..9c732a544b42 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java
@@ -52,7 +52,7 @@
import com.google.api.services.storage.model.StorageObject;
import com.google.api.services.storage.model.TestIamPermissionsResponse;
import com.google.cloud.BaseServiceException;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.storage.StorageException;
import com.google.cloud.storage.StorageOptions;
import com.google.common.base.Function;
diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java
index 0e5481d0404e..a58dab39a849 100644
--- a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java
+++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java
@@ -17,8 +17,8 @@
package com.google.cloud.storage.testing;
import com.google.auth.oauth2.GoogleCredentials;
-import com.google.cloud.HttpTransportOptions;
-import com.google.api.gax.core.RetrySettings;
+import com.google.cloud.http.HttpTransportOptions;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.storage.BlobInfo;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.Storage.BlobListOption;
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java
index fe8346700730..9e9f10fb8b37 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java
@@ -27,7 +27,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.PageImpl;
import com.google.cloud.storage.Acl.Project;
import com.google.cloud.storage.Acl.Project.ProjectRole;
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionTest.java
index 334cc3e408a4..aa9a0e82005d 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageExceptionTest.java
@@ -44,56 +44,48 @@ public void testStorageException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(502, "message");
assertEquals(502, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(503, "message");
assertEquals(503, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(504, "message");
assertEquals(504, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(429, "message");
assertEquals(429, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(408, "message");
assertEquals(408, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(400, "message");
assertEquals(400, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException();
exception = new StorageException(cause);
assertNull(exception.getReason());
assertNull(exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
GoogleJsonError error = new GoogleJsonError();
@@ -103,14 +95,12 @@ public void testStorageException() {
assertEquals(503, exception.getCode());
assertEquals("message", exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new StorageException(400, "message", cause);
assertEquals(400, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
HttpResponseException httpResponseException =
@@ -157,7 +147,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(503, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -172,7 +161,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(StorageException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java
index de91dbb1846f..9373f88dd8e2 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java
@@ -29,7 +29,7 @@
import com.google.api.client.googleapis.json.GoogleJsonError;
import com.google.api.core.ApiClock;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.api.services.storage.model.Policy.Bindings;
import com.google.api.services.storage.model.StorageObject;
import com.google.api.services.storage.model.TestIamPermissionsResponse;
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java
index 35ad25ad3533..b1467d450383 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.storage;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,7 +29,7 @@ public class StorageOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- StorageOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ StorageOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java
index c3cdec088b86..d693295888d6 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.api.gax.core.Page;
+import com.google.api.gax.paging.Page;
import com.google.cloud.Identity;
import com.google.cloud.Policy;
import com.google.cloud.ReadChannel;
diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java
index 7d465fd51a17..535604bff846 100644
--- a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java
+++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java
@@ -20,8 +20,8 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import com.google.cloud.HttpTransportOptions;
-import com.google.api.gax.core.Page;
+import com.google.cloud.http.HttpTransportOptions;
+import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.Storage;
diff --git a/google-cloud-trace/pom.xml b/google-cloud-trace/pom.xml
index 98eea51578d0..09b1dbfeb31a 100644
--- a/google-cloud-trace/pom.xml
+++ b/google-cloud-trace/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-trace-v1
diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java
index 414b4daa4088..53af0a37e2ee 100644
--- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java
+++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java
@@ -20,7 +20,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
diff --git a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java
index 9df9e0ab111c..2fc87887a55c 100644
--- a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java
+++ b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.trace.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java
index 0bdebe0538fa..2801fb2df7ab 100644
--- a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java
+++ b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java
@@ -18,8 +18,8 @@
import static com.google.cloud.trace.spi.v1.PagedResponseWrappers.ListTracesPagedResponse;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.common.collect.Lists;
import com.google.devtools.cloudtrace.v1.GetTraceRequest;
import com.google.devtools.cloudtrace.v1.ListTracesRequest;
diff --git a/google-cloud-translate/pom.xml b/google-cloud-translate/pom.xml
index a7e758b696ab..1b17aca4df41 100644
--- a/google-cloud-translate/pom.xml
+++ b/google-cloud-translate/pom.xml
@@ -24,6 +24,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-http
+ ${core-http.version}
+
com.google.apis
google-api-services-translate
diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java
index 5d47e4a9522a..672a08ff8041 100644
--- a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java
+++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java
@@ -18,34 +18,29 @@
import com.google.cloud.BaseServiceException;
import com.google.cloud.RetryHelper.RetryHelperException;
+import com.google.cloud.http.BaseHttpServiceException;
import com.google.common.collect.ImmutableSet;
-
import java.io.IOException;
import java.util.Set;
/**
* Google Translation service exception.
*/
-public class TranslateException extends BaseServiceException {
+public class TranslateException extends BaseHttpServiceException {
private static final Set RETRYABLE_ERRORS = ImmutableSet.of(new Error(500, null));
- private static final long serialVersionUID = 4747004866996469418L;
+ private static final long serialVersionUID = 6811792902595193267L;
TranslateException(int code, String message) {
- super(code, message, null, true, null);
+ super(code, message, null, true, RETRYABLE_ERRORS, null);
}
TranslateException(int code, String message, Throwable cause) {
- super(code, message, null, true, cause);
+ super(code, message, null, true, RETRYABLE_ERRORS, cause);
}
public TranslateException(IOException exception) {
- super(exception, true);
- }
-
- @Override
- protected Set getRetryableErrors() {
- return RETRYABLE_ERRORS;
+ super(exception, true, RETRYABLE_ERRORS);
}
/**
diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java
index 859615797b06..15cb7469c427 100644
--- a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java
+++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java
@@ -18,7 +18,7 @@
import static com.google.common.base.MoreObjects.firstNonNull;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.ServiceDefaults;
import com.google.cloud.ServiceOptions;
import com.google.cloud.ServiceRpc;
diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/HttpTranslateRpc.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/HttpTranslateRpc.java
index 9949d2e0a434..868a9a5a9a0b 100644
--- a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/HttpTranslateRpc.java
+++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/HttpTranslateRpc.java
@@ -30,7 +30,7 @@
import com.google.api.services.translate.model.LanguagesListResponse;
import com.google.api.services.translate.model.LanguagesResource;
import com.google.api.services.translate.model.TranslationsResource;
-import com.google.cloud.HttpTransportOptions;
+import com.google.cloud.http.HttpTransportOptions;
import com.google.cloud.translate.TranslateException;
import com.google.cloud.translate.TranslateOptions;
import com.google.common.base.Function;
diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java
index 7d91d0b427e1..07c846585b05 100644
--- a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java
+++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java
@@ -16,8 +16,8 @@
package com.google.cloud.translate.testing;
-import com.google.cloud.HttpTransportOptions;
-import com.google.api.gax.core.RetrySettings;
+import com.google.cloud.http.HttpTransportOptions;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.translate.TranslateOptions;
import org.joda.time.Duration;
diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateExceptionTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateExceptionTest.java
index c7ac69fd2dac..255b94134880 100644
--- a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateExceptionTest.java
+++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateExceptionTest.java
@@ -43,21 +43,18 @@ public void testTranslateException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
exception = new TranslateException(400, "message");
assertEquals(400, exception.getCode());
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
IOException cause = new SocketTimeoutException();
exception = new TranslateException(cause);
assertNull(exception.getReason());
assertNull(exception.getMessage());
assertTrue(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
exception = new TranslateException(400, "message", cause);
@@ -65,7 +62,6 @@ public void testTranslateException() {
assertEquals("message", exception.getMessage());
assertNull(exception.getReason());
assertFalse(exception.isRetryable());
- assertTrue(exception.isIdempotent());
assertSame(cause, exception.getCause());
}
@@ -81,7 +77,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(500, ex.getCode());
assertEquals("message", ex.getMessage());
assertTrue(ex.isRetryable());
- assertTrue(ex.isIdempotent());
} finally {
verify(exceptionMock);
}
@@ -96,7 +91,6 @@ public void testTranslateAndThrow() throws Exception {
assertEquals(TranslateException.UNKNOWN_CODE, ex.getCode());
assertEquals("message", ex.getMessage());
assertFalse(ex.isRetryable());
- assertTrue(ex.isIdempotent());
assertSame(cause, ex.getCause());
} finally {
verify(exceptionMock);
diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateImplTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateImplTest.java
index b6b762bd209d..c62e748035c4 100644
--- a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateImplTest.java
+++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateImplTest.java
@@ -22,7 +22,7 @@
import com.google.api.services.translate.model.DetectionsResourceItems;
import com.google.api.services.translate.model.LanguagesResource;
import com.google.api.services.translate.model.TranslationsResource;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.cloud.ServiceOptions;
import com.google.cloud.translate.Translate.LanguageListOption;
import com.google.cloud.translate.Translate.TranslateOption;
diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateOptionsTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateOptionsTest.java
index 2fd03f7ed0f5..0403c60cae63 100644
--- a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateOptionsTest.java
+++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslateOptionsTest.java
@@ -16,7 +16,7 @@
package com.google.cloud.translate;
-import com.google.cloud.GrpcTransportOptions;
+import com.google.cloud.TransportOptions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -29,7 +29,7 @@ public class TranslateOptionsTest {
@Test
public void testInvalidTransport() {
thrown.expect(IllegalArgumentException.class);
- TranslateOptions.newBuilder().setTransportOptions(GrpcTransportOptions.newBuilder().build());
+ TranslateOptions.newBuilder().setTransportOptions(new TransportOptions() {});
}
}
diff --git a/google-cloud-vision/pom.xml b/google-cloud-vision/pom.xml
index cc2bf9ed2cb9..dbee0ad7a96c 100644
--- a/google-cloud-vision/pom.xml
+++ b/google-cloud-vision/pom.xml
@@ -29,6 +29,11 @@
google-cloud-core
${core.version}
+
+ ${project.groupId}
+ google-cloud-core-grpc
+ ${core-grpc.version}
+
com.google.api.grpc
grpc-google-cloud-vision-v1
diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java
index 28558e3aaef9..3becf934dc94 100644
--- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java
+++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java
@@ -17,7 +17,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
-import com.google.api.gax.core.RetrySettings;
+import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java
index 68ae3cfd6fff..e6e30b616e8c 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java
@@ -16,8 +16,8 @@
package com.google.cloud.vision.spi.v1;
import com.google.api.gax.grpc.ApiException;
-import com.google.api.gax.testing.MockGrpcService;
-import com.google.api.gax.testing.MockServiceHelper;
+import com.google.api.gax.grpc.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.cloud.vision.v1.AnnotateImageRequest;
import com.google.cloud.vision.v1.BatchAnnotateImagesRequest;
import com.google.cloud.vision.v1.BatchAnnotateImagesResponse;
diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java
index faa3634434c5..8516b243ca79 100644
--- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java
+++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.vision.spi.v1;
-import com.google.api.gax.testing.MockGrpcService;
+import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.ServerServiceDefinition;
import java.util.List;
diff --git a/pom.xml b/pom.xml
index 2a1e76246428..a774fd0f6f61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,8 @@
1.21.0
0.2.0
- 0.13.0
+ 0.14.0
+ 0.14.0
0.1.8
0.6.1
1.2.0
@@ -143,6 +144,8 @@
0.14.1-alpha-SNAPSHOT
0.14.1-alpha-SNAPSHOT
1.0.0-rc2-SNAPSHOT
+ 1.0.0-rc2-SNAPSHOT
+ 1.0.0-rc2-SNAPSHOT
1.0.0-rc2-SNAPSHOT
0.14.1-alpha-SNAPSHOT
0.14.1-alpha-SNAPSHOT
@@ -252,6 +255,11 @@
gax
${gax.version}
+
+ com.google.api
+ gax-grpc
+ ${gax-grpc.version}
+
junit
@@ -281,6 +289,8 @@
google-cloud-compute
google-cloud-contrib
google-cloud-core
+ google-cloud-core-http
+ google-cloud-core-grpc
google-cloud-datastore
google-cloud-dns
google-cloud-errorreporting