public class VolumePredicates extends Object
Volume volume = volumeApi.create(100);
RetryablePredicate<String> awaitAvailable = new RetryablePredicate<String>(
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 RetryablePredicate<Volume> |
awaitAvailable(VolumeApi volumeApi)
Wait until a Volume is Available.
|
static RetryablePredicate<Volume> |
awaitDeleted(VolumeApi volumeApi)
Wait until a Volume no longer exists.
|
static RetryablePredicate<Volume> |
awaitInUse(VolumeApi volumeApi)
Wait until a Volume is In Use.
|
static RetryablePredicate<Volume> |
awaitStatus(VolumeApi volumeApi,
Volume.Status status,
long maxWaitInSec,
long periodInSec) |
public static RetryablePredicate<Volume> awaitAvailable(VolumeApi volumeApi)
volumeApi
- The VolumeApi in the zone where your Volume resides.public static RetryablePredicate<Volume> awaitInUse(VolumeApi volumeApi)
volumeApi
- The VolumeApi in the zone where your Volume resides.public static RetryablePredicate<Volume> awaitDeleted(VolumeApi volumeApi)
volumeApi
- The VolumeApi in the zone where your Volume resides.public static RetryablePredicate<Volume> awaitStatus(VolumeApi volumeApi, Volume.Status status, long maxWaitInSec, long periodInSec)
Copyright © 2009-2013 jclouds. All Rights Reserved.