|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.openstack.cinder.v1.predicates.VolumePredicates
public class VolumePredicates
Tests to see if volume has reached status. This class is most useful when paired with a RetryablePredicate as in the code below. This class can be used to block execution until the Volume status has reached a desired state. This is useful when your Volume needs to be 100% ready before you can continue with execution.
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 Summary | |
|---|---|
VolumePredicates()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VolumePredicates()
| Method Detail |
|---|
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||