public final class SphereClientUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
blockingWait(CompletionStage<T> completionStage,
Duration duration)
Waits with a timeout for RESPONSES of a Composable Commerce client wrapped in a
CompletionStage. |
static <T> T |
blockingWait(CompletionStage<T> completionStage,
long timeout,
TimeUnit unit)
Waits with a timeout for RESPONSES of a Composable Commerce client wrapped in a
CompletionStage. |
static <T> T |
blockingWait(CompletionStage<T> completionStage,
SphereRequest<T> sphereRequest,
Duration duration)
Waits with a timeout for RESPONSES of a Composable Commerce client wrapped in a
CompletionStage. |
static <T> T |
blockingWait(CompletionStage<T> completionStage,
SphereRequest<T> sphereRequest,
long timeout,
TimeUnit unit)
Waits with a timeout for RESPONSES of a Composable Commerce client wrapped in a
CompletionStage. |
static <T> List<T> |
blockingWaitForEach(List<? extends CompletionStage<T>> list,
Duration duration) |
static <T> List<T> |
blockingWaitForEach(List<? extends CompletionStage<T>> list,
long timeout,
TimeUnit unit) |
static <T> List<T> |
blockingWaitForEach(Stream<? extends CompletionStage<T>> stream,
Duration duration) |
static <T> List<T> |
blockingWaitForEach(Stream<? extends CompletionStage<T>> stream,
long timeout,
TimeUnit unit) |
static <S extends CompletionStage<T>,T> |
blockingWaitForEachCollector(Duration duration) |
static <S extends CompletionStage<T>,T> |
blockingWaitForEachCollector(long timeout,
TimeUnit unit) |
public static <T> T blockingWait(CompletionStage<T> completionStage, SphereRequest<T> sphereRequest, Duration duration)
CompletionStage.
This method should not be used for other CompletionStages since it is throwing SphereExceptions.T - type of the result for the requestcompletionStage - the future monad to wait forsphereRequest - the request belonging to the completionStageduration - the maximum duration to wait for this single requestcompletionStageSphereTimeoutException - if a timeout occurspublic static <T> T blockingWait(CompletionStage<T> completionStage, Duration duration)
CompletionStage.
This method should not be used for other CompletionStages since it is throwing SphereExceptions.T - type of the result for the requestcompletionStage - the future monad to wait forduration - the maximum duration to wait for this single requestcompletionStageSphereTimeoutException - if a timeout occurspublic static <T> T blockingWait(CompletionStage<T> completionStage, long timeout, TimeUnit unit)
CompletionStage.
This method should not be used for other CompletionStages since it is throwing SphereExceptions.T - type of the result for the requestcompletionStage - the future monad to wait fortimeout - the maximum time to wait for this single requestunit - the time unit of the timeout argumentcompletionStageSphereTimeoutException - if a timeout occurspublic static <T> T blockingWait(CompletionStage<T> completionStage, SphereRequest<T> sphereRequest, long timeout, TimeUnit unit)
CompletionStage.
This method should not be used for other CompletionStages since it is throwing SphereExceptions.T - type of the result for the requestcompletionStage - the future monad to wait forsphereRequest - the request belonging to the completionStagetimeout - the maximum time to wait for this single requestunit - the time unit of the timeout argumentcompletionStageSphereTimeoutException - if a timeout occurspublic static <T> List<T> blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, Duration duration)
public static <T> List<T> blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, long timeout, TimeUnit unit)
public static <T> List<T> blockingWaitForEach(List<? extends CompletionStage<T>> list, Duration duration)
public static <T> List<T> blockingWaitForEach(List<? extends CompletionStage<T>> list, long timeout, TimeUnit unit)
public static <S extends CompletionStage<T>,T> Collector<S,?,List<T>> blockingWaitForEachCollector(long timeout, TimeUnit unit)
public static <S extends CompletionStage<T>,T> Collector<S,?,List<T>> blockingWaitForEachCollector(Duration duration)