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
public class MqttClient extends CrtResource
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
Constructors Constructor Description MqttClient()
Creates an MqttClient with no TLS from the default staticClientBootstrap
MqttClient(ClientBootstrap clientBootstrap)
Creates an MqttClient with no TLS from the providedClientBootstrap
MqttClient(ClientBootstrap clientBootstrap, TlsContext context)
Creates an MqttClient from the providedClientBootstrap
andTlsContext
MqttClient(TlsContext context)
Creates an MqttClient with a default staticClientBootstrap
and providedTlsContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsContext
getTlsContext()
-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
-
-
-
Constructor Detail
-
MqttClient
public MqttClient(ClientBootstrap clientBootstrap) throws CrtRuntimeException
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
public MqttClient() throws CrtRuntimeException
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
public MqttClient(ClientBootstrap clientBootstrap, TlsContext context) throws CrtRuntimeException
Creates an MqttClient from the providedClientBootstrap
andTlsContext
- 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
public MqttClient(TlsContext context) throws CrtRuntimeException
Creates an MqttClient with a default staticClientBootstrap
and 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 Detail
-
getTlsContext
public TlsContext getTlsContext()
- Returns:
- the tls context used by all connections associated with this client.
-
-