Class IotShadowV2Client
java.lang.Object
software.amazon.awssdk.iot.iotshadow.IotShadowV2Client
- All Implemented Interfaces:
AutoCloseable
The AWS IoT Device Shadow service adds shadows to AWS IoT thing objects. Shadows are a simple data store for device properties and state. Shadows can make a device’s state available to apps and other services whether the device is connected to AWS IoT or not.
AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases all resources used by the client.software.amazon.awssdk.crt.iot.StreamingOperationcreateNamedShadowDeltaUpdatedStream(NamedShadowDeltaUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowDeltaUpdatedEvent> options) Create a stream for NamedShadowDelta events for a named shadow of an AWS IoT thing.software.amazon.awssdk.crt.iot.StreamingOperationcreateNamedShadowUpdatedStream(NamedShadowUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowUpdatedEvent> options) Create a stream for ShadowUpdated events for a named shadow of an AWS IoT thing.software.amazon.awssdk.crt.iot.StreamingOperationcreateShadowDeltaUpdatedStream(ShadowDeltaUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowDeltaUpdatedEvent> options) Create a stream for ShadowDelta events for the (classic) shadow of an AWS IoT thing.software.amazon.awssdk.crt.iot.StreamingOperationcreateShadowUpdatedStream(ShadowUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowUpdatedEvent> options) Create a stream for ShadowUpdated events for the (classic) shadow of an AWS IoT thing.Deletes a named shadow for an AWS IoT thing.deleteShadow(DeleteShadowRequest request) Deletes the (classic) shadow for an AWS IoT thing.getNamedShadow(GetNamedShadowRequest request) Gets a named shadow for an AWS IoT thing.getShadow(GetShadowRequest request) Gets the (classic) shadow for an AWS IoT thing.static IotShadowV2ClientnewFromMqtt311(software.amazon.awssdk.crt.mqtt.MqttClientConnection protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options) Constructs a new IotShadowV2Client, using an MQTT311 client as transportstatic IotShadowV2ClientnewFromMqtt5(software.amazon.awssdk.crt.mqtt5.Mqtt5Client protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options) Constructs a new IotShadowV2Client, using an MQTT5 client as transportUpdate a named shadow for a device.updateShadow(UpdateShadowRequest request) Update a device's (classic) shadow.
-
Method Details
-
newFromMqtt5
public static IotShadowV2Client newFromMqtt5(software.amazon.awssdk.crt.mqtt5.Mqtt5Client protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options) Constructs a new IotShadowV2Client, using an MQTT5 client as transport- Parameters:
protocolClient- the MQTT5 client to useoptions- configuration options to use
-
newFromMqtt311
public static IotShadowV2Client newFromMqtt311(software.amazon.awssdk.crt.mqtt.MqttClientConnection protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options) Constructs a new IotShadowV2Client, using an MQTT311 client as transport- Parameters:
protocolClient- the MQTT311 client to useoptions- configuration options to use
-
close
public void close()Releases all resources used by the client. It is not valid to invoke operations on the client after it has been closed.- Specified by:
closein interfaceAutoCloseable
-
deleteNamedShadow
Deletes a named shadow for an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
deleteShadow
Deletes the (classic) shadow for an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
getNamedShadow
Gets a named shadow for an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
getShadow
Gets the (classic) shadow for an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
updateNamedShadow
Update a named shadow for a device. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
updateShadow
Update a device's (classic) shadow. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic- Parameters:
request- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
createNamedShadowDeltaUpdatedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createNamedShadowDeltaUpdatedStream(NamedShadowDeltaUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowDeltaUpdatedEvent> options) Create a stream for NamedShadowDelta events for a named shadow of an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic- Parameters:
request- modeled streaming operation subscription configurationoptions- set of callbacks that the operation should invoke in response to related events- Returns:
- a streaming operation which will invoke a callback every time a message is received on the associated MQTT topic
-
createNamedShadowUpdatedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createNamedShadowUpdatedStream(NamedShadowUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowUpdatedEvent> options) Create a stream for ShadowUpdated events for a named shadow of an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic- Parameters:
request- modeled streaming operation subscription configurationoptions- set of callbacks that the operation should invoke in response to related events- Returns:
- a streaming operation which will invoke a callback every time a message is received on the associated MQTT topic
-
createShadowDeltaUpdatedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createShadowDeltaUpdatedStream(ShadowDeltaUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowDeltaUpdatedEvent> options) Create a stream for ShadowDelta events for the (classic) shadow of an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic- Parameters:
request- modeled streaming operation subscription configurationoptions- set of callbacks that the operation should invoke in response to related events- Returns:
- a streaming operation which will invoke a callback every time a message is received on the associated MQTT topic
-
createShadowUpdatedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createShadowUpdatedStream(ShadowUpdatedSubscriptionRequest request, V2ClientStreamOptions<ShadowUpdatedEvent> options) Create a stream for ShadowUpdated events for the (classic) shadow of an AWS IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic- Parameters:
request- modeled streaming operation subscription configurationoptions- set of callbacks that the operation should invoke in response to related events- Returns:
- a streaming operation which will invoke a callback every time a message is received on the associated MQTT topic
-