public class ServerPredicates extends Object
ServerCreated serverCreated = serverApi.create("my-server", image.getId(), flavor.getId());
if (!ServerPredicates.awaitActive(serverApi).apply(serverCreated.getId())) {
throw new TimeoutException("Timeout on server: " + serverCreated);
}
{@code
if (!ServerPredicates.awaitStatus(serverApi, ACTIVE, 300, 2).apply(server.getId())) {
throw new TimeoutException("Timeout on server: " + serverCreated);
}
| Modifier and Type | Class and Description |
|---|---|
static class |
ServerPredicates.ServerStatusPredicate |
| Constructor and Description |
|---|
ServerPredicates() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.base.Predicate<String> |
awaitActive(ServerApi serverApi)
Waits until a Server is ACTIVE.
|
static com.google.common.base.Predicate<String> |
awaitShutoff(ServerApi serverApi)
Waits until a Server is SHUTOFF.
|
static com.google.common.base.Predicate<String> |
awaitStatus(ServerApi serverApi,
Server.Status status,
long maxWaitInSec,
long periodInSec)
Waits until a Server reaches Status.
|
public static com.google.common.base.Predicate<String> awaitActive(ServerApi serverApi)
serverApi - The ServerApi in the region where your Server resides.public static com.google.common.base.Predicate<String> awaitShutoff(ServerApi serverApi)
serverApi - The ServerApi in the region where your Server resides.public static com.google.common.base.Predicate<String> awaitStatus(ServerApi serverApi, Server.Status status, long maxWaitInSec, long periodInSec)
serverApi - The ServerApi in the region where your Server resides.Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.