From 782c99d17c20b07abd0caeb1544fb27dffc29ad8 Mon Sep 17 00:00:00 2001 From: Everett Toews Date: Mon, 18 Mar 2013 16:55:53 -0500 Subject: [PATCH] Renamed Rackspace Cloud Load Balanacer domain objects with verb first. --- .../v1/domain/{NodeAdd.java => AddNode.java} | 24 ++-- ...cerCreate.java => CreateLoadBalancer.java} | 26 ++-- ...cerUpdate.java => UpdateLoadBalancer.java} | 122 +++++++++++------- .../{NodeUpdate.java => UpdateNode.java} | 71 ++++++---- .../v1/features/LoadBalancerApi.java | 8 +- .../v1/features/LoadBalancerAsyncApi.java | 12 +- .../v1/features/NodeApi.java | 10 +- .../v1/features/NodeAsyncApi.java | 10 +- ...LoadBalancersLoadBalanceNodesStrategy.java | 12 +- .../v1/features/AccessRuleApiLiveTest.java | 12 +- .../v1/features/ConnectionApiLiveTest.java | 12 +- .../features/ContentCachingApiLiveTest.java | 12 +- .../v1/features/ErrorPageApiLiveTest.java | 12 +- .../v1/features/HealthMonitorApiLiveTest.java | 12 +- .../features/LoadBalancerApiExpectTest.java | 25 ++-- .../v1/features/LoadBalancerApiLiveTest.java | 12 +- .../v1/features/NodeApiExpectTest.java | 21 +-- .../v1/features/NodeApiLiveTest.java | 14 +- .../v1/features/ReportApiLiveTest.java | 12 +- .../features/SSLTerminationApiLiveTest.java | 12 +- .../SessionPersistenceApiLiveTest.java | 12 +- .../v1/features/VirtualIPApiLiveTest.java | 12 +- 22 files changed, 263 insertions(+), 212 deletions(-) rename apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{NodeAdd.java => AddNode.java} (92%) rename apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{LoadBalancerCreate.java => CreateLoadBalancer.java} (90%) rename apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{LoadBalancerUpdate.java => UpdateLoadBalancer.java} (58%) rename apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{NodeUpdate.java => UpdateNode.java} (65%) diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeAdd.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/AddNode.java similarity index 92% rename from apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeAdd.java rename to apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/AddNode.java index 8ab085d3af..9d89a4fe4b 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeAdd.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/AddNode.java @@ -49,13 +49,13 @@ import com.google.common.base.Objects.ToStringHelper; * * @author Adrian Cole */ -public class NodeAdd extends BaseNode { +public class AddNode extends BaseNode { // for serialization only - NodeAdd() { + AddNode() { } - public NodeAdd(String address, int port, Condition condition, Type type, Integer weight) { + public AddNode(String address, int port, Condition condition, Type type, Integer weight) { super(address, port, condition, type, weight); } @@ -79,18 +79,12 @@ public class NodeAdd extends BaseNode { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; - NodeAdd that = NodeAdd.class.cast(obj); + AddNode that = AddNode.class.cast(obj); return Objects.equal(this.address, that.address) && Objects.equal(this.port, that.port); } - public static class Builder extends BaseNode.Builder { - - @Override - public NodeAdd build() { - return new NodeAdd(address, port, condition, type, weight); - } - + public static class Builder extends BaseNode.Builder { /** * {@inheritDoc} */ @@ -130,8 +124,14 @@ public class NodeAdd extends BaseNode { public Builder weight(Integer weight) { return Builder.class.cast(super.weight(weight)); } + @Override - public Builder from(NodeAdd in) { + public AddNode build() { + return new AddNode(address, port, condition, type, weight); + } + + @Override + public Builder from(AddNode in) { return Builder.class.cast(super.from(in)); } } diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/LoadBalancerCreate.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/CreateLoadBalancer.java similarity index 90% rename from apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/LoadBalancerCreate.java rename to apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/CreateLoadBalancer.java index 6d9eb8e8f1..cbeb319932 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/LoadBalancerCreate.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/CreateLoadBalancer.java @@ -37,30 +37,30 @@ import com.google.common.collect.ImmutableSet; * * @author Adrian Cole */ -public class LoadBalancerCreate extends BaseLoadBalancer { +public class CreateLoadBalancer extends BaseLoadBalancer { private final Set> virtualIps; private final Set accessRules; private final Map metadata; - public LoadBalancerCreate(String name, String protocol, @Nullable Integer port, Set nodeAdds, + public CreateLoadBalancer(String name, String protocol, @Nullable Integer port, Set addNodes, @Nullable Algorithm algorithm, @Nullable Integer timeout, @Nullable Boolean halfClosed, @Nullable Map sessionPersistenceType, @Nullable Map connectionLogging, @Nullable ConnectionThrottle connectionThrottle, @Nullable HealthMonitor healthMonitor, @Nullable Set accessRules, @Nullable Map metadata, VirtualIP.Type virtualIPType, Integer virtualIPId) { - this(name, protocol, port, nodeAdds, algorithm, timeout, halfClosed, sessionPersistenceType, connectionLogging, + this(name, protocol, port, addNodes, algorithm, timeout, halfClosed, sessionPersistenceType, connectionLogging, connectionThrottle, healthMonitor, accessRules, metadata, getVirtualIPsFromOptions(virtualIPType, virtualIPId)); } - public LoadBalancerCreate(String name, String protocol, @Nullable Integer port, Set nodeAdds, + public CreateLoadBalancer(String name, String protocol, @Nullable Integer port, Set addNodes, @Nullable Algorithm algorithm, @Nullable Integer timeout, @Nullable Boolean halfClosed, @Nullable Map sessionPersistenceType, @Nullable Map connectionLogging, @Nullable ConnectionThrottle connectionThrottle, @Nullable HealthMonitor healthMonitor, @Nullable Set accessRules, @Nullable Map metadata, Set> virtualIPsFromOptions) { - super(name, protocol, port, nodeAdds, algorithm, timeout, halfClosed, sessionPersistenceType, connectionLogging, + super(name, protocol, port, addNodes, algorithm, timeout, halfClosed, sessionPersistenceType, connectionLogging, connectionThrottle, healthMonitor); this.virtualIps = checkNotNull(virtualIPsFromOptions, "virtualIPsFromOptions"); this.accessRules = accessRules; @@ -100,7 +100,7 @@ public class LoadBalancerCreate extends BaseLoadBalancer { + public static class Builder extends BaseLoadBalancer.Builder { private VirtualIP.Type virtualIPType; private Integer virtualIPId; private Set> virtualIps; @@ -150,14 +150,14 @@ public class LoadBalancerCreate extends BaseLoadBalancer nodeAdds) { - this.nodes = ImmutableSet. copyOf(checkNotNull(nodeAdds, "nodes")); + public Builder nodes(Iterable addNodes) { + this.nodes = ImmutableSet. copyOf(checkNotNull(addNodes, "nodes")); return this; } @@ -176,7 +176,7 @@ public class LoadBalancerCreate extends BaseLoadBalancer> LoadBalancerUpdate fromLoadBalancer(T lb) { - return Builder.name(lb.getName()).port(lb.getPort()).protocol(lb.getProtocol()).algorithm(lb.getAlgorithm()) - .timeout(lb.getTimeout()).halfClosed(lb.isHalfClosed()); + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().from(this); } } diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeUpdate.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/UpdateNode.java similarity index 65% rename from apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeUpdate.java rename to apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/UpdateNode.java index 4036a8bdd5..65c435c6ee 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/NodeUpdate.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/UpdateNode.java @@ -28,27 +28,29 @@ import com.google.common.base.Objects.ToStringHelper; /** * Used to update Nodes. * - * @author Dan Lo Bianco + * @author Everett Toews */ -public class NodeUpdate { - - protected Condition condition; - protected Type type; - protected Integer weight; - - public NodeUpdate condition(Condition condition) { +public class UpdateNode { + private Condition condition; + private Type type; + private Integer weight; + + protected UpdateNode(Condition condition, Type type, Integer weight) { this.condition = condition; - return this; - } - - public NodeUpdate type(Type type) { this.type = type; - return this; + this.weight = weight; } - public NodeUpdate weight(Integer weight) { - this.weight = weight; - return this; + public Condition getCondition() { + return condition; + } + + public Type getType() { + return type; + } + + public Integer getWeight() { + return weight; } protected ToStringHelper string() { @@ -71,36 +73,55 @@ public class NodeUpdate { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; - NodeUpdate that = NodeUpdate.class.cast(obj); + UpdateNode that = UpdateNode.class.cast(obj); return Objects.equal(this.condition, that.condition) && Objects.equal(this.type, that.type) && Objects.equal(this.weight, that.weight); } public static class Builder { + private Condition condition; + private Type type; + private Integer weight; + /** * @see BaseNode.Builder#condition(Condition) */ - public static NodeUpdate condition(Condition condition) { - return new NodeUpdate().condition(condition); + public Builder condition(Condition condition) { + this.condition = condition; + return this; } /** * @see BaseNode.Builder#type(Type) */ - public static NodeUpdate type(Type type) { - return new NodeUpdate().type(type); + public Builder type(Type type) { + this.type = type; + return this; } /** * @see BaseNode.Builder#weight(Integer) */ - public static NodeUpdate weight(Integer weight) { - return new NodeUpdate().weight(weight); + public Builder weight(Integer weight) { + this.weight = weight; + return this; + } + + public UpdateNode build() { + return new UpdateNode(condition, type, weight); + } + + public Builder from(UpdateNode in) { + return this.condition(in.getCondition()).type(in.getType()).weight(in.getWeight()); } } - public static > NodeUpdate fromNode(T n) { - return Builder.condition(n.getCondition()).type(n.getType()).weight(n.getWeight()); + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().from(this); } } diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java index b0ca139df4..cedc29ecbf 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java @@ -24,8 +24,8 @@ import org.jclouds.collect.IterableWithMarker; import org.jclouds.collect.PagedIterable; import org.jclouds.openstack.v2_0.options.PaginationOptions; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; /** @@ -43,7 +43,7 @@ public interface LoadBalancerApi { * identifier, the caller can check on the progress of the operation by performing a * {@link LoadBalancerApi#get}. */ - LoadBalancer create(LoadBalancerCreate lbCreate); + LoadBalancer create(CreateLoadBalancer createLB); /** * Update the properties of a load balancer. @@ -52,7 +52,7 @@ public interface LoadBalancerApi { * identifier, the caller can check on the progress of the operation by performing a * {@link LoadBalancerApi#get}. */ - void update(int id, LoadBalancerUpdate lbUpdate); + void update(int id, UpdateLoadBalancer updateLB); /** * List the load balancers. diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java index a1f67f49eb..1c406681a5 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java @@ -44,8 +44,8 @@ import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.v2_0.options.PaginationOptions; import org.jclouds.rackspace.cloudloadbalancers.v1.binders.BindMetadataToJsonPayload; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; import org.jclouds.rackspace.cloudloadbalancers.v1.functions.ParseLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.functions.ParseLoadBalancers; @@ -72,7 +72,7 @@ import com.google.common.util.concurrent.ListenableFuture; public interface LoadBalancerAsyncApi { /** - * @see LoadBalancerApi#create(LoadBalancerCreate) + * @see LoadBalancerApi#create(CreateLoadBalancer) */ @Named("lb:create") @POST @@ -80,17 +80,17 @@ public interface LoadBalancerAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Fallback(NullOnNotFoundOr404.class) @Path("/loadbalancers") - ListenableFuture create(@WrapWith("loadBalancer") LoadBalancerCreate lbCreate); + ListenableFuture create(@WrapWith("loadBalancer") CreateLoadBalancer createLB); /** - * @see LoadBalancerApi#update(int, LoadBalancerUpdate) + * @see LoadBalancerApi#update(int, UpdateLoadBalancer) */ @Named("lb:update") @PUT @ResponseParser(ParseLoadBalancer.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/loadbalancers/{id}") - ListenableFuture update(@PathParam("id") int id, @WrapWith("loadBalancer") LoadBalancerUpdate lbUpdate); + ListenableFuture update(@PathParam("id") int id, @WrapWith("loadBalancer") UpdateLoadBalancer updateLB); /** * @see LoadBalancerApi#list() diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java index 0c5c7e207e..325f377ee5 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java @@ -26,8 +26,8 @@ import org.jclouds.collect.PagedIterable; import org.jclouds.openstack.v2_0.options.PaginationOptions; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Node; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; /** * Provides synchronous access to CloudLoadBalancers Node features. @@ -38,14 +38,14 @@ import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; */ public interface NodeApi { /** - * Create a new node with the configuration defined by the request. + * Add a new node with the configuration defined by the request. */ - Set add(Iterable nodeAdds); + Set add(Iterable addNodes); /** * Update the attributes of a node. */ - void update(int id, NodeUpdate nodeUpdate); + void update(int id, UpdateNode updateNode); /** * List the nodes. diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java index c160ea7aaa..fd542a94f0 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java @@ -47,8 +47,8 @@ import org.jclouds.rackspace.cloudloadbalancers.v1.binders.BindMetadataToJsonPay import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Node; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.functions.ParseMetadata; import org.jclouds.rackspace.cloudloadbalancers.v1.functions.ParseNode; import org.jclouds.rackspace.cloudloadbalancers.v1.functions.ParseNodes; @@ -83,16 +83,16 @@ public interface NodeAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Fallback(NullOnNotFoundOr404.class) @Path("/nodes") - ListenableFuture> add(@WrapWith("nodes") Iterable nodeAdds); + ListenableFuture> add(@WrapWith("nodes") Iterable addNodes); /** - * @see NodeApi#update(int, NodeUpdate) + * @see NodeApi#update(int, UpdateNode) */ @Named("node:update") @PUT @Consumes(MediaType.APPLICATION_JSON) @Path("/nodes/{id}") - ListenableFuture update(@PathParam("id") int id, @WrapWith("node") NodeUpdate nodeUpdate); + ListenableFuture update(@PathParam("id") int id, @WrapWith("node") UpdateNode updateNode); /** * @see NodeApi#list() diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java index 03e2b7f07e..ebcc368e90 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java @@ -34,8 +34,8 @@ import org.jclouds.loadbalancer.strategy.LoadBalanceNodesStrategy; import org.jclouds.logging.Logger; import org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApi; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import com.google.common.base.Function; @@ -67,13 +67,13 @@ public class CloudLoadBalancersLoadBalanceNodesStrategy implements LoadBalanceNo // TODO need to query and update the LB per current design. LoadBalancer lb = client.getLoadBalancerApiForZone(region).create( - LoadBalancerCreate.builder().name(name).protocol(protocol.toUpperCase()).port(loadBalancerPort) + CreateLoadBalancer.builder().name(name).protocol(protocol.toUpperCase()).port(loadBalancerPort) .virtualIPType(Type.PUBLIC).nodes( - Iterables.transform(nodes, new Function() { + Iterables.transform(nodes, new Function() { @Override - public NodeAdd apply(NodeMetadata arg0) { - return NodeAdd.builder().address( + public AddNode apply(NodeMetadata arg0) { + return AddNode.builder().address( Iterables.get(arg0.getPrivateAddresses(), 0)).port(instancePort) .build(); diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java index 6ac2051c1a..05fc96d8d1 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java @@ -30,8 +30,8 @@ import java.util.Map; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AccessRule; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AccessRuleWithId; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -72,12 +72,12 @@ public class AccessRuleApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { } public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = "ORD";//Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java index 79a409a381..a12c403fce 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java @@ -27,8 +27,8 @@ import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.ConnectionThrottle; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -45,12 +45,12 @@ public class ConnectionApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java index ce08591498..84b1cdda9c 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java @@ -24,8 +24,8 @@ import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -42,12 +42,12 @@ public class ContentCachingApiLiveTest extends BaseCloudLoadBalancersApiLiveTest private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java index d00066200a..6aa8b5afff 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java @@ -24,8 +24,8 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -54,12 +54,12 @@ public class ErrorPageApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { } public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java index 12b200239f..9cc1ac7be6 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java @@ -26,8 +26,8 @@ import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.HealthMonitor; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -44,12 +44,12 @@ public class HealthMonitorApiLiveTest extends BaseCloudLoadBalancersApiLiveTest private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java index 5c296994b6..9d20d8acad 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java @@ -29,10 +29,10 @@ import javax.ws.rs.core.MediaType; import org.jclouds.http.HttpResponse; import org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApi; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Node; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP; import org.jclouds.rackspace.cloudloadbalancers.v1.features.LoadBalancerApi; @@ -89,30 +89,30 @@ public class LoadBalancerApiExpectTest extends BaseCloudLoadBalancerApiExpectTes HttpResponse.builder().statusCode(200).payload(payloadFromResource("/loadbalancer-get.json")).build() ).getLoadBalancerApiForZone("DFW"); - NodeAdd nodeAdd1 = NodeAdd.builder() + AddNode addNode1 = AddNode.builder() .address("10.1.1.1") .condition(Node.Condition.ENABLED) .port(80) .build(); - NodeAdd nodeAdd2 = NodeAdd.builder() + AddNode addNode2 = AddNode.builder() .address("10.1.1.2") .condition(Node.Condition.ENABLED) .port(80) .build(); - Set nodeAdds = Sets.newHashSet(nodeAdd1, nodeAdd2); + Set addNodes = Sets.newHashSet(addNode1, addNode2); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() + CreateLoadBalancer createLB = CreateLoadBalancer.builder() .name("sample-loadbalancer") .protocol("HTTP") .port(80) .algorithm(LoadBalancer.Algorithm.RANDOM) .virtualIPType(VirtualIP.Type.PUBLIC) - .nodes(nodeAdds) + .nodes(addNodes) .build(); - LoadBalancer loadBalancer = api.create(lbCreate); + LoadBalancer loadBalancer = api.create(createLB); assertEquals(loadBalancer, getExpectedLoadBalancer()); } @@ -126,13 +126,14 @@ public class LoadBalancerApiExpectTest extends BaseCloudLoadBalancerApiExpectTes HttpResponse.builder().statusCode(202).payload("").build() ).getLoadBalancerApiForZone("DFW"); - LoadBalancerUpdate lbUpdate = LoadBalancerUpdate.Builder + UpdateLoadBalancer updateLB = UpdateLoadBalancer.builder() .name("foo") .protocol("HTTPS") .port(443) - .algorithm(LoadBalancer.Algorithm.RANDOM); + .algorithm(LoadBalancer.Algorithm.RANDOM) + .build(); - api.update(2000, lbUpdate); + api.update(2000, updateLB); } public void testRemoveLoadBalancer() { diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java index 12f1b6f863..0b3a58fbd0 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java @@ -30,10 +30,10 @@ import java.util.Set; import java.util.logging.Logger; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; import org.testng.annotations.AfterGroups; @@ -67,12 +67,12 @@ public class LoadBalancerApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { Logger.getAnonymousLogger().info("starting lb in region " + zone); LoadBalancer lb = clbApi.getLoadBalancerApiForZone(zone).create( - LoadBalancerCreate.builder() + CreateLoadBalancer.builder() .name(prefix + "-" + zone) .protocol("HTTP") .port(80) .virtualIPType(Type.PUBLIC) - .node(NodeAdd.builder() + .node(AddNode.builder() .address("192.168.1.1") .port(8080) .build()) @@ -96,7 +96,7 @@ public class LoadBalancerApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { public void testUpdateLoadBalancer() throws Exception { for (LoadBalancer lb: lbs) { clbApi.getLoadBalancerApiForZone(lb.getRegion()).update(lb.getId(), - LoadBalancerUpdate.Builder.name("foo" + "-" + lb.getRegion())); + UpdateLoadBalancer.builder().name("foo" + "-" + lb.getRegion()).build()); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(lb.getRegion())).apply(lb)); diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java index 0fc1a268a9..520a4baa86 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java @@ -30,8 +30,8 @@ import org.jclouds.http.HttpResponse; import org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApi; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Metadata; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Node; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeUpdate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.features.NodeApi; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancerApiExpectTest; import org.testng.annotations.Test; @@ -84,14 +84,14 @@ public class NodeApiExpectTest extends BaseCloudLoadBalancerApiExpectTest nodeAdds = ImmutableSortedSet. of(nodeAdd1, nodeAdd2, nodeAdd3); + Set addNodes = ImmutableSortedSet. of(addNode1, addNode2, addNode3); - Set nodes = api.add(nodeAdds); + Set nodes = api.add(addNodes); assertEquals(nodes, getExpectedNodes()); } @@ -121,12 +121,13 @@ public class NodeApiExpectTest extends BaseCloudLoadBalancerApiExpectTest()); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(lb.getRegion())).apply(lb)); @@ -78,7 +78,7 @@ public class NodeApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { String region = lb.getRegion(); Logger.getAnonymousLogger().info("starting node on loadbalancer " + lb.getId() + " in region " + region); Set newNodes = clbApi.getNodeApiForZoneAndLoadBalancer(region, lb.getId()).add( - ImmutableSet. of(NodeAdd.builder().address("192.168.1.2").port(8080).build())); + ImmutableSet. of(AddNode.builder().address("192.168.1.2").port(8080).build())); for (Node n : newNodes) { assertEquals(n.getStatus(), Node.Status.ONLINE); @@ -97,7 +97,7 @@ public class NodeApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { for (Node n : entry.getValue()) { String region = entry.getKey().getRegion(); clbApi.getNodeApiForZoneAndLoadBalancer(region, entry.getKey().getId()).update(n.getId(), - NodeUpdate.Builder.weight(23)); + UpdateNode.builder().weight(23).build()); assertEquals(clbApi.getNodeApiForZoneAndLoadBalancer(region, entry.getKey().getId()).get(n.getId()) .getStatus(), Node.Status.ONLINE); diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java index f5d2f657bf..d2d8537cfc 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java @@ -30,10 +30,10 @@ import java.util.Date; import org.jclouds.http.HttpResponseException; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.HistoricalUsage; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerStats; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerUsage; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.Protocol; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; @@ -52,12 +52,12 @@ public class ReportApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java index e053a583f2..aa7c8a393b 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java @@ -25,8 +25,8 @@ import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.SSLTermination; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; @@ -44,12 +44,12 @@ public class SSLTerminationApiLiveTest extends BaseCloudLoadBalancersApiLiveTest private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java index 1e8be080f6..96a1db6a2a 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java @@ -25,8 +25,8 @@ import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.SessionPersistence; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; import org.jclouds.rackspace.cloudloadbalancers.v1.internal.BaseCloudLoadBalancersApiLiveTest; @@ -44,12 +44,12 @@ public class SessionPersistenceApiLiveTest extends BaseCloudLoadBalancersApiLive private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); } diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java index 95614027ac..e4854c387f 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java @@ -26,8 +26,8 @@ import static org.testng.Assert.assertTrue; import java.util.List; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancer; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerCreate; -import org.jclouds.rackspace.cloudloadbalancers.v1.domain.NodeAdd; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.CreateLoadBalancer; +import org.jclouds.rackspace.cloudloadbalancers.v1.domain.AddNode; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIPWithId; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type; @@ -48,12 +48,12 @@ public class VirtualIPApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { private String zone; public void testCreateLoadBalancer() { - NodeAdd nodeAdd = NodeAdd.builder().address("192.168.1.1").port(8080).build(); - LoadBalancerCreate lbCreate = LoadBalancerCreate.builder() - .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(nodeAdd).build(); + AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build(); + CreateLoadBalancer createLB = CreateLoadBalancer.builder() + .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build(); zone = Iterables.getFirst(clbApi.getConfiguredZones(), null); - lb = clbApi.getLoadBalancerApiForZone(zone).create(lbCreate); + lb = clbApi.getLoadBalancerApiForZone(zone).create(createLB); assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(zone)).apply(lb)); }