Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1436 from rackspace/rax-clb-verb-first-rename

Renamed Rackspace Cloud Load Balanacer domain objects with verb first.
  • Loading branch information...
commit e93b79d145217fc9096197befb5cc972cdf2de19 2 parents 3d6a2a6 + d8b8240
@everett-toews everett-toews authored
Showing with 258 additions and 207 deletions.
  1. +12 −12 ...lancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{NodeAdd.java → AddNode.java}
  2. +13 −13 ...org/jclouds/rackspace/cloudloadbalancers/v1/domain/{LoadBalancerCreate.java → CreateLoadBalancer.java}
  3. +71 −43 ...org/jclouds/rackspace/cloudloadbalancers/v1/domain/{LoadBalancerUpdate.java → UpdateLoadBalancer.java}
  4. +45 −24 ...s/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/{NodeUpdate.java → UpdateNode.java}
  5. +4 −4 ...-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java
  6. +6 −6 ...dloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java
  7. +5 −5 ...ackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java
  8. +5 −5 ...ace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java
  9. +6 −6 ...louds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java
  10. +6 −6 ...loadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java
  11. +6 −6 ...loadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java
  12. +6 −6 ...balancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java
  13. +6 −6 ...dloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java
  14. +6 −6 ...dbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java
  15. +13 −12 ...balancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java
  16. +6 −6 ...adbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java
  17. +11 −10 ...loudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java
  18. +7 −7 ...-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java
  19. +6 −6 ...loudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java
  20. +6 −6 ...balancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java
  21. +6 −6 ...ncers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java
  22. +6 −6 ...dloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java
View
24 ...ckspace/cloudloadbalancers/v1/domain/NodeAdd.java → ...ckspace/cloudloadbalancers/v1/domain/AddNode.java
@@ -49,13 +49,13 @@
*
* @author Adrian Cole
*/
-public class NodeAdd extends BaseNode<NodeAdd> {
+public class AddNode extends BaseNode<AddNode> {
// 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 boolean equals(Object obj) {
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<NodeAdd> {
-
- @Override
- public NodeAdd build() {
- return new NodeAdd(address, port, condition, type, weight);
- }
-
+ public static class Builder extends BaseNode.Builder<AddNode> {
/**
* {@inheritDoc}
*/
@@ -130,8 +124,14 @@ public Builder port(int port) {
public Builder weight(Integer weight) {
return Builder.class.cast(super.weight(weight));
}
+
+ @Override
+ public AddNode build() {
+ return new AddNode(address, port, condition, type, weight);
+ }
+
@Override
- public Builder from(NodeAdd in) {
+ public Builder from(AddNode in) {
return Builder.class.cast(super.from(in));
}
}
View
26 ...udloadbalancers/v1/domain/LoadBalancerCreate.java → ...udloadbalancers/v1/domain/CreateLoadBalancer.java
@@ -37,30 +37,30 @@
*
* @author Adrian Cole
*/
-public class LoadBalancerCreate extends BaseLoadBalancer<NodeAdd, LoadBalancerCreate> {
+public class CreateLoadBalancer extends BaseLoadBalancer<AddNode, CreateLoadBalancer> {
private final Set<Map<String, String>> virtualIps;
private final Set<AccessRule> accessRules;
private final Map<String, String> metadata;
- public LoadBalancerCreate(String name, String protocol, @Nullable Integer port, Set<NodeAdd> nodeAdds,
+ public CreateLoadBalancer(String name, String protocol, @Nullable Integer port, Set<AddNode> addNodes,
@Nullable Algorithm algorithm, @Nullable Integer timeout, @Nullable Boolean halfClosed,
@Nullable Map<String, SessionPersistence> sessionPersistenceType,
@Nullable Map<String, Boolean> connectionLogging, @Nullable ConnectionThrottle connectionThrottle,
@Nullable HealthMonitor healthMonitor, @Nullable Set<AccessRule> accessRules,
@Nullable Map<String, String> 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<NodeAdd> nodeAdds,
+ public CreateLoadBalancer(String name, String protocol, @Nullable Integer port, Set<AddNode> addNodes,
@Nullable Algorithm algorithm, @Nullable Integer timeout, @Nullable Boolean halfClosed,
@Nullable Map<String, SessionPersistence> sessionPersistenceType,
@Nullable Map<String, Boolean> connectionLogging, @Nullable ConnectionThrottle connectionThrottle,
@Nullable HealthMonitor healthMonitor, @Nullable Set<AccessRule> accessRules,
@Nullable Map<String, String> metadata, Set<Map<String, String>> 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 String toString() {
return string().toString();
}
- public static class Builder extends BaseLoadBalancer.Builder<NodeAdd, LoadBalancerCreate> {
+ public static class Builder extends BaseLoadBalancer.Builder<AddNode, CreateLoadBalancer> {
private VirtualIP.Type virtualIPType;
private Integer virtualIPId;
private Set<Map<String, String>> virtualIps;
@@ -150,14 +150,14 @@ public Builder metadata(Map<String, String> metadata) {
return this;
}
- public LoadBalancerCreate build() {
+ public CreateLoadBalancer build() {
if (virtualIps == null) {
- return new LoadBalancerCreate(name, protocol, port, nodes, algorithm, timeout, halfClosed,
+ return new CreateLoadBalancer(name, protocol, port, nodes, algorithm, timeout, halfClosed,
sessionPersistence, connectionLogging, connectionThrottle, healthMonitor, accessRules, metadata,
virtualIPType, virtualIPId);
}
else {
- return new LoadBalancerCreate(name, protocol, port, nodes, algorithm, timeout, halfClosed,
+ return new CreateLoadBalancer(name, protocol, port, nodes, algorithm, timeout, halfClosed,
sessionPersistence, connectionLogging, connectionThrottle, healthMonitor, accessRules, metadata,
virtualIps);
}
@@ -167,8 +167,8 @@ public LoadBalancerCreate build() {
* {@inheritDoc}
*/
@Override
- public Builder nodes(Iterable<NodeAdd> nodeAdds) {
- this.nodes = ImmutableSet.<NodeAdd> copyOf(checkNotNull(nodeAdds, "nodes"));
+ public Builder nodes(Iterable<AddNode> addNodes) {
+ this.nodes = ImmutableSet.<AddNode> copyOf(checkNotNull(addNodes, "nodes"));
return this;
}
@@ -176,7 +176,7 @@ public Builder nodes(Iterable<NodeAdd> nodeAdds) {
* {@inheritDoc}
*/
@Override
- public Builder node(NodeAdd nodes) {
+ public Builder node(AddNode nodes) {
this.nodes.add(checkNotNull(nodes, "nodes"));
return this;
}
@@ -217,7 +217,7 @@ public Builder protocol(String protocol) {
* {@inheritDoc}
*/
@Override
- public Builder from(LoadBalancerCreate in) {
+ public Builder from(CreateLoadBalancer in) {
return Builder.class.cast(super.from(in)).virtualIPs(in.virtualIps);
}
}
View
114 ...udloadbalancers/v1/domain/LoadBalancerUpdate.java → ...udloadbalancers/v1/domain/UpdateLoadBalancer.java
@@ -27,45 +27,48 @@
/**
* Used to update Load Balancers.
*
- * @author Adrian Cole
+ * @author Everett Toews
*/
-public class LoadBalancerUpdate {
-
- protected String name;
- protected String protocol;
- protected Integer port;
- protected Algorithm algorithm;
- protected Integer timeout;
- protected Boolean halfClosed;
-
- public LoadBalancerUpdate name(String name) {
+public class UpdateLoadBalancer {
+ private String name;
+ private String protocol;
+ private Integer port;
+ private Algorithm algorithm;
+ private Integer timeout;
+ private Boolean halfClosed;
+
+ protected UpdateLoadBalancer(String name, String protocol, Integer port, Algorithm algorithm, Integer timeout,
+ Boolean halfClosed) {
this.name = name;
- return this;
+ this.protocol = protocol;
+ this.port = port;
+ this.algorithm = algorithm;
+ this.timeout = timeout;
+ this.halfClosed = halfClosed;
}
- public LoadBalancerUpdate protocol(String protocol) {
- this.protocol = protocol;
- return this;
+ public String getName() {
+ return name;
}
- public LoadBalancerUpdate port(Integer port) {
- this.port = port;
- return this;
+ public String getProtocol() {
+ return protocol;
}
- public LoadBalancerUpdate algorithm(Algorithm algorithm) {
- this.algorithm = algorithm;
- return this;
+ public Integer getPort() {
+ return port;
}
- public LoadBalancerUpdate timeout(Integer timeout) {
- this.timeout = timeout;
- return this;
+ public Algorithm getAlgorithm() {
+ return algorithm;
}
- public LoadBalancerUpdate halfClosed(Boolean halfClosed) {
- this.halfClosed = halfClosed;
- return this;
+ public Integer getTimeout() {
+ return timeout;
+ }
+
+ public Boolean isHalfClosed() {
+ return halfClosed;
}
protected ToStringHelper string() {
@@ -90,58 +93,83 @@ public boolean equals(Object obj) {
if (obj == null || getClass() != obj.getClass())
return false;
- LoadBalancerUpdate that = LoadBalancerUpdate.class.cast(obj);
+ UpdateLoadBalancer that = UpdateLoadBalancer.class.cast(obj);
return Objects.equal(this.name, that.name) && Objects.equal(this.algorithm, that.algorithm)
&& Objects.equal(this.port, that.port) && Objects.equal(this.protocol, that.protocol)
&& Objects.equal(this.timeout, that.timeout) && Objects.equal(this.halfClosed, that.halfClosed);
}
public static class Builder {
+ private String name;
+ private String protocol;
+ private Integer port;
+ private Algorithm algorithm;
+ private Integer timeout;
+ private Boolean halfClosed;
+
/**
* @see BaseLoadBalancer.Builder#name(String)
*/
- public static LoadBalancerUpdate name(String name) {
- return new LoadBalancerUpdate().name(name);
+ public Builder name(String name) {
+ this.name = name;
+ return this;
}
/**
* @see BaseLoadBalancer.Builder#protocol(String)
*/
- public static LoadBalancerUpdate protocol(String protocol) {
- return new LoadBalancerUpdate().protocol(protocol);
+ public Builder protocol(String protocol) {
+ this.protocol = protocol;
+ return this;
}
/**
* @see BaseLoadBalancer.Builder#port(Integer)
*/
- public static LoadBalancerUpdate port(Integer port) {
- return new LoadBalancerUpdate().port(port);
+ public Builder port(Integer port) {
+ this.port = port;
+ return this;
}
/**
* @see BaseLoadBalancer.Builder#algorithm(Algorithm)
*/
- public static LoadBalancerUpdate algorithm(Algorithm algorithm) {
- return new LoadBalancerUpdate().algorithm(algorithm);
+ public Builder algorithm(Algorithm algorithm) {
+ this.algorithm = algorithm;
+ return this;
}
/**
* @see BaseLoadBalancer.Builder#timeout(Integer)
*/
- public static LoadBalancerUpdate timeout(Integer timeout) {
- return new LoadBalancerUpdate().timeout(timeout);
+ public Builder timeout(Integer timeout) {
+ this.timeout = timeout;
+ return this;
}
/**
* @see BaseLoadBalancer.Builder#halfClosed(Boolean)
*/
- public static LoadBalancerUpdate halfClosed(Boolean halfClosed) {
- return new LoadBalancerUpdate().halfClosed(halfClosed);
+ public Builder halfClosed(Boolean halfClosed) {
+ this.halfClosed = halfClosed;
+ return this;
}
+
+ public UpdateLoadBalancer build() {
+ return new UpdateLoadBalancer(name, protocol, port, algorithm, timeout, halfClosed);
+ }
+
+ public Builder from(UpdateLoadBalancer lb) {
+ return this.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 static <T extends BaseLoadBalancer<?, T>> 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 Builder toBuilder() {
+ return new Builder().from(this);
}
}
View
69 ...pace/cloudloadbalancers/v1/domain/NodeUpdate.java → ...pace/cloudloadbalancers/v1/domain/UpdateNode.java
@@ -28,27 +28,29 @@
/**
* 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;
+ this.type = type;
+ this.weight = weight;
}
- public NodeUpdate type(Type type) {
- this.type = type;
- return this;
+ public Condition getCondition() {
+ return condition;
}
- public NodeUpdate weight(Integer weight) {
- this.weight = weight;
- return this;
+ public Type getType() {
+ return type;
+ }
+
+ public Integer getWeight() {
+ return weight;
}
protected ToStringHelper string() {
@@ -71,36 +73,55 @@ public boolean equals(Object obj) {
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 Builder builder() {
+ return new Builder();
}
- public static <T extends BaseNode<T>> NodeUpdate fromNode(T n) {
- return Builder.condition(n.getCondition()).type(n.getType()).weight(n.getWeight());
+ public Builder toBuilder() {
+ return new Builder().from(this);
}
}
View
8 ...oudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApi.java
@@ -24,8 +24,8 @@
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 @@
* 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 @@
* 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.
View
12 ...adbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerAsyncApi.java
@@ -44,8 +44,8 @@
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 @@
public interface LoadBalancerAsyncApi {
/**
- * @see LoadBalancerApi#create(LoadBalancerCreate)
+ * @see LoadBalancerApi#create(CreateLoadBalancer)
*/
@Named("lb:create")
@POST
@@ -80,17 +80,17 @@
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(NullOnNotFoundOr404.class)
@Path("/loadbalancers")
- ListenableFuture<LoadBalancer> create(@WrapWith("loadBalancer") LoadBalancerCreate lbCreate);
+ ListenableFuture<LoadBalancer> 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<Void> update(@PathParam("id") int id, @WrapWith("loadBalancer") LoadBalancerUpdate lbUpdate);
+ ListenableFuture<Void> update(@PathParam("id") int id, @WrapWith("loadBalancer") UpdateLoadBalancer updateLB);
/**
* @see LoadBalancerApi#list()
View
10 ...space-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java
@@ -26,8 +26,8 @@
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 @@
*/
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<Node> add(Iterable<NodeAdd> nodeAdds);
+ Set<Node> add(Iterable<AddNode> addNodes);
/**
* Update the attributes of a node.
*/
- void update(int id, NodeUpdate nodeUpdate);
+ void update(int id, UpdateNode updateNode);
/**
* List the nodes.
View
10 ...-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeAsyncApi.java
@@ -47,8 +47,8 @@
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 @@
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(NullOnNotFoundOr404.class)
@Path("/nodes")
- ListenableFuture<Set<Node>> add(@WrapWith("nodes") Iterable<NodeAdd> nodeAdds);
+ ListenableFuture<Set<Node>> add(@WrapWith("nodes") Iterable<AddNode> addNodes);
/**
- * @see NodeApi#update(int, NodeUpdate)
+ * @see NodeApi#update(int, UpdateNode)
*/
@Named("node:update")
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Path("/nodes/{id}")
- ListenableFuture<Void> update(@PathParam("id") int id, @WrapWith("node") NodeUpdate nodeUpdate);
+ ListenableFuture<Void> update(@PathParam("id") int id, @WrapWith("node") UpdateNode updateNode);
/**
* @see NodeApi#list()
View
12 ...ds/rackspace/cloudloadbalancers/v1/loadbalancer/strategy/CloudLoadBalancersLoadBalanceNodesStrategy.java
@@ -34,8 +34,8 @@
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 LoadBalancerMetadata createLoadBalancerInLocation(Location location, Stri
// 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<NodeMetadata, NodeAdd>() {
+ Iterables.transform(nodes, new Function<NodeMetadata, AddNode>() {
@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();
View
12 ...dbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java
@@ -30,8 +30,8 @@
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 void setupContext() {
}
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));
}
View
12 ...dbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ConnectionApiLiveTest.java
@@ -27,8 +27,8 @@
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 @@
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));
}
View
12 ...ancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ContentCachingApiLiveTest.java
@@ -24,8 +24,8 @@
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 @@
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));
}
View
12 ...adbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ErrorPageApiLiveTest.java
@@ -24,8 +24,8 @@
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 void setupContext() {
}
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));
}
View
12 ...lancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/HealthMonitorApiLiveTest.java
@@ -26,8 +26,8 @@
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 @@
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));
}
View
25 ...ancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiExpectTest.java
@@ -29,10 +29,10 @@
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 void testCreateLoadBalancer() throws Exception {
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<NodeAdd> nodeAdds = Sets.newHashSet(nodeAdd1, nodeAdd2);
+ Set<AddNode> 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 void testUpdateLoadBalancerAttributes() {
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() {
View
12 ...alancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/LoadBalancerApiLiveTest.java
@@ -30,10 +30,10 @@
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 void testCreateLoadBalancer() throws Exception {
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 void testCreateLoadBalancer() throws Exception {
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));
View
21 ...dloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiExpectTest.java
@@ -30,8 +30,8 @@
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 void testAddNodesInLoadBalancer() {
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/nodes-list.json")).build()
).getNodeApiForZoneAndLoadBalancer("DFW", 2000);
- NodeAdd nodeAdd1 = NodeAdd.builder()
+ AddNode addNode1 = AddNode.builder()
.address("10.1.1.1")
.condition(Node.Condition.ENABLED)
.port(80)
.weight(3)
.build();
- NodeAdd nodeAdd2 = NodeAdd.builder()
+ AddNode addNode2 = AddNode.builder()
.address("10.1.1.2")
.condition(Node.Condition.ENABLED)
.type(Node.Type.SECONDARY)
@@ -99,16 +99,16 @@ public void testAddNodesInLoadBalancer() {
.weight(8)
.build();
- NodeAdd nodeAdd3 = NodeAdd.builder()
+ AddNode addNode3 = AddNode.builder()
.address("10.1.1.3")
.condition(Node.Condition.DISABLED)
.port(80)
.weight(12)
.build();
- Set<NodeAdd> nodeAdds = ImmutableSortedSet.<NodeAdd> of(nodeAdd1, nodeAdd2, nodeAdd3);
+ Set<AddNode> addNodes = ImmutableSortedSet.<AddNode> of(addNode1, addNode2, addNode3);
- Set<Node> nodes = api.add(nodeAdds);
+ Set<Node> nodes = api.add(addNodes);
assertEquals(nodes, getExpectedNodes());
}
@@ -121,12 +121,13 @@ public void testUpdateAttributesForNodeInLoadBalancer() {
HttpResponse.builder().statusCode(200).build()
).getNodeApiForZoneAndLoadBalancer("DFW", 2000);
- NodeUpdate nodeUpdate = NodeUpdate.Builder
+ UpdateNode updateNode = UpdateNode.builder()
.condition(Node.Condition.DISABLED)
.type(Node.Type.SECONDARY)
- .weight(20);
+ .weight(20)
+ .build();
- api.update(410, nodeUpdate);
+ api.update(410, updateNode);
}
public void testRemoveNodeFromLoadBalancer() {
View
14 ...oudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java
@@ -37,11 +37,11 @@
import com.google.common.collect.Maps;
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.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.domain.LoadBalancer.Status;
import org.jclouds.rackspace.cloudloadbalancers.v1.domain.VirtualIP.Type;
import org.jclouds.rackspace.cloudloadbalancers.v1.features.LoadBalancerApi;
@@ -62,8 +62,8 @@ public void testCreateLoadBalancers() {
for (String zone : clbApi.getConfiguredZones()) {
Logger.getAnonymousLogger().info("starting lb in zone " + zone);
LoadBalancer lb = clbApi.getLoadBalancerApiForZone(zone).create(
- LoadBalancerCreate.builder().name(prefix + "-" + zone).protocol("HTTP").port(80).virtualIPType(
- Type.PUBLIC).node(NodeAdd.builder().address("192.168.1.1").port(8080).build()).build());
+ CreateLoadBalancer.builder().name(prefix + "-" + zone).protocol("HTTP").port(80).virtualIPType(
+ Type.PUBLIC).node(AddNode.builder().address("192.168.1.1").port(8080).build()).build());
nodes.put(lb, new HashSet<Node>());
assertTrue(awaitAvailable(clbApi.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
@@ -78,7 +78,7 @@ public void testAddNodes() throws Exception {
String region = lb.getRegion();
Logger.getAnonymousLogger().info("starting node on loadbalancer " + lb.getId() + " in region " + region);
Set<Node> newNodes = clbApi.getNodeApiForZoneAndLoadBalancer(region, lb.getId()).add(
- ImmutableSet.<NodeAdd> of(NodeAdd.builder().address("192.168.1.2").port(8080).build()));
+ ImmutableSet.<AddNode> 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 void testModifyNode() throws Exception {
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);
View
12 ...dloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/ReportApiLiveTest.java
@@ -30,10 +30,10 @@
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 @@
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));
}
View
12 ...ancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SSLTerminationApiLiveTest.java
@@ -25,8 +25,8 @@
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 @@
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));
}
View
12 ...rs/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/SessionPersistenceApiLiveTest.java
@@ -25,8 +25,8 @@
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 @@
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));
}
View
12 ...adbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/VirtualIPApiLiveTest.java
@@ -26,8 +26,8 @@
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 @@
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));
}
Please sign in to comment.
Something went wrong with that request. Please try again.