public final class WebSocketUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DATA_FRAME_SIZE |
| Constructor and Description |
|---|
WebSocketUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> CompletableFuture<Void> |
asVoid(CompletableFuture<T> future)
Returns a void
CompletableFuture that completes when the input future does. |
static <T> CompletableFuture<Void> |
asVoid(CompletableFuture<T> future,
Function<Throwable,Throwable> exceptionMapper)
Returns a void
CompletableFuture that completes when the input future does. |
static <T> CompletableFuture<Void> |
asVoid(org.glassfish.grizzly.GrizzlyFuture<T> future)
Returns a void
CompletableFuture that completes when the input future does. |
static <T> CompletableFuture<Void> |
asVoid(org.glassfish.grizzly.GrizzlyFuture<T> future,
Function<Throwable,Throwable> exceptionMapper)
Returns a void
CompletableFuture that completes when the input future does. |
static <T> CompletableFuture<T> |
failedFuture(Throwable t)
Returns a
CompletableFuture immediately and exceptionally completed with the given t |
static Throwable |
mapWsException(Throwable t,
org.mule.runtime.http.api.ws.WebSocket webSocket)
Maps Grizzly
Throwable instances to Mule ones as defined in the Http Service API. |
static CompletableFuture<Void> |
streamInDataFrames(InputStream content,
DataFrameEmitter emitter,
Function<Throwable,Throwable> exceptionMapper) |
static CompletableFuture<Void> |
streamInDataFrames(InputStream content,
int frameSize,
DataFrameEmitter emitter,
Function<Throwable,Throwable> exceptionMapper) |
public static final int DEFAULT_DATA_FRAME_SIZE
public static CompletableFuture<Void> streamInDataFrames(InputStream content, DataFrameEmitter emitter, Function<Throwable,Throwable> exceptionMapper)
public static CompletableFuture<Void> streamInDataFrames(InputStream content, int frameSize, DataFrameEmitter emitter, Function<Throwable,Throwable> exceptionMapper)
public static <T> CompletableFuture<Void> asVoid(CompletableFuture<T> future)
CompletableFuture that completes when the input future does. Exceptional completions are also
propagated using the same completion exception.T - the generic type of the original future.future - a CompletableFuture of a random typeCompletableFuturepublic static <T> CompletableFuture<Void> asVoid(CompletableFuture<T> future, Function<Throwable,Throwable> exceptionMapper)
CompletableFuture that completes when the input future does. Exceptional completions are also
propagated but mapped through the exceptionMapperT - the generic type of the original future.future - a CompletableFuture of a random typeCompletableFuturepublic static <T> CompletableFuture<Void> asVoid(org.glassfish.grizzly.GrizzlyFuture<T> future)
CompletableFuture that completes when the input future does. Exceptional completions are also
propagated using the same completion exception.T - the generic type of the original future.future - a CompletableFuture of a random typeCompletableFuturepublic static <T> CompletableFuture<Void> asVoid(org.glassfish.grizzly.GrizzlyFuture<T> future, Function<Throwable,Throwable> exceptionMapper)
CompletableFuture that completes when the input future does. Exceptional completions are also
propagated but mapped through the exceptionMapperT - the generic type of the original future.future - a CompletableFuture of a random typeCompletableFuturepublic static <T> CompletableFuture<T> failedFuture(Throwable t)
CompletableFuture immediately and exceptionally completed with the given tT - the generic type of the futuret - a ThrowableCompletableFuturepublic static Throwable mapWsException(Throwable t, org.mule.runtime.http.api.ws.WebSocket webSocket)
Throwable instances to Mule ones as defined in the Http Service API.t - the Throwable to be mappedwebSocket - the WebSocket referred by the potentially mapped exception.Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.