public class LoadBalancerPredicates extends Object
LoadBalancer loadBalancer = loadBalancerApi.create(loadBalancerRequest);
RetryablePredicate<String> awaitAvailable = RetryablePredicate.create(
LoadBalancerPredicates.available(loadBalancerApi), 600, 10, 10, TimeUnit.SECONDS);
if (!awaitAvailable.apply(loadBalancer)) {
throw new TimeoutException("Timeout on loadBalancer: " + loadBalancer);
}
You can also use the static convenience methods as so.
LoadBalancer loadBalancer = loadBalancerApi.create(loadBalancerRequest);
if (!LoadBalancerPredicates.awaitAvailable(loadBalancerApi).apply(loadBalancer)) {
throw new TimeoutException("Timeout on loadBalancer: " + loadBalancer);
}
Constructor and Description |
---|
LoadBalancerPredicates() |
Modifier and Type | Method and Description |
---|---|
static com.google.common.base.Predicate<LoadBalancer> |
awaitAvailable(LoadBalancerApi loadBalancerApi)
Wait until a LoadBalancer is Available.
|
static com.google.common.base.Predicate<LoadBalancer> |
awaitDeleted(LoadBalancerApi loadBalancerApi)
Wait until a LoadBalancer no longer exists.
|
static com.google.common.base.Predicate<LoadBalancer> |
awaitStatus(LoadBalancerApi loadBalancerApi,
LoadBalancer.Status status,
long maxWaitInSec,
long periodInSec) |
public static com.google.common.base.Predicate<LoadBalancer> awaitAvailable(LoadBalancerApi loadBalancerApi)
loadBalancerApi
- The LoadBalancerApi in the zone where your LoadBalancer resides.public static com.google.common.base.Predicate<LoadBalancer> awaitDeleted(LoadBalancerApi loadBalancerApi)
loadBalancerApi
- The LoadBalancerApi in the zone where your LoadBalancer resides.public static com.google.common.base.Predicate<LoadBalancer> awaitStatus(LoadBalancerApi loadBalancerApi, LoadBalancer.Status status, long maxWaitInSec, long periodInSec)
Copyright © 2009-2013 jclouds. All Rights Reserved.