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.
{@code Volume volume = volumeApi.create(100); RetryablePredicate 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.
{@code Volume volume = volumeApi.create(100);}if (!VolumePredicates.awaitAvailable(volumeApi).apply(volume.getId())) throw new TimeoutException("Timeout on volume: " + volume); } }
@author Everett Toews