Class Utils
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.springcloud.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<String>DEPLOYMENT_PROCESSING_STATUSprivate static intPOLLING_INTERVAL
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisDeploymentDone(SpringCloudDeployment deployment)static <T> TpollUntil(Callable<T> callable, java.util.function.Predicate<T> predicate, int timeOutInSeconds)Get resource repeatedly until it match the predicate or timeout, will return null when meet exception with default pollingInterval = 1sstatic <T> TpollUntil(Callable<T> callable, java.util.function.Predicate<T> predicate, int timeOutInSeconds, int pollingInterval)Get resource repeatedly until it match the predicate or timeout, will return null when meet exception
-
-
-
Field Detail
-
POLLING_INTERVAL
private static final int POLLING_INTERVAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDeploymentDone
public static boolean isDeploymentDone(@Nullable SpringCloudDeployment deployment)
-
pollUntil
public static <T> T pollUntil(Callable<T> callable, @Nonnull java.util.function.Predicate<T> predicate, int timeOutInSeconds)
Get resource repeatedly until it match the predicate or timeout, will return null when meet exception with default pollingInterval = 1s- Parameters:
callable- callable to get resourcepredicate- function that evaluate the resourcetimeOutInSeconds- max time for the method- Returns:
- the first resource which fit the predicate or the last result before timeout
-
pollUntil
public static <T> T pollUntil(Callable<T> callable, @Nonnull java.util.function.Predicate<T> predicate, int timeOutInSeconds, int pollingInterval)
Get resource repeatedly until it match the predicate or timeout, will return null when meet exception- Parameters:
callable- callable to get resourcepredicate- function that evaluate the resourcetimeOutInSeconds- max time for the methodpollingInterval- polling interval- Returns:
- the first resource which fit the predicate or the last result before timeout
-
-