Skip to content

Commit

Permalink
Removed unnecessary imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
mderka committed Mar 25, 2016
1 parent 729201c commit 3d8e4c0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ Zone zone = dns.create(zoneInfo);
The second snippet shows how to create records inside a zone. The complete code can be found on [CreateOrUpdateRecordSets.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/dns/snippets/CreateOrUpdateRecordSets.java).
```java
import com.google.gcloud.dns.ChangeRequest;
import com.google.gcloud.dns.ChangeRequestInfo;
import com.google.gcloud.dns.Dns;
import com.google.gcloud.dns.DnsOptions;
Expand Down
15 changes: 11 additions & 4 deletions gcloud-java-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ our zone that creates a record set of type A and points URL www.someexampledomai
IP address 12.13.14.15. Start by adding

```java
import com.google.gcloud.dns.ChangeRequest;
import com.google.gcloud.dns.ChangeRequestInfo;
import com.google.gcloud.dns.RecordSet;

Expand Down Expand Up @@ -221,7 +220,7 @@ When the change request is applied, it is registered with the Cloud DNS service
can wait for its completion as follows:

```java
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
try {
Thread.sleep(500L);
} catch (InterruptedException e) {
Expand Down Expand Up @@ -263,9 +262,17 @@ while (recordSetIterator.hasNext()) {
}
```

You can also list the history of change requests that were applied to a zone:
You can also list the history of change requests that were applied to a zone.
First add:

```java
import java.util.ChangeRequest;
```

and then:

```java

// List the change requests applied to a particular zone
Iterator<ChangeRequest> changeIterator = zone.listChangeRequests().iterateAll();
System.out.println(String.format("The history of changes in %s:", zone.name()));
Expand Down Expand Up @@ -298,7 +305,7 @@ if (!changeRequest.deletions().isEmpty()) {
// Wait for change to finish, but save data traffic by transferring only ID and status
Dns.ChangeRequestOption option =
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS);
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
System.out.println("Waiting for change to complete. Going to sleep for 500ms...");
try {
Thread.sleep(500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@ public Builder toBuilder() {

@Override
public boolean equals(Object obj) {
if (obj.getClass().equals(ChangeRequest.class)) {
if (obj == null || !obj.getClass().equals(ChangeRequest.class)) {
return false
} else {
ChangeRequest other = (ChangeRequest) obj;
return Objects.equals(options, other.options)
&& Objects.equals(zone, other.zone)
&& Objects.equals(toPb(), other.toPb());
}
return false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package com.google.gcloud.examples.dns.snippets;

import com.google.gcloud.dns.ChangeRequest;
import com.google.gcloud.dns.ChangeRequestInfo;
import com.google.gcloud.dns.Dns;
import com.google.gcloud.dns.DnsOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package com.google.gcloud.examples.dns.snippets;

import com.google.gcloud.dns.ChangeRequest;
import com.google.gcloud.dns.ChangeRequestInfo;
import com.google.gcloud.dns.Dns;
import com.google.gcloud.dns.DnsOptions;
Expand Down Expand Up @@ -65,7 +64,7 @@ public static void main(String... args) {
// Wait for change to finish, but save data traffic by transferring only ID and status
Dns.ChangeRequestOption option =
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS);
while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
System.out.println("Waiting for change to complete. Going to sleep for 500ms...");
try {
Thread.sleep(500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(String... args) {
ChangeRequestInfo changeRequest = changeBuilder.build();
zone.applyChangeRequest(changeRequest);

while (ChangeRequest.Status.PENDING.equals(changeRequest.status())) {
while (ChangeRequestInfo.Status.PENDING.equals(changeRequest.status())) {
try {
Thread.sleep(500L);
} catch (InterruptedException e) {
Expand Down

0 comments on commit 3d8e4c0

Please sign in to comment.