Package io.vrap.rmf.base.client.utils
Class ClientUtils
java.lang.Object
io.vrap.rmf.base.client.utils.ClientUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TblockingWait(CompletionStage<T> completionStage, long timeout, TimeUnit unit) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage.static <T> TblockingWait(CompletionStage<T> completionStage, ApiHttpRequest request, long timeout, TimeUnit unit) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage.static <T> TblockingWait(CompletionStage<T> completionStage, ApiHttpRequest request, Duration duration) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage.static <T> TblockingWait(CompletionStage<T> completionStage, Duration duration) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage.static <T> List<T>blockingWaitForEach(List<? extends CompletionStage<T>> list, long timeout, TimeUnit unit) static <T> List<T>blockingWaitForEach(List<? extends CompletionStage<T>> list, Duration duration) static <T> List<T>blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, long timeout, TimeUnit unit) static <T> List<T>blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, Duration duration) static <S extends CompletionStage<T>,T>
Collector<S,?, List<T>> blockingWaitForEachCollector(long timeout, TimeUnit unit) static <S extends CompletionStage<T>,T>
Collector<S,?, List<T>> blockingWaitForEachCollector(Duration duration)
-
Constructor Details
-
ClientUtils
public ClientUtils()
-
-
Method Details
-
blockingWait
public static <T> T blockingWait(CompletionStage<T> completionStage, ApiHttpRequest request, Duration duration) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage. This method should not be used for otherCompletionStages since it is throwingBaseExceptions.- Type Parameters:
T- type of the result for the request- Parameters:
completionStage- the future monad to wait forrequest- the request belonging to the completionStageduration- the maximum duration to wait for this single request- Returns:
- the wrapped value of
completionStage - Throws:
RmfTimeoutException- if a timeout occurs
-
blockingWait
Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage. This method should not be used for otherCompletionStages since it is throwingBaseExceptions.- Type Parameters:
T- type of the result for the request- Parameters:
completionStage- the future monad to wait forduration- the maximum duration to wait for this single request- Returns:
- the wrapped value of
completionStage - Throws:
RmfTimeoutException- if a timeout occurs
-
blockingWait
Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage. This method should not be used for otherCompletionStages since it is throwingBaseExceptions.- Type Parameters:
T- type of the result for the request- Parameters:
completionStage- the future monad to wait fortimeout- the maximum time to wait for this single requestunit- the time unit of the timeout argument- Returns:
- the wrapped value of
completionStage - Throws:
RmfTimeoutException- if a timeout occurs
-
blockingWait
public static <T> T blockingWait(CompletionStage<T> completionStage, ApiHttpRequest request, long timeout, TimeUnit unit) Waits with a timeout for RESPONSES of a client wrapped in aCompletionStage. This method should not be used for otherCompletionStages since it is throwingBaseExceptions.- Type Parameters:
T- type of the result for the request- Parameters:
completionStage- the future monad to wait forrequest- the request belonging to the completionStagetimeout- the maximum time to wait for this single requestunit- the time unit of the timeout argument- Returns:
- the wrapped value of
completionStage - Throws:
RmfTimeoutException- if a timeout occurs
-
blockingWaitForEach
public static <T> List<T> blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, Duration duration) -
blockingWaitForEach
public static <T> List<T> blockingWaitForEach(Stream<? extends CompletionStage<T>> stream, long timeout, TimeUnit unit) -
blockingWaitForEach
public static <T> List<T> blockingWaitForEach(List<? extends CompletionStage<T>> list, Duration duration) -
blockingWaitForEach
public static <T> List<T> blockingWaitForEach(List<? extends CompletionStage<T>> list, long timeout, TimeUnit unit) -
blockingWaitForEachCollector
public static <S extends CompletionStage<T>,T> Collector<S,?, blockingWaitForEachCollectorList<T>> (long timeout, TimeUnit unit) -
blockingWaitForEachCollector
public static <S extends CompletionStage<T>,T> Collector<S,?, blockingWaitForEachCollectorList<T>> (Duration duration)
-