Package software.amazon.awssdk.crt.mqtt
Class MqttClient
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.mqtt.MqttClient
- All Implemented Interfaces:
AutoCloseable
This class wraps aws-c-mqtt to provide the basic MQTT pub/sub functionalities
via the AWS Common Runtime
One MqttClient class is needed per application. It can create any number of connections to
any number of MQTT endpoints
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Constructor Summary
ConstructorsConstructorDescriptionCreates an MqttClient with no TLS from the default staticClientBootstrapMqttClient(ClientBootstrap clientBootstrap) Creates an MqttClient with no TLS from the providedClientBootstrapMqttClient(ClientBootstrap clientBootstrap, TlsContext context) Creates an MqttClient from the providedClientBootstrapandTlsContextMqttClient(TlsContext context) Creates an MqttClient with a default staticClientBootstrapand providedTlsContext -
Method Summary
Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
MqttClient
Creates an MqttClient with no TLS from the providedClientBootstrap- Parameters:
clientBootstrap- The ClientBootstrap to use- Throws:
CrtRuntimeException- If the system is unable to allocate space for a native MQTT client structure
-
MqttClient
Creates an MqttClient with no TLS from the default staticClientBootstrap- Throws:
CrtRuntimeException- If the system is unable to allocate space for a native MQTT client structure
-
MqttClient
Creates an MqttClient from the providedClientBootstrapandTlsContext- Parameters:
clientBootstrap- The ClientBootstrap to usecontext- the tls context to use- Throws:
CrtRuntimeException- If the system is unable to allocate space for a native MQTT client structure
-
MqttClient
Creates an MqttClient with a default staticClientBootstrapand providedTlsContext- Parameters:
context- the tls context to use- Throws:
CrtRuntimeException- If the system is unable to allocate space for a native MQTT client structure
-
-
Method Details
-
getTlsContext
- Returns:
- the tls context used by all connections associated with this client.
-