mirror of https://github.com/apache/jclouds.git
commented out code that references missing classes
This commit is contained in:
parent
13c9828345
commit
3bce2e0d94
|
@ -35,7 +35,6 @@ import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.compute.predicates.NodePredicates;
|
import org.jclouds.compute.predicates.NodePredicates;
|
||||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||||
import org.jclouds.compute.strategy.DestroyLoadBalancerStrategy;
|
import org.jclouds.compute.strategy.DestroyLoadBalancerStrategy;
|
||||||
import org.jclouds.compute.strategy.ListLoadBalancersStrategy;
|
|
||||||
import org.jclouds.compute.strategy.LoadBalanceNodesStrategy;
|
import org.jclouds.compute.strategy.LoadBalanceNodesStrategy;
|
||||||
import org.jclouds.domain.Location;
|
import org.jclouds.domain.Location;
|
||||||
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
|
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
|
||||||
|
@ -44,6 +43,7 @@ import org.jclouds.logging.Logger;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
@ -69,23 +69,20 @@ public class BaseLoadBalancerService implements LoadBalancerService {
|
||||||
protected final ComputeServiceContext context;
|
protected final ComputeServiceContext context;
|
||||||
protected final LoadBalanceNodesStrategy loadBalancerStrategy;
|
protected final LoadBalanceNodesStrategy loadBalancerStrategy;
|
||||||
protected final DestroyLoadBalancerStrategy destroyLoadBalancerStrategy;
|
protected final DestroyLoadBalancerStrategy destroyLoadBalancerStrategy;
|
||||||
protected final ListLoadBalancersStrategy listLoadBalancersStrategy;
|
// protected final ListLoadBalancersStrategy listLoadBalancersStrategy;
|
||||||
protected final BackoffLimitedRetryHandler backoffLimitedRetryHandler;
|
protected final BackoffLimitedRetryHandler backoffLimitedRetryHandler;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected BaseLoadBalancerService(ComputeServiceContext context,
|
protected BaseLoadBalancerService(ComputeServiceContext context, LoadBalanceNodesStrategy loadBalancerStrategy,
|
||||||
LoadBalanceNodesStrategy loadBalancerStrategy,
|
|
||||||
DestroyLoadBalancerStrategy destroyLoadBalancerStrategy,
|
DestroyLoadBalancerStrategy destroyLoadBalancerStrategy,
|
||||||
ListLoadBalancersStrategy listLoadBalancersStrategy,
|
// ListLoadBalancersStrategy listLoadBalancersStrategy,
|
||||||
BackoffLimitedRetryHandler backoffLimitedRetryHandler) {
|
BackoffLimitedRetryHandler backoffLimitedRetryHandler) {
|
||||||
this.context = checkNotNull(context, "context");
|
this.context = checkNotNull(context, "context");
|
||||||
this.loadBalancerStrategy = checkNotNull(loadBalancerStrategy, "loadBalancerStrategy");
|
this.loadBalancerStrategy = checkNotNull(loadBalancerStrategy, "loadBalancerStrategy");
|
||||||
this.destroyLoadBalancerStrategy = checkNotNull(destroyLoadBalancerStrategy,
|
this.destroyLoadBalancerStrategy = checkNotNull(destroyLoadBalancerStrategy, "destroyLoadBalancerStrategy");
|
||||||
"destroyLoadBalancerStrategy");
|
// this.listLoadBalancersStrategy = checkNotNull(listLoadBalancersStrategy,
|
||||||
this.listLoadBalancersStrategy = checkNotNull(listLoadBalancersStrategy,
|
// "listLoadBalancersStrategy");
|
||||||
"listLoadBalancersStrategy");
|
this.backoffLimitedRetryHandler = checkNotNull(backoffLimitedRetryHandler, "backoffLimitedRetryHandler");
|
||||||
this.backoffLimitedRetryHandler = checkNotNull(backoffLimitedRetryHandler,
|
|
||||||
"backoffLimitedRetryHandler");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,17 +94,16 @@ public class BaseLoadBalancerService implements LoadBalancerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> loadBalanceNodesMatching(Predicate<NodeMetadata> filter,
|
public Set<String> loadBalanceNodesMatching(Predicate<NodeMetadata> filter, String loadBalancerName,
|
||||||
String loadBalancerName, String protocol, int loadBalancerPort, int instancePort) {
|
String protocol, int loadBalancerPort, int instancePort) {
|
||||||
checkNotNull(loadBalancerName, "loadBalancerName");
|
checkNotNull(loadBalancerName, "loadBalancerName");
|
||||||
checkNotNull(protocol, "protocol");
|
checkNotNull(protocol, "protocol");
|
||||||
checkArgument(protocol.toUpperCase().equals("HTTP") || protocol.toUpperCase().equals("TCP"),
|
checkArgument(protocol.toUpperCase().equals("HTTP") || protocol.toUpperCase().equals("TCP"),
|
||||||
"Acceptable values for protocol are HTTP or TCP");
|
"Acceptable values for protocol are HTTP or TCP");
|
||||||
|
|
||||||
Map<Location, Set<String>> locationMap = Maps.newHashMap();
|
Map<Location, Set<String>> locationMap = Maps.newHashMap();
|
||||||
for (NodeMetadata node : Iterables.filter(context.getComputeService()
|
for (NodeMetadata node : Iterables.filter(context.getComputeService().listNodesDetailsMatching(
|
||||||
.listNodesDetailsMatching(NodePredicates.all()), Predicates.and(filter, Predicates
|
NodePredicates.all()), Predicates.and(filter, Predicates.not(NodePredicates.TERMINATED)))) {
|
||||||
.not(NodePredicates.TERMINATED)))) {
|
|
||||||
Set<String> ids = locationMap.get(node.getLocation());
|
Set<String> ids = locationMap.get(node.getLocation());
|
||||||
if (ids == null)
|
if (ids == null)
|
||||||
ids = Sets.newHashSet();
|
ids = Sets.newHashSet();
|
||||||
|
@ -117,8 +113,8 @@ public class BaseLoadBalancerService implements LoadBalancerService {
|
||||||
Set<String> dnsNames = Sets.newHashSet();
|
Set<String> dnsNames = Sets.newHashSet();
|
||||||
for (Location location : locationMap.keySet()) {
|
for (Location location : locationMap.keySet()) {
|
||||||
logger.debug(">> creating load balancer (%s)", loadBalancerName);
|
logger.debug(">> creating load balancer (%s)", loadBalancerName);
|
||||||
String dnsName = loadBalancerStrategy.execute(location, loadBalancerName, protocol,
|
String dnsName = loadBalancerStrategy.execute(location, loadBalancerName, protocol, loadBalancerPort,
|
||||||
loadBalancerPort, instancePort, locationMap.get(location));
|
instancePort, locationMap.get(location));
|
||||||
dnsNames.add(dnsName);
|
dnsNames.add(dnsName);
|
||||||
logger.debug("<< created load balancer (%s) DNS (%s)", loadBalancerName, dnsName);
|
logger.debug("<< created load balancer (%s) DNS (%s)", loadBalancerName, dnsName);
|
||||||
}
|
}
|
||||||
|
@ -136,10 +132,11 @@ public class BaseLoadBalancerService implements LoadBalancerService {
|
||||||
logger.debug("<< destroyed load balancer(%s) success(%s)", loadBalancer, successful);
|
logger.debug("<< destroyed load balancer(%s) success(%s)", loadBalancer, successful);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> listLoadBalancers()
|
public Set<String> listLoadBalancers() {
|
||||||
{
|
return ImmutableSet.of();
|
||||||
Set<String> loadBalancerSet = listLoadBalancersStrategy.execute();
|
// TODO
|
||||||
return loadBalancerSet;
|
// Set<String> loadBalancerSet = listLoadBalancersStrategy.execute();
|
||||||
|
// return loadBalancerSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue