From 96e380c182aa89f8c4f7dbdcb7df2d4c188c8343 Mon Sep 17 00:00:00 2001 From: Martin Derka Date: Mon, 14 Mar 2016 14:45:15 -0700 Subject: [PATCH] Moved spi package to dns.spi as per #742 --- .../com/google/gcloud/dns/AbstractOption.java | 2 +- .../main/java/com/google/gcloud/dns/Dns.java | 2 +- .../java/com/google/gcloud/dns/DnsImpl.java | 2 +- .../com/google/gcloud/dns/DnsOptions.java | 6 ++--- .../gcloud/{ => dns}/spi/DefaultDnsRpc.java | 22 +++++++++---------- .../google/gcloud/{ => dns}/spi/DnsRpc.java | 2 +- .../gcloud/{ => dns}/spi/DnsRpcFactory.java | 3 ++- .../google/gcloud/dns/AbstractOptionTest.java | 2 +- .../com/google/gcloud/dns/DnsImplTest.java | 4 ++-- .../java/com/google/gcloud/dns/DnsTest.java | 2 +- .../dns/testing/LocalDnsHelperTest.java | 4 ++-- 11 files changed, 26 insertions(+), 25 deletions(-) rename gcloud-java-dns/src/main/java/com/google/gcloud/{ => dns}/spi/DefaultDnsRpc.java (91%) rename gcloud-java-dns/src/main/java/com/google/gcloud/{ => dns}/spi/DnsRpc.java (99%) rename gcloud-java-dns/src/main/java/com/google/gcloud/{ => dns}/spi/DnsRpcFactory.java (91%) diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/AbstractOption.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/AbstractOption.java index a148468d14b5..e12f7412e687 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/AbstractOption.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/AbstractOption.java @@ -19,7 +19,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.MoreObjects; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import java.io.Serializable; import java.util.Objects; diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/Dns.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/Dns.java index b2cb9fbad371..6ce6b4c19994 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/Dns.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/Dns.java @@ -20,7 +20,7 @@ import com.google.common.collect.Sets; import com.google.gcloud.Page; import com.google.gcloud.Service; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import java.io.Serializable; import java.util.Set; diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsImpl.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsImpl.java index 17521c13c625..a60cfd9151da 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsImpl.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsImpl.java @@ -33,7 +33,7 @@ import com.google.gcloud.Page; import com.google.gcloud.PageImpl; import com.google.gcloud.RetryHelper; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import java.util.Map; import java.util.concurrent.Callable; diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsOptions.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsOptions.java index d9317546cea0..db922b42a3cb 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsOptions.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/DnsOptions.java @@ -18,9 +18,9 @@ import com.google.common.collect.ImmutableSet; import com.google.gcloud.ServiceOptions; -import com.google.gcloud.spi.DefaultDnsRpc; -import com.google.gcloud.spi.DnsRpc; -import com.google.gcloud.spi.DnsRpcFactory; +import com.google.gcloud.dns.spi.DefaultDnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpcFactory; import java.util.Set; diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DefaultDnsRpc.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DefaultDnsRpc.java similarity index 91% rename from gcloud-java-dns/src/main/java/com/google/gcloud/spi/DefaultDnsRpc.java rename to gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DefaultDnsRpc.java index 1df0a8a2f831..f8b8adb87ada 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DefaultDnsRpc.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DefaultDnsRpc.java @@ -1,13 +1,13 @@ -package com.google.gcloud.spi; - -import static com.google.gcloud.spi.DnsRpc.ListResult.of; -import static com.google.gcloud.spi.DnsRpc.Option.DNS_NAME; -import static com.google.gcloud.spi.DnsRpc.Option.DNS_TYPE; -import static com.google.gcloud.spi.DnsRpc.Option.FIELDS; -import static com.google.gcloud.spi.DnsRpc.Option.NAME; -import static com.google.gcloud.spi.DnsRpc.Option.PAGE_SIZE; -import static com.google.gcloud.spi.DnsRpc.Option.PAGE_TOKEN; -import static com.google.gcloud.spi.DnsRpc.Option.SORTING_ORDER; +package com.google.gcloud.dns.spi; + +import static com.google.gcloud.dns.spi.DnsRpc.ListResult.of; +import static com.google.gcloud.dns.spi.DnsRpc.Option.DNS_NAME; +import static com.google.gcloud.dns.spi.DnsRpc.Option.DNS_TYPE; +import static com.google.gcloud.dns.spi.DnsRpc.Option.FIELDS; +import static com.google.gcloud.dns.spi.DnsRpc.Option.NAME; +import static com.google.gcloud.dns.spi.DnsRpc.Option.PAGE_SIZE; +import static com.google.gcloud.dns.spi.DnsRpc.Option.PAGE_TOKEN; +import static com.google.gcloud.dns.spi.DnsRpc.Option.SORTING_ORDER; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import com.google.api.client.http.HttpRequestInitializer; @@ -188,7 +188,7 @@ public ListResult listChangeRequests(String zoneName, Map opt request = request.setSortBy(SORT_BY).setSortOrder(SORTING_ORDER.getString(options)); } ChangesListResponse response = request.execute(); - return ListResult.of(response.getNextPageToken(), response.getChanges()); + return of(response.getNextPageToken(), response.getChanges()); } catch (IOException ex) { throw translate(ex); } diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpc.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpc.java similarity index 99% rename from gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpc.java rename to gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpc.java index addb69d24b40..bde93b99bfdd 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpc.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpc.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.gcloud.spi; +package com.google.gcloud.dns.spi; import com.google.api.services.dns.model.Change; import com.google.api.services.dns.model.ManagedZone; diff --git a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpcFactory.java b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpcFactory.java similarity index 91% rename from gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpcFactory.java rename to gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpcFactory.java index 3d25f09bb1e5..ca1b1a0dd018 100644 --- a/gcloud-java-dns/src/main/java/com/google/gcloud/spi/DnsRpcFactory.java +++ b/gcloud-java-dns/src/main/java/com/google/gcloud/dns/spi/DnsRpcFactory.java @@ -14,9 +14,10 @@ * limitations under the License. */ -package com.google.gcloud.spi; +package com.google.gcloud.dns.spi; import com.google.gcloud.dns.DnsOptions; +import com.google.gcloud.spi.ServiceRpcFactory; /** * An interface for DnsRpc factory. Implementation will be loaded via {@link diff --git a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/AbstractOptionTest.java b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/AbstractOptionTest.java index 09e35527879b..d88ea85c5846 100644 --- a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/AbstractOptionTest.java +++ b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/AbstractOptionTest.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.fail; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import org.junit.Test; diff --git a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsImplTest.java b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsImplTest.java index 9205de8d99dd..a97c9c408036 100644 --- a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsImplTest.java +++ b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsImplTest.java @@ -28,8 +28,8 @@ import com.google.gcloud.Page; import com.google.gcloud.RetryParams; import com.google.gcloud.ServiceOptions; -import com.google.gcloud.spi.DnsRpc; -import com.google.gcloud.spi.DnsRpcFactory; +import com.google.gcloud.dns.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpcFactory; import org.easymock.Capture; import org.easymock.EasyMock; diff --git a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsTest.java b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsTest.java index c9f4df4f5bdd..2e233e2df62a 100644 --- a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsTest.java +++ b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/DnsTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import org.junit.Test; diff --git a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/testing/LocalDnsHelperTest.java b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/testing/LocalDnsHelperTest.java index 15fa437eb631..59002131cc9d 100644 --- a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/testing/LocalDnsHelperTest.java +++ b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/testing/LocalDnsHelperTest.java @@ -32,8 +32,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.gcloud.dns.DnsException; -import com.google.gcloud.spi.DefaultDnsRpc; -import com.google.gcloud.spi.DnsRpc; +import com.google.gcloud.dns.spi.DefaultDnsRpc; +import com.google.gcloud.dns.spi.DnsRpc; import org.junit.AfterClass; import org.junit.Before;