@Generated(value="software.amazon.awssdk:codegen") @ThreadSafe public interface IotDataPlaneAsyncClient extends SdkClient
builder() method.
IoT data enables secure, bi-directional communication between Internet-connected things (such as sensors, actuators, embedded devices, or smart appliances) and the Amazon Web Services cloud. It implements a broker for applications and things to publish messages over HTTP (Publish) and retrieve, update, and delete shadows. A shadow is a persistent representation of your things and their state in the Amazon Web Services cloud.
Find the endpoint address for actions in IoT data by running this CLI command:
aws iot describe-endpoint --endpoint-type iot:Data-ATS
The service name used by Amazon Web ServicesSignature Version 4 to sign requests is: iotdevicegateway.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider. |
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static IotDataPlaneAsyncClientBuilder |
builder()
Create a builder that can be used to configure and create a
IotDataPlaneAsyncClient. |
static IotDataPlaneAsyncClient |
create()
Create a
IotDataPlaneAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
default CompletableFuture<DeleteThingShadowResponse> |
deleteThingShadow(Consumer<DeleteThingShadowRequest.Builder> deleteThingShadowRequest)
Deletes the shadow for the specified thing.
|
default CompletableFuture<DeleteThingShadowResponse> |
deleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest)
Deletes the shadow for the specified thing.
|
default CompletableFuture<GetRetainedMessageResponse> |
getRetainedMessage(Consumer<GetRetainedMessageRequest.Builder> getRetainedMessageRequest)
Gets the details of a single retained message for the specified topic.
|
default CompletableFuture<GetRetainedMessageResponse> |
getRetainedMessage(GetRetainedMessageRequest getRetainedMessageRequest)
Gets the details of a single retained message for the specified topic.
|
default CompletableFuture<GetThingShadowResponse> |
getThingShadow(Consumer<GetThingShadowRequest.Builder> getThingShadowRequest)
Gets the shadow for the specified thing.
|
default CompletableFuture<GetThingShadowResponse> |
getThingShadow(GetThingShadowRequest getThingShadowRequest)
Gets the shadow for the specified thing.
|
default CompletableFuture<ListNamedShadowsForThingResponse> |
listNamedShadowsForThing(Consumer<ListNamedShadowsForThingRequest.Builder> listNamedShadowsForThingRequest)
Lists the shadows for the specified thing.
|
default CompletableFuture<ListNamedShadowsForThingResponse> |
listNamedShadowsForThing(ListNamedShadowsForThingRequest listNamedShadowsForThingRequest)
Lists the shadows for the specified thing.
|
default CompletableFuture<ListRetainedMessagesResponse> |
listRetainedMessages(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
|
default CompletableFuture<ListRetainedMessagesResponse> |
listRetainedMessages(ListRetainedMessagesRequest listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
|
default ListRetainedMessagesPublisher |
listRetainedMessagesPaginator(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
|
default ListRetainedMessagesPublisher |
listRetainedMessagesPaginator(ListRetainedMessagesRequest listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
|
default CompletableFuture<PublishResponse> |
publish(Consumer<PublishRequest.Builder> publishRequest)
Publishes an MQTT message.
|
default CompletableFuture<PublishResponse> |
publish(PublishRequest publishRequest)
Publishes an MQTT message.
|
default CompletableFuture<UpdateThingShadowResponse> |
updateThingShadow(Consumer<UpdateThingShadowRequest.Builder> updateThingShadowRequest)
Updates the shadow for the specified thing.
|
default CompletableFuture<UpdateThingShadowResponse> |
updateThingShadow(UpdateThingShadowRequest updateThingShadowRequest)
Updates the shadow for the specified thing.
|
serviceNameclosestatic final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider.static IotDataPlaneAsyncClient create()
IotDataPlaneAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static IotDataPlaneAsyncClientBuilder builder()
IotDataPlaneAsyncClient.default CompletableFuture<DeleteThingShadowResponse> deleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest)
Deletes the shadow for the specified thing.
Requires permission to access the DeleteThingShadow action.
For more information, see DeleteThingShadow in the IoT Developer Guide.
deleteThingShadowRequest - The input for the DeleteThingShadow operation.default CompletableFuture<DeleteThingShadowResponse> deleteThingShadow(Consumer<DeleteThingShadowRequest.Builder> deleteThingShadowRequest)
Deletes the shadow for the specified thing.
Requires permission to access the DeleteThingShadow action.
For more information, see DeleteThingShadow in the IoT Developer Guide.
This is a convenience which creates an instance of the DeleteThingShadowRequest.Builder avoiding the need
to create one manually via DeleteThingShadowRequest.builder()
deleteThingShadowRequest - A Consumer that will call methods on DeleteThingShadowRequest.Builder to create a request.
The input for the DeleteThingShadow operation.default CompletableFuture<GetRetainedMessageResponse> getRetainedMessage(GetRetainedMessageRequest getRetainedMessageRequest)
Gets the details of a single retained message for the specified topic.
This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages.
Requires permission to access the GetRetainedMessage action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
getRetainedMessageRequest - The input for the GetRetainedMessage operation.default CompletableFuture<GetRetainedMessageResponse> getRetainedMessage(Consumer<GetRetainedMessageRequest.Builder> getRetainedMessageRequest)
Gets the details of a single retained message for the specified topic.
This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages.
Requires permission to access the GetRetainedMessage action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
This is a convenience which creates an instance of the GetRetainedMessageRequest.Builder avoiding the
need to create one manually via GetRetainedMessageRequest.builder()
getRetainedMessageRequest - A Consumer that will call methods on GetRetainedMessageRequest.Builder to create a
request. The input for the GetRetainedMessage operation.default CompletableFuture<GetThingShadowResponse> getThingShadow(GetThingShadowRequest getThingShadowRequest)
Gets the shadow for the specified thing.
Requires permission to access the GetThingShadow action.
For more information, see GetThingShadow in the IoT Developer Guide.
getThingShadowRequest - The input for the GetThingShadow operation.default CompletableFuture<GetThingShadowResponse> getThingShadow(Consumer<GetThingShadowRequest.Builder> getThingShadowRequest)
Gets the shadow for the specified thing.
Requires permission to access the GetThingShadow action.
For more information, see GetThingShadow in the IoT Developer Guide.
This is a convenience which creates an instance of the GetThingShadowRequest.Builder avoiding the need to
create one manually via GetThingShadowRequest.builder()
getThingShadowRequest - A Consumer that will call methods on GetThingShadowRequest.Builder to create a request.
The input for the GetThingShadow operation.default CompletableFuture<ListNamedShadowsForThingResponse> listNamedShadowsForThing(ListNamedShadowsForThingRequest listNamedShadowsForThingRequest)
Lists the shadows for the specified thing.
Requires permission to access the ListNamedShadowsForThing action.
listNamedShadowsForThingRequest - default CompletableFuture<ListNamedShadowsForThingResponse> listNamedShadowsForThing(Consumer<ListNamedShadowsForThingRequest.Builder> listNamedShadowsForThingRequest)
Lists the shadows for the specified thing.
Requires permission to access the ListNamedShadowsForThing action.
This is a convenience which creates an instance of the ListNamedShadowsForThingRequest.Builder avoiding
the need to create one manually via ListNamedShadowsForThingRequest.builder()
listNamedShadowsForThingRequest - A Consumer that will call methods on ListNamedShadowsForThingRequest.Builder to create a
request.default CompletableFuture<ListRetainedMessagesResponse> listRetainedMessages(ListRetainedMessagesRequest listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.
To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
listRetainedMessagesRequest - default CompletableFuture<ListRetainedMessagesResponse> listRetainedMessages(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.
To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
This is a convenience which creates an instance of the ListRetainedMessagesRequest.Builder avoiding the
need to create one manually via ListRetainedMessagesRequest.builder()
listRetainedMessagesRequest - A Consumer that will call methods on ListRetainedMessagesRequest.Builder to create a
request.default ListRetainedMessagesPublisher listRetainedMessagesPaginator(ListRetainedMessagesRequest listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.
To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
This is a variant of
listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe
method will result in a new Subscription i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesPublisher publisher = client.listRetainedMessagesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesPublisher publisher = client.listRetainedMessagesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)
operation.
listRetainedMessagesRequest - default ListRetainedMessagesPublisher listRetainedMessagesPaginator(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest)
Lists summary information about the retained messages stored for the account.
This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.
To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
This is a variant of
listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe
method will result in a new Subscription i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesPublisher publisher = client.listRetainedMessagesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesPublisher publisher = client.listRetainedMessagesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)
operation.
This is a convenience which creates an instance of the ListRetainedMessagesRequest.Builder avoiding the
need to create one manually via ListRetainedMessagesRequest.builder()
listRetainedMessagesRequest - A Consumer that will call methods on ListRetainedMessagesRequest.Builder to create a
request.default CompletableFuture<PublishResponse> publish(PublishRequest publishRequest)
Publishes an MQTT message.
Requires permission to access the Publish action.
For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
publishRequest - The input for the Publish operation.default CompletableFuture<PublishResponse> publish(Consumer<PublishRequest.Builder> publishRequest)
Publishes an MQTT message.
Requires permission to access the Publish action.
For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
This is a convenience which creates an instance of the PublishRequest.Builder avoiding the need to create
one manually via PublishRequest.builder()
publishRequest - A Consumer that will call methods on PublishRequest.Builder to create a request. The input
for the Publish operation.default CompletableFuture<UpdateThingShadowResponse> updateThingShadow(UpdateThingShadowRequest updateThingShadowRequest)
Updates the shadow for the specified thing.
Requires permission to access the UpdateThingShadow action.
For more information, see UpdateThingShadow in the IoT Developer Guide.
updateThingShadowRequest - The input for the UpdateThingShadow operation.default CompletableFuture<UpdateThingShadowResponse> updateThingShadow(Consumer<UpdateThingShadowRequest.Builder> updateThingShadowRequest)
Updates the shadow for the specified thing.
Requires permission to access the UpdateThingShadow action.
For more information, see UpdateThingShadow in the IoT Developer Guide.
This is a convenience which creates an instance of the UpdateThingShadowRequest.Builder avoiding the need
to create one manually via UpdateThingShadowRequest.builder()
updateThingShadowRequest - A Consumer that will call methods on UpdateThingShadowRequest.Builder to create a request.
The input for the UpdateThingShadow operation.Copyright © 2023. All rights reserved.