Package software.amazon.awssdk.crt.mqtt5
Class Mqtt5WebsocketHandshakeTransformArgs
- java.lang.Object
-
- software.amazon.awssdk.crt.mqtt5.Mqtt5WebsocketHandshakeTransformArgs
-
public final class Mqtt5WebsocketHandshakeTransformArgs extends Object
Arguments to a websocket handshake transform operation. The transform may modify the http request before it is sent to the server. The transform MUST call complete() or completeExceptionally() when the transform is complete, failure to do so will stall the mqtt connection indefinitely. The transform operation may be asynchronous. The default websocket handshake http request uses path "/mqtt". All required headers for a websocket handshake are present, plus the optional header "Sec-WebSocket-Protocol: mqtt".
-
-
Constructor Summary
Constructors Constructor Description Mqtt5WebsocketHandshakeTransformArgs(Mqtt5Client mqttClient, HttpRequest httpRequest, CompletableFuture<HttpRequest> future)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete(HttpRequest signedRequest)
Mark the transform operation as successfully completed.void
completeExceptionally(Throwable ex)
Mark the transform operation as unsuccessfully completed.HttpRequest
getHttpRequest()
Get the http request that will be used to perform the websocket handshake.Mqtt5Client
getMqttClient()
Queries the Mqtt5Client.
-
-
-
Constructor Detail
-
Mqtt5WebsocketHandshakeTransformArgs
public Mqtt5WebsocketHandshakeTransformArgs(Mqtt5Client mqttClient, HttpRequest httpRequest, CompletableFuture<HttpRequest> future)
- Parameters:
mqttClient
- Mqtt5Client that is establishing a websocket connectionhttpRequest
- http request that may be modified by the transform operationfuture
- Future to complete when the transform is complete.
-
-
Method Detail
-
getMqttClient
public Mqtt5Client getMqttClient()
Queries the Mqtt5Client.- Returns:
- the Mqtt5Client.
-
getHttpRequest
public HttpRequest getHttpRequest()
Get the http request that will be used to perform the websocket handshake. The transform operation may modify this request.- Returns:
- The http request that will be used to perform the websocket handshake
-
complete
public void complete(HttpRequest signedRequest)
Mark the transform operation as successfully completed. The websocket connection will proceed, using the http request.- Parameters:
signedRequest
- completed request
-
completeExceptionally
public void completeExceptionally(Throwable ex)
Mark the transform operation as unsuccessfully completed. The websocket connection attempt will be canceled.- Parameters:
ex
- the exception
-
-