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