diff --git a/labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSResourceRecordSetApiLiveTest.java b/labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSRecordSetApiLiveTest.java
similarity index 83%
rename from labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSResourceRecordSetApiLiveTest.java
rename to labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSRecordSetApiLiveTest.java
index 7d6e517f4d..407e3e9aad 100644
--- a/labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSResourceRecordSetApiLiveTest.java
+++ b/labs/aws-route53/src/test/java/org/jclouds/aws/route53/features/AWSRecordSetApiLiveTest.java
@@ -18,15 +18,15 @@
*/
package org.jclouds.aws.route53.features;
-import org.jclouds.route53.features.ResourceRecordSetApiLiveTest;
+import org.jclouds.route53.features.RecordSetApiLiveTest;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
@Test(groups = "live", testName = "AWSResourceRecordSetApiLiveTest")
-public class AWSResourceRecordSetApiLiveTest extends ResourceRecordSetApiLiveTest {
- public AWSResourceRecordSetApiLiveTest() {
+public class AWSRecordSetApiLiveTest extends RecordSetApiLiveTest {
+ public AWSRecordSetApiLiveTest() {
provider = "aws-route53";
}
}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/InvalidChangeBatchException.java b/labs/route53/src/main/java/org/jclouds/route53/InvalidChangeBatchException.java
new file mode 100644
index 0000000000..2a2c088577
--- /dev/null
+++ b/labs/route53/src/main/java/org/jclouds/route53/InvalidChangeBatchException.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you 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 org.jclouds.route53;
+
+import org.jclouds.http.HttpResponseException;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * @see
+ *
+ * @author Adrian Cole
+ */
+public class InvalidChangeBatchException extends IllegalArgumentException {
+ private static final long serialVersionUID = 1L;
+
+ private final ImmutableList messages;
+
+ public InvalidChangeBatchException(ImmutableList messages, HttpResponseException cause) {
+ super(messages.toString(), cause);
+ this.messages = messages;
+ }
+
+ public ImmutableList getMessages() {
+ return messages;
+ }
+}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/Route53Api.java b/labs/route53/src/main/java/org/jclouds/route53/Route53Api.java
index f981f7c595..a06770b2c7 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/Route53Api.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/Route53Api.java
@@ -25,7 +25,7 @@ import javax.ws.rs.PathParam;
import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.route53.domain.Change;
-import org.jclouds.route53.features.ResourceRecordSetApi;
+import org.jclouds.route53.features.RecordSetApi;
import org.jclouds.route53.features.ZoneApi;
/**
@@ -56,8 +56,8 @@ public interface Route53Api {
ZoneApi getZoneApi();
/**
- * Provides synchronous access to ResourceRecordSet features.
+ * Provides synchronous access to record set features.
*/
@Delegate
- ResourceRecordSetApi getResourceRecordSetApiForZone(@PathParam("zoneId") String zoneId);
+ RecordSetApi getRecordSetApiForZone(@PathParam("zoneId") String zoneId);
}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java b/labs/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java
index edf09ee1b1..c08cc9e1a1 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java
@@ -30,7 +30,7 @@ import org.jclouds.rest.annotations.VirtualHost;
import org.jclouds.rest.annotations.XMLResponseParser;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.route53.domain.Change;
-import org.jclouds.route53.features.ResourceRecordSetAsyncApi;
+import org.jclouds.route53.features.RecordSetAsyncApi;
import org.jclouds.route53.features.ZoneAsyncApi;
import org.jclouds.route53.filters.RestAuthentication;
import org.jclouds.route53.xml.ChangeHandler;
@@ -67,8 +67,8 @@ public interface Route53AsyncApi {
ZoneAsyncApi getZoneApi();
/**
- * Provides asynchronous access to ResourceRecordSet features.
+ * Provides asynchronous access to record set features.
*/
@Delegate
- ResourceRecordSetAsyncApi getResourceRecordSetApiForZone(@PathParam("zoneId") String zoneId);
+ RecordSetAsyncApi getRecordSetApiForZone(@PathParam("zoneId") String zoneId);
}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/binders/BindChangeBatch.java b/labs/route53/src/main/java/org/jclouds/route53/binders/BindChangeBatch.java
new file mode 100644
index 0000000000..58b4ccf3d0
--- /dev/null
+++ b/labs/route53/src/main/java/org/jclouds/route53/binders/BindChangeBatch.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you 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 org.jclouds.route53.binders;
+
+import static org.jclouds.io.Payloads.newStringPayload;
+
+import javax.inject.Singleton;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.io.Payload;
+import org.jclouds.rest.Binder;
+import org.jclouds.route53.domain.ChangeBatch;
+import org.jclouds.route53.domain.ChangeBatch.ActionOnResourceRecordSet;
+import org.jclouds.route53.functions.SerializeRRS;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class BindChangeBatch implements Binder {
+
+ private static final SerializeRRS xml = new SerializeRRS();
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public R bindToRequest(R request, Object payload) {
+ ChangeBatch from = ChangeBatch.class.cast(payload);
+ StringBuilder b = new StringBuilder();
+ b.append("");
+ if (from.getComment().isPresent())
+ b.append("").append(from.getComment().get()).append("");
+ b.append("");
+ for (ActionOnResourceRecordSet change : from)
+ b.append("").append("").append(change.getAction()).append("")
+ .append(xml.apply(change.getRRS())).append("");
+ b.append("");
+ b.append("");
+ Payload xmlPayload = newStringPayload(b.toString());
+ xmlPayload.getContentMetadata().setContentType("application/xml");
+ return (R) request.toBuilder().payload(xmlPayload).build();
+ }
+}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/binders/BindNextRecord.java b/labs/route53/src/main/java/org/jclouds/route53/binders/BindNextRecord.java
index ef024c88b4..2a5327b825 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/binders/BindNextRecord.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/binders/BindNextRecord.java
@@ -23,7 +23,7 @@ import javax.inject.Singleton;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpRequest.Builder;
import org.jclouds.rest.Binder;
-import org.jclouds.route53.domain.ResourceRecordSetIterable.NextRecord;
+import org.jclouds.route53.domain.RecordSetIterable.NextRecord;
/**
*
diff --git a/labs/route53/src/main/java/org/jclouds/route53/config/Route53RestClientModule.java b/labs/route53/src/main/java/org/jclouds/route53/config/Route53RestClientModule.java
index adca0446d1..823b377bc8 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/config/Route53RestClientModule.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/config/Route53RestClientModule.java
@@ -26,15 +26,20 @@ import javax.inject.Singleton;
import org.jclouds.aws.config.AWSRestClientModule;
import org.jclouds.date.DateService;
import org.jclouds.date.TimeStamp;
+import org.jclouds.http.HttpErrorHandler;
+import org.jclouds.http.annotation.ClientError;
+import org.jclouds.http.annotation.Redirection;
+import org.jclouds.http.annotation.ServerError;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.RequestSigner;
import org.jclouds.route53.Route53Api;
import org.jclouds.route53.Route53AsyncApi;
-import org.jclouds.route53.features.ResourceRecordSetApi;
-import org.jclouds.route53.features.ResourceRecordSetAsyncApi;
+import org.jclouds.route53.features.RecordSetApi;
+import org.jclouds.route53.features.RecordSetAsyncApi;
import org.jclouds.route53.features.ZoneApi;
import org.jclouds.route53.features.ZoneAsyncApi;
import org.jclouds.route53.filters.RestAuthentication;
+import org.jclouds.route53.handlers.Route53ErrorHandler;
import com.google.common.collect.ImmutableMap;
import com.google.common.reflect.TypeToken;
@@ -49,7 +54,7 @@ import com.google.inject.Provides;
public class Route53RestClientModule extends AWSRestClientModule {
public static final Map, Class>> DELEGATE_MAP = ImmutableMap., Class>> builder()//
.put(ZoneApi.class, ZoneAsyncApi.class)
- .put(ResourceRecordSetApi.class, ResourceRecordSetAsyncApi.class).build();
+ .put(RecordSetApi.class, RecordSetAsyncApi.class).build();
public Route53RestClientModule() {
super(TypeToken.of(Route53Api.class), TypeToken.of(Route53AsyncApi.class), DELEGATE_MAP);
@@ -66,4 +71,11 @@ public class Route53RestClientModule extends AWSRestClientModule {
+
+ public static ChangeBatch createAll(Iterable toCreate) {
+ return builder().createAll(toCreate).build();
+ }
+
+ public static ChangeBatch deleteAll(Iterable toDelete) {
+ return builder().deleteAll(toDelete).build();
+ }
+
+ private final Optional comment;
+ private final List changes;
+
+ public static enum Action {
+ CREATE, DELETE;
+ }
+
+ public static class ActionOnResourceRecordSet {
+ private final Action action;
+ private final RecordSet rrs;
+
+ private ActionOnResourceRecordSet(Action action, RecordSet rrs) {
+ this.action = action;
+ this.rrs = rrs;
+ }
+
+ public Action getAction() {
+ return action;
+ }
+
+ public RecordSet getRRS() {
+ return rrs;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(action, rrs);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ ActionOnResourceRecordSet that = ActionOnResourceRecordSet.class.cast(obj);
+ return equal(this.action, that.rrs);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper("").omitNullValues().add("action", action).add("rrs", rrs).toString();
+ }
+ }
+
+ private ChangeBatch(Optional comment, ImmutableList changes) {
+ this.comment = checkNotNull(comment, "comment");
+ this.changes = checkNotNull(changes, "changes%s", comment.isPresent() ? " for %s " + comment.get() : "");
+ checkArgument(!changes.isEmpty(), "no changes%s", comment.isPresent() ? " for %s " + comment.get() : "");
+ }
+
+ /**
+ * Any comments you want to include about the changes in this change batch.
+ */
+ public Optional getComment() {
+ return comment;
+ }
+
+ @Override
+ protected List delegate() {
+ return changes;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(comment, changes);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ ChangeBatch that = ChangeBatch.class.cast(obj);
+ return equal(this.comment, that.comment) && equal(this.changes, that.changes);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper("").omitNullValues().add("comment", comment.orNull()).add("changes", changes).toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public final static class Builder {
+ private Optional comment = Optional.absent();
+ private ImmutableList.Builder changes = ImmutableList.builder();
+
+ /**
+ * @see ChangeBatch#getComment()
+ */
+ public Builder comment(String comment) {
+ this.comment = Optional.fromNullable(comment);
+ return this;
+ }
+
+ public Builder create(RecordSet rrs) {
+ this.changes.add(new ActionOnResourceRecordSet(Action.CREATE, rrs));
+ return this;
+ }
+
+ public Builder createAll(Iterable toCreate) {
+ for (RecordSet rrs : toCreate)
+ create(rrs);
+ return this;
+ }
+
+ public Builder delete(RecordSet rrs) {
+ this.changes.add(new ActionOnResourceRecordSet(Action.DELETE, rrs));
+ return this;
+ }
+
+ public Builder deleteAll(Iterable toDelete) {
+ for (RecordSet rrs : toDelete)
+ delete(rrs);
+ return this;
+ }
+
+ public ChangeBatch build() {
+ return new ChangeBatch(comment, changes.build());
+ }
+ }
+}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/domain/RecordSet.java b/labs/route53/src/main/java/org/jclouds/route53/domain/RecordSet.java
new file mode 100644
index 0000000000..89aaaa8757
--- /dev/null
+++ b/labs/route53/src/main/java/org/jclouds/route53/domain/RecordSet.java
@@ -0,0 +1,394 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you 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 org.jclouds.route53.domain;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import org.jclouds.route53.domain.RecordSet.RecordSubset.Latency;
+import org.jclouds.route53.domain.RecordSet.RecordSubset.Weighted;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+public class RecordSet {
+
+ protected final String name;
+ protected final Type type;
+ protected final Optional ttl;
+ protected final Set values;
+ protected final Optional aliasTarget;
+
+ public enum Type {
+ A, AAAA, CNAME, MX, NS, PTR, SOA, SPF, SRV, TXT;
+ }
+
+ /**
+ * In this case, the rrs is an alias, and it points to another Route53 hosted
+ * resource, such as an ELB, S3 bucket, or zone.
+ */
+ public static class AliasTarget {
+
+ public static AliasTarget dnsNameInZone(String dnsName, String zoneId) {
+ return new AliasTarget(dnsName, zoneId);
+ }
+
+ private final String dnsName;
+ private final String zoneId;
+
+ private AliasTarget(String dnsName, String zoneId) {
+ this.dnsName = checkNotNull(dnsName, "dnsName");
+ this.zoneId = checkNotNull(zoneId, "zoneId of %s", dnsName);
+ }
+
+ public String getDNSName() {
+ return dnsName;
+ }
+
+ public String getZoneId() {
+ return zoneId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(zoneId, dnsName);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ AliasTarget other = AliasTarget.class.cast(obj);
+ return equal(this.dnsName, other.dnsName) && equal(this.zoneId, other.zoneId);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper("").omitNullValues().add("dnsName", dnsName).add("zoneId", zoneId).toString();
+ }
+ }
+
+ /**
+ * A portion of a RRs who share the same name and type
+ */
+ public static abstract class RecordSubset extends RecordSet {
+ public static final class Weighted extends RecordSubset {
+
+ private final int weight;
+
+ private Weighted(String id, String name, Type type, int weight, Optional ttl, Set values,
+ Optional aliasTarget) {
+ super(id, name, type, ttl, values, aliasTarget);
+ this.weight = weight;
+ }
+
+ /**
+ * determines what portion of traffic for the current resource record
+ * set is routed to this subset.
+ */
+ public int getWeight() {
+ return weight;
+ }
+
+ @Override
+ ToStringHelper differentiate(ToStringHelper in) {
+ return in.add("weight", weight);
+ }
+ }
+
+ public static final class Latency extends RecordSubset {
+
+ private final String region;
+
+ private Latency(String id, String name, Type type, String region, Optional ttl, Set values,
+ Optional aliasTarget) {
+ super(id, name, type, ttl, values, aliasTarget);
+ this.region = checkNotNull(region, "region of %s", name);
+ }
+
+ /**
+ * The Amazon EC2 region where the resource that is specified in this
+ * resource record set resides.
+ */
+ public String getRegion() {
+ return region;
+ }
+
+ @Override
+ ToStringHelper differentiate(ToStringHelper in) {
+ return in.add("region", region);
+ }
+ }
+
+ private final String id;
+
+ private RecordSubset(String id, String name, Type type, Optional ttl, Set values,
+ Optional aliasTarget) {
+ super(name, type, ttl, values, aliasTarget);
+ this.id = checkNotNull(id, "id of %s", name);
+ }
+
+ /**
+ * The identifier that differentiates beyond {@code name} and {@code type}
+ */
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), id);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (super.equals(obj) && obj instanceof RecordSubset) {
+ RecordSubset that = RecordSubset.class.cast(obj);
+ return equal(this.id, that.id);
+ }
+ return false;
+ }
+
+ abstract ToStringHelper differentiate(ToStringHelper in);
+
+ @Override
+ public String toString() {
+ return differentiate(toStringHelper("").omitNullValues().add("id", id).add("name", name).add("type", type))
+ .add("ttl", ttl.orNull()).add("values", values.isEmpty() ? null : values).add("aliasTarget", aliasTarget.orNull())
+ .toString();
+ }
+ }
+
+ private RecordSet(String name, Type type, Optional ttl, Set values, Optional aliasTarget) {
+ this.name = checkNotNull(name, "name");
+ this.type = checkNotNull(type, "type of %s", name);
+ this.ttl = checkNotNull(ttl, "ttl for %s", name);
+ this.values = checkNotNull(values, "values for %s", name);
+ this.aliasTarget = checkNotNull(aliasTarget, "aliasTarget for %s", aliasTarget);
+ }
+
+ /**
+ * The name of the domain.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * The resource record set type.
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * Present in all resource record sets except aliases. The resource record
+ * cache time to live (TTL), in seconds.
+ */
+ public Optional getTTL() {
+ return ttl;
+ }
+
+ /**
+ * Type-specific values that differentiates the RRs in this set. Empty if
+ * {@link #getType()} is {@link Type#A} or {@link Type#AAAA} and
+ * {@link #getAliasTarget} is present.
+ */
+ public Set getValues() {
+ return values;
+ }
+
+ /**
+ * When present, {@link #getType()} is {@link Type#A} or {@link Type#AAAA}.
+ * Instead of {@link #getValues()} containing the corresponding IP addresses,
+ * the server will follow this link and resolve one on-demand.
+ */
+ public Optional getAliasTarget() {
+ return aliasTarget;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name, type);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ RecordSet other = RecordSet.class.cast(obj);
+ return equal(this.name, other.name) && equal(this.type, other.type);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper("").omitNullValues().add("name", name).add("type", type).add("ttl", ttl.orNull())
+ .add("values", values.isEmpty() ? null : values).add("aliasTarget", aliasTarget.orNull()).toString();
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return builder().from(this);
+ }
+
+ public final static class Builder {
+ private String id;
+ private String name;
+ private Type type;
+ private Optional ttl = Optional.absent();
+ private ImmutableSet.Builder values = ImmutableSet. builder();
+ private String dnsName;
+ private String zoneId;
+ private Integer weight;
+ private String region;
+
+ /**
+ * @see RecordSubset#getId()
+ */
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getName()
+ */
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getType()
+ */
+ public Builder type(Type type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getTTL()
+ */
+ public Builder ttl(Integer ttl) {
+ this.ttl = Optional.fromNullable(ttl);
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getAliasTarget()
+ */
+ public Builder dnsName(String dnsName) {
+ this.dnsName = dnsName;
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getAliasTarget()
+ */
+ public Builder zoneId(String zoneId) {
+ this.zoneId = zoneId;
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getAliasTarget()
+ */
+ public Builder aliasTarget(AliasTarget aliasTarget) {
+ if (aliasTarget == null) {
+ dnsName = null;
+ zoneId = null;
+ } else {
+ dnsName = aliasTarget.dnsName;
+ zoneId = aliasTarget.zoneId;
+ }
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getValues()
+ */
+ public Builder add(String values) {
+ this.values.add(values);
+ return this;
+ }
+
+ /**
+ * @see RecordSet#getValues()
+ */
+ public Builder addAll(Iterable values) {
+ this.values.addAll(values);
+ return this;
+ }
+
+ /**
+ * @see RecordSubset.Weighted
+ */
+ public Builder weight(Integer weight) {
+ this.weight = weight;
+ return this;
+ }
+
+ /**
+ * @see RecordSubset.Latency
+ */
+ public Builder region(String region) {
+ this.region = region;
+ return this;
+ }
+
+ public RecordSet build() {
+ Optional aliasTarget = dnsName != null ? Optional.fromNullable(AliasTarget.dnsNameInZone(dnsName, zoneId))
+ : Optional. absent();
+ if (weight != null) {
+ return new RecordSubset.Weighted(id, name, type, weight, ttl, values.build(), aliasTarget);
+ } else if (region != null) {
+ return new RecordSubset.Latency(id, name, type, region, ttl, values.build(), aliasTarget);
+ }
+ return new RecordSet(name, type, ttl, values.build(), aliasTarget);
+ }
+
+ public Builder from(RecordSet in) {
+ if (in instanceof RecordSubset)
+ id(RecordSubset.class.cast(in).id);
+ if (in instanceof Weighted) {
+ weight(Weighted.class.cast(in).weight);
+ } else if (in instanceof Latency) {
+ region(Latency.class.cast(in).region);
+ }
+ return this.name(in.name).type(in.type).ttl(in.ttl.orNull()).addAll(in.values)
+ .aliasTarget(in.aliasTarget.orNull());
+ }
+ }
+}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/domain/ResourceRecordSetIterable.java b/labs/route53/src/main/java/org/jclouds/route53/domain/RecordSetIterable.java
similarity index 83%
rename from labs/route53/src/main/java/org/jclouds/route53/domain/ResourceRecordSetIterable.java
rename to labs/route53/src/main/java/org/jclouds/route53/domain/RecordSetIterable.java
index 0e7448a4e2..8173f03b5f 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/domain/ResourceRecordSetIterable.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/domain/RecordSetIterable.java
@@ -27,7 +27,7 @@ import java.util.Iterator;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.route53.domain.ResourceRecordSet.Type;
+import org.jclouds.route53.domain.RecordSet.Type;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
@@ -37,12 +37,12 @@ import com.google.common.collect.ImmutableList;
*
* @author Adrian Cole
*/
-public class ResourceRecordSetIterable extends IterableWithMarker {
+public class RecordSetIterable extends IterableWithMarker {
- private final Iterable items;
+ private final Iterable items;
private final Optional nextRecord;
- private ResourceRecordSetIterable(Iterable items, @Nullable NextRecord nextRecord) {
+ private RecordSetIterable(Iterable items, @Nullable NextRecord nextRecord) {
this.items = checkNotNull(items, "items");
this.nextRecord = Optional.fromNullable(nextRecord);
}
@@ -61,7 +61,7 @@ public class ResourceRecordSetIterable extends IterableWithMarker iterator() {
+ public Iterator iterator() {
return items.iterator();
}
@@ -76,7 +76,7 @@ public class ResourceRecordSetIterable extends IterableWithMarker items = ImmutableList. builder();
+ private ImmutableList.Builder items = ImmutableList. builder();
private String nextRecordName;
private Type nextRecordType;
private String nextRecordIdentifier;
- public Builder add(ResourceRecordSet item) {
+ public Builder add(RecordSet item) {
this.items.add(item);
return this;
}
- public Builder addAll(Iterable items) {
+ public Builder addAll(Iterable items) {
this.items.addAll(items);
return this;
}
@@ -187,10 +187,10 @@ public class ResourceRecordSetIterable extends IterableWithMarker {
-
- private final String name;
- private final Type type;
- private final Optional ttl;
- private final ImmutableList items;
-
- private ResourceRecordSet(String name, Type type, Optional ttl, ImmutableList items) {
- this.name = checkNotNull(name, "name");
- this.type = checkNotNull(type, "type of %s", name);
- this.ttl = checkNotNull(ttl, "ttl for %s", name);
- this.items = checkNotNull(items, "items for %s", name);
- }
-
- /**
- * The name of the domain.
- */
- public String getName() {
- return name;
- }
-
- /**
- * The resource record set type.
- */
- public Type getType() {
- return type;
- }
-
- /**
- * Present in all resource record sets except aliases. The resource record
- * cache time to live (TTL), in seconds.
- */
- public Optional getTTL() {
- return ttl;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, type, ttl, items);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null || getClass() != obj.getClass())
- return false;
- ResourceRecordSet other = ResourceRecordSet.class.cast(obj);
- return equal(this.name, other.name) && equal(this.type, other.type) && equal(this.ttl, other.ttl)
- && equal(this.items, other.items);
- }
-
- @Override
- public String toString() {
- return toStringHelper("").omitNullValues().add("name", name).add("type", type).add("ttl", ttl.orNull())
- .add("resourceRecords", items).toString();
- }
-
- @Override
- protected List delegate() {
- return items;
- }
-
- public enum Type {
- A, AAAA, CNAME, MX, NS, PTR, SOA, SPF, SRV, TXT, UNRECOGNIZED;
-
- public static Type fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type"));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().from(this);
- }
-
- public final static class Builder {
- private String name;
- private Type type;
- private Optional ttl = Optional.absent();
- private ImmutableList.Builder items = ImmutableList. builder();
-
- /**
- * @see ResourceRecordSet#getName()
- */
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see ResourceRecordSet#getType()
- */
- public Builder type(Type type) {
- this.type = type;
- return this;
- }
-
- /**
- * @see ResourceRecordSet#getTTL()
- */
- public Builder ttl(Integer ttl) {
- this.ttl = Optional.fromNullable(ttl);
- return this;
- }
-
- public Builder add(String item) {
- this.items.add(item);
- return this;
- }
-
- public Builder addAll(Iterable items) {
- this.items.addAll(items);
- return this;
- }
-
- public ResourceRecordSet build() {
- return new ResourceRecordSet(name, type, ttl, items.build());
- }
-
- public Builder from(ResourceRecordSet in) {
- return this.name(in.name).type(in.type).ttl(in.ttl.orNull()).addAll(in.items);
- }
- }
-}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/domain/Zone.java b/labs/route53/src/main/java/org/jclouds/route53/domain/Zone.java
index 226e6ff0b5..8a7d02ac23 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/domain/Zone.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/domain/Zone.java
@@ -88,9 +88,9 @@ public final class Zone {
return true;
if (obj == null || getClass() != obj.getClass())
return false;
- Zone other = Zone.class.cast(obj);
- return equal(this.id, other.id) && equal(this.name, other.name)
- && equal(this.callerReference, other.callerReference);
+ Zone that = Zone.class.cast(obj);
+ return equal(this.id, that.id) && equal(this.name, that.name)
+ && equal(this.callerReference, that.callerReference);
}
@Override
diff --git a/labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetApi.java b/labs/route53/src/main/java/org/jclouds/route53/features/RecordSetApi.java
similarity index 59%
rename from labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetApi.java
rename to labs/route53/src/main/java/org/jclouds/route53/features/RecordSetApi.java
index cd24e2b751..143ae6787f 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetApi.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/features/RecordSetApi.java
@@ -22,33 +22,56 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.collect.PagedIterable;
import org.jclouds.concurrent.Timeout;
-import org.jclouds.route53.domain.ResourceRecordSet;
-import org.jclouds.route53.domain.ResourceRecordSetIterable;
-import org.jclouds.route53.domain.ResourceRecordSetIterable.NextRecord;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.route53.domain.Change;
+import org.jclouds.route53.domain.ChangeBatch;
+import org.jclouds.route53.domain.RecordSet;
+import org.jclouds.route53.domain.RecordSetIterable;
+import org.jclouds.route53.domain.RecordSetIterable.NextRecord;
/**
- * @see ResourceRecordSetAsyncApi
+ * @see RecordSetAsyncApi
* @see
* @author Adrian Cole
*/
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
-public interface ResourceRecordSetApi {
+public interface RecordSetApi {
+
+ /**
+ * schedules creation of the resource record set.
+ */
+ Change create(RecordSet rrs);
+
+ /**
+ * applies a batch of changes atomically.
+ */
+ Change apply(ChangeBatch changes);
/**
* returns all resource record sets in order.
*/
- PagedIterable list();
+ PagedIterable list();
/**
* retrieves up to 100 resource record sets in order.
*/
- ResourceRecordSetIterable listFirstPage();
+ RecordSetIterable listFirstPage();
/**
- * retrieves up to 100 resource record sets in order, starting at {@code nextRecord}
+ * retrieves up to 100 resource record sets in order, starting at
+ * {@code nextRecord}
*/
- ResourceRecordSetIterable listAt(NextRecord nextRecord);
+ RecordSetIterable listAt(NextRecord nextRecord);
+ /**
+ * This action deletes a resource record set.
+ *
+ * @param rrs
+ * the resource record set to delete
+ * @return null if not found or the change in progress
+ */
+ @Nullable
+ Change delete(RecordSet rrs);
}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/features/RecordSetAsyncApi.java b/labs/route53/src/main/java/org/jclouds/route53/features/RecordSetAsyncApi.java
new file mode 100644
index 0000000000..782e70a5c7
--- /dev/null
+++ b/labs/route53/src/main/java/org/jclouds/route53/features/RecordSetAsyncApi.java
@@ -0,0 +1,126 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you 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 org.jclouds.route53.features;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
+
+import javax.inject.Named;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.jclouds.collect.PagedIterable;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.ExceptionParser;
+import org.jclouds.rest.annotations.ParamParser;
+import org.jclouds.rest.annotations.Payload;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
+import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
+import org.jclouds.route53.binders.BindChangeBatch;
+import org.jclouds.route53.binders.BindNextRecord;
+import org.jclouds.route53.domain.Change;
+import org.jclouds.route53.domain.ChangeBatch;
+import org.jclouds.route53.domain.RecordSet;
+import org.jclouds.route53.domain.RecordSetIterable;
+import org.jclouds.route53.domain.RecordSetIterable.NextRecord;
+import org.jclouds.route53.filters.RestAuthentication;
+import org.jclouds.route53.functions.RecordSetIterableToPagedIterable;
+import org.jclouds.route53.functions.SerializeRRS;
+import org.jclouds.route53.xml.ChangeHandler;
+import org.jclouds.route53.xml.ListResourceRecordSetsResponseHandler;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * @see RecordSetApi
+ * @see
+ * @author Adrian Cole
+ */
+@RequestFilters(RestAuthentication.class)
+@VirtualHost
+@Path("/{jclouds.api-version}/hostedzone/{zoneId}")
+public interface RecordSetAsyncApi {
+ /**
+ * @see RecordSetApi#create
+ */
+ @Named("ChangeResourceRecordSets")
+ @POST
+ @Produces(APPLICATION_XML)
+ @Path("/rrset")
+ @Payload("CREATE{rrs}")
+ @XMLResponseParser(ChangeHandler.class)
+ ListenableFuture create(@PayloadParam("rrs") @ParamParser(SerializeRRS.class) RecordSet rrs);
+
+ /**
+ * @see RecordSetApi#apply
+ */
+ @Named("ChangeResourceRecordSets")
+ @POST
+ @Produces(APPLICATION_XML)
+ @Path("/rrset")
+ @XMLResponseParser(ChangeHandler.class)
+ ListenableFuture apply(@BinderParam(BindChangeBatch.class) ChangeBatch changes);
+
+ /**
+ * @see RecordSetApi#list()
+ */
+ @Named("ListResourceRecordSets")
+ @GET
+ @Path("/rrset")
+ @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
+ @Transform(RecordSetIterableToPagedIterable.class)
+ ListenableFuture> list();
+
+ /**
+ * @see RecordSetApi#listFirstPage
+ */
+ @Named("ListResourceRecordSets")
+ @GET
+ @Path("/rrset")
+ @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
+ ListenableFuture listFirstPage();
+
+ /**
+ * @see RecordSetApi#listAt(NextRecord)
+ */
+ @Named("ListResourceRecordSets")
+ @GET
+ @Path("/rrset")
+ @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
+ ListenableFuture listAt(@BinderParam(BindNextRecord.class) NextRecord nextRecord);
+
+ /**
+ * @see RecordSetApi#delete
+ */
+ @Named("ChangeResourceRecordSets")
+ @POST
+ @Produces(APPLICATION_XML)
+ @Path("/rrset")
+ @Payload("DELETE{rrs}")
+ @XMLResponseParser(ChangeHandler.class)
+ @ExceptionParser(ReturnNullOnNotFoundOr404.class)
+ ListenableFuture delete(@PayloadParam("rrs") @ParamParser(SerializeRRS.class) RecordSet rrs);
+}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetAsyncApi.java b/labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetAsyncApi.java
deleted file mode 100644
index cf0d87aa6a..0000000000
--- a/labs/route53/src/main/java/org/jclouds/route53/features/ResourceRecordSetAsyncApi.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds licenses this file
- * to you 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 org.jclouds.route53.features;
-
-import javax.inject.Named;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.rest.annotations.XMLResponseParser;
-import org.jclouds.route53.binders.BindNextRecord;
-import org.jclouds.route53.domain.ResourceRecordSet;
-import org.jclouds.route53.domain.ResourceRecordSetIterable;
-import org.jclouds.route53.domain.ResourceRecordSetIterable.NextRecord;
-import org.jclouds.route53.filters.RestAuthentication;
-import org.jclouds.route53.functions.ResourceRecordSetsToPagedIterable;
-import org.jclouds.route53.xml.ListResourceRecordSetsResponseHandler;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * @see ResourceRecordSetApi
- * @see
- * @author Adrian Cole
- */
-@RequestFilters(RestAuthentication.class)
-@VirtualHost
-@Path("/{jclouds.api-version}/hostedzone/{zoneId}")
-public interface ResourceRecordSetAsyncApi {
-
- /**
- * @see ResourceRecordSetApi#list()
- */
- @Named("ListResourceRecordSets")
- @GET
- @Path("/rrset")
- @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
- @Transform(ResourceRecordSetsToPagedIterable.class)
- ListenableFuture> list();
-
- /**
- * @see ResourceRecordSetApi#listFirstPage
- */
- @Named("ListResourceRecordSets")
- @GET
- @Path("/rrset")
- @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
- ListenableFuture listFirstPage();
-
- /**
- * @see ResourceRecordSetApi#listAt(NextRecord)
- */
- @Named("ListResourceRecordSets")
- @GET
- @Path("/rrset")
- @XMLResponseParser(ListResourceRecordSetsResponseHandler.class)
- ListenableFuture listAt(@BinderParam(BindNextRecord.class) NextRecord nextRecord);
-}
diff --git a/labs/route53/src/main/java/org/jclouds/route53/features/ZoneApi.java b/labs/route53/src/main/java/org/jclouds/route53/features/ZoneApi.java
index a7a5a3246c..8be8dd9686 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/features/ZoneApi.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/features/ZoneApi.java
@@ -29,7 +29,6 @@ import org.jclouds.route53.domain.Change.Status;
import org.jclouds.route53.domain.NewZone;
import org.jclouds.route53.domain.Zone;
import org.jclouds.route53.domain.ZoneAndNameServers;
-import org.jclouds.route53.options.ListZonesOptions;
/**
* @see ZoneAsyncApi
@@ -64,23 +63,21 @@ public interface ZoneApi {
*/
NewZone createWithReferenceAndComment(String name, String callerReference, String comment);
- /**
- * The action retrieves a specified number of zones in order.
- *
- *
- * You can paginate the results using the
- * {@link ListZonesOptions parameter}
- *
- * @param options
- * the options describing the zones query
- */
- IterableWithMarker list(ListZonesOptions options);
-
/**
* returns all zones in order.
*/
PagedIterable list();
+ /**
+ * retrieves up to 100 zones in order.
+ */
+ IterableWithMarker listFirstPage();
+
+ /**
+ * retrieves up to 100 zones in order, starting at {@code nextMarker}
+ */
+ IterableWithMarker listAt(String nextMarker);
+
/**
* Retrieves information about the specified zone, including its nameserver
* configuration
diff --git a/labs/route53/src/main/java/org/jclouds/route53/features/ZoneAsyncApi.java b/labs/route53/src/main/java/org/jclouds/route53/features/ZoneAsyncApi.java
index 92c6f31db5..86853bacec 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/features/ZoneAsyncApi.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/features/ZoneAsyncApi.java
@@ -27,6 +27,7 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.PagedIterable;
@@ -44,7 +45,6 @@ import org.jclouds.route53.domain.Zone;
import org.jclouds.route53.domain.ZoneAndNameServers;
import org.jclouds.route53.filters.RestAuthentication;
import org.jclouds.route53.functions.ZonesToPagedIterable;
-import org.jclouds.route53.options.ListZonesOptions;
import org.jclouds.route53.xml.ChangeHandler;
import org.jclouds.route53.xml.CreateHostedZoneResponseHandler;
import org.jclouds.route53.xml.GetHostedZoneResponseHandler;
@@ -98,13 +98,22 @@ public interface ZoneAsyncApi {
ListenableFuture> list();
/**
- * @see ZoneApi#list(ListZonesOptions)
+ * @see ZoneApi#listFirstPage
*/
@Named("ListHostedZones")
@GET
@Path("/hostedzone")
@XMLResponseParser(ListHostedZonesResponseHandler.class)
- ListenableFuture> list(ListZonesOptions options);
+ ListenableFuture> listFirstPage();
+
+ /**
+ * @see ZoneApi#listAt(String)
+ */
+ @Named("ListHostedZones")
+ @GET
+ @Path("/hostedzone")
+ @XMLResponseParser(ListHostedZonesResponseHandler.class)
+ ListenableFuture> listAt(@QueryParam("marker") String nextMarker);
/**
* @see ZoneApi#get()
diff --git a/labs/route53/src/main/java/org/jclouds/route53/functions/ResourceRecordSetsToPagedIterable.java b/labs/route53/src/main/java/org/jclouds/route53/functions/RecordSetIterableToPagedIterable.java
similarity index 67%
rename from labs/route53/src/main/java/org/jclouds/route53/functions/ResourceRecordSetsToPagedIterable.java
rename to labs/route53/src/main/java/org/jclouds/route53/functions/RecordSetIterableToPagedIterable.java
index 2f4fd295f9..01077954f9 100644
--- a/labs/route53/src/main/java/org/jclouds/route53/functions/ResourceRecordSetsToPagedIterable.java
+++ b/labs/route53/src/main/java/org/jclouds/route53/functions/RecordSetIterableToPagedIterable.java
@@ -25,9 +25,9 @@ import javax.inject.Inject;
import org.jclouds.collect.IterableWithMarker;
import org.jclouds.collect.internal.CallerArg0ToPagedIterable;
import org.jclouds.route53.Route53Api;
-import org.jclouds.route53.domain.ResourceRecordSet;
-import org.jclouds.route53.domain.ResourceRecordSetIterable.NextRecord;
-import org.jclouds.route53.features.ResourceRecordSetApi;
+import org.jclouds.route53.domain.RecordSet;
+import org.jclouds.route53.domain.RecordSetIterable.NextRecord;
+import org.jclouds.route53.features.RecordSetApi;
import com.google.common.annotations.Beta;
import com.google.common.base.Function;
@@ -36,23 +36,23 @@ import com.google.common.base.Function;
* @author Adrian Cole
*/
@Beta
-public class ResourceRecordSetsToPagedIterable extends
- CallerArg0ToPagedIterable {
+public class RecordSetIterableToPagedIterable extends
+ CallerArg0ToPagedIterable {
private final Route53Api api;
@Inject
- protected ResourceRecordSetsToPagedIterable(Route53Api api) {
+ protected RecordSetIterableToPagedIterable(Route53Api api) {
this.api = checkNotNull(api, "api");
}
@Override
- protected Function