Class IotShadowV2Client

  • All Implemented Interfaces:
    AutoCloseable

    public class IotShadowV2Client
    extends Object
    implements 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 Detail

      • 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 use
        options - 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 use
        options - 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:
        close in interface AutoCloseable
      • deleteNamedShadow

        public CompletableFuture<DeleteShadowResponse> deleteNamedShadow​(DeleteNamedShadowRequest request)
        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

        public CompletableFuture<DeleteShadowResponse> deleteShadow​(DeleteShadowRequest request)
        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

        public CompletableFuture<GetShadowResponse> getNamedShadow​(GetNamedShadowRequest request)
        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

        public CompletableFuture<GetShadowResponse> getShadow​(GetShadowRequest request)
        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

        public CompletableFuture<UpdateShadowResponse> updateNamedShadow​(UpdateNamedShadowRequest request)
        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

        public CompletableFuture<UpdateShadowResponse> updateShadow​(UpdateShadowRequest request)
        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 configuration
        options - 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 configuration
        options - 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 configuration
        options - 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 configuration
        options - 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