Interface IotDataPlaneClient
- All Superinterfaces:
- AutoCloseable,- AwsClient,- SdkAutoCloseable,- 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.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String
- 
Method SummaryModifier and TypeMethodDescriptionstatic IotDataPlaneClientBuilderbuilder()Create a builder that can be used to configure and create aIotDataPlaneClient.static IotDataPlaneClientcreate()Create aIotDataPlaneClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default DeleteConnectionResponsedeleteConnection(Consumer<DeleteConnectionRequest.Builder> deleteConnectionRequest) Disconnects a connected MQTT client from Amazon Web Services IoT Core.default DeleteConnectionResponsedeleteConnection(DeleteConnectionRequest deleteConnectionRequest) Disconnects a connected MQTT client from Amazon Web Services IoT Core.default DeleteThingShadowResponsedeleteThingShadow(Consumer<DeleteThingShadowRequest.Builder> deleteThingShadowRequest) Deletes the shadow for the specified thing.default DeleteThingShadowResponsedeleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest) Deletes the shadow for the specified thing.default GetRetainedMessageResponsegetRetainedMessage(Consumer<GetRetainedMessageRequest.Builder> getRetainedMessageRequest) Gets the details of a single retained message for the specified topic.default GetRetainedMessageResponsegetRetainedMessage(GetRetainedMessageRequest getRetainedMessageRequest) Gets the details of a single retained message for the specified topic.default GetThingShadowResponsegetThingShadow(Consumer<GetThingShadowRequest.Builder> getThingShadowRequest) Gets the shadow for the specified thing.default GetThingShadowResponsegetThingShadow(GetThingShadowRequest getThingShadowRequest) Gets the shadow for the specified thing.default ListNamedShadowsForThingResponselistNamedShadowsForThing(Consumer<ListNamedShadowsForThingRequest.Builder> listNamedShadowsForThingRequest) Lists the shadows for the specified thing.default ListNamedShadowsForThingResponselistNamedShadowsForThing(ListNamedShadowsForThingRequest listNamedShadowsForThingRequest) Lists the shadows for the specified thing.default ListRetainedMessagesResponselistRetainedMessages(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest) Lists summary information about the retained messages stored for the account.default ListRetainedMessagesResponselistRetainedMessages(ListRetainedMessagesRequest listRetainedMessagesRequest) Lists summary information about the retained messages stored for the account.default ListRetainedMessagesIterablelistRetainedMessagesPaginator(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest) This is a variant oflistRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)operation.default ListRetainedMessagesIterablelistRetainedMessagesPaginator(ListRetainedMessagesRequest listRetainedMessagesRequest) This is a variant oflistRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)operation.default PublishResponsepublish(Consumer<PublishRequest.Builder> publishRequest) Publishes an MQTT message.default PublishResponsepublish(PublishRequest publishRequest) Publishes an MQTT message.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadatadefault UpdateThingShadowResponseupdateThingShadow(Consumer<UpdateThingShadowRequest.Builder> updateThingShadowRequest) Updates the shadow for the specified thing.default UpdateThingShadowResponseupdateThingShadow(UpdateThingShadowRequest updateThingShadowRequest) Updates the shadow for the specified thing.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseablecloseMethods inherited from interface software.amazon.awssdk.core.SdkClientserviceName
- 
Field Details- 
SERVICE_NAME- See Also:
 
- 
SERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.- See Also:
 
 
- 
- 
Method Details- 
deleteConnectiondefault DeleteConnectionResponse deleteConnection(DeleteConnectionRequest deleteConnectionRequest) throws ForbiddenException, ResourceNotFoundException, InvalidRequestException, ThrottlingException, InternalFailureException, AwsServiceException, SdkClientException, IotDataPlaneException Disconnects a connected MQTT client from Amazon Web Services IoT Core. When you disconnect a client, Amazon Web Services IoT Core closes the client's network connection and optionally cleans the session state. - Parameters:
- deleteConnectionRequest-
- Returns:
- Result of the DeleteConnection operation returned by the service.
- See Also:
 
- 
deleteConnectiondefault DeleteConnectionResponse deleteConnection(Consumer<DeleteConnectionRequest.Builder> deleteConnectionRequest) throws ForbiddenException, ResourceNotFoundException, InvalidRequestException, ThrottlingException, InternalFailureException, AwsServiceException, SdkClientException, IotDataPlaneException Disconnects a connected MQTT client from Amazon Web Services IoT Core. When you disconnect a client, Amazon Web Services IoT Core closes the client's network connection and optionally cleans the session state. 
 This is a convenience which creates an instance of the DeleteConnectionRequest.Builderavoiding the need to create one manually viaDeleteConnectionRequest.builder()- Parameters:
- deleteConnectionRequest- A- Consumerthat will call methods on- DeleteConnectionRequest.Builderto create a request.
- Returns:
- Result of the DeleteConnection operation returned by the service.
- See Also:
 
- 
deleteThingShadowdefault DeleteThingShadowResponse deleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest) throws ResourceNotFoundException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide. - Parameters:
- deleteThingShadowRequest- The input for the DeleteThingShadow operation.
- Returns:
- Result of the DeleteThingShadow operation returned by the service.
- See Also:
 
- 
deleteThingShadowdefault DeleteThingShadowResponse deleteThingShadow(Consumer<DeleteThingShadowRequest.Builder> deleteThingShadowRequest) throws ResourceNotFoundException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaDeleteThingShadowRequest.builder()- Parameters:
- deleteThingShadowRequest- A- Consumerthat will call methods on- DeleteThingShadowRequest.Builderto create a request. The input for the DeleteThingShadow operation.
- Returns:
- Result of the DeleteThingShadow operation returned by the service.
- See Also:
 
- 
getRetainedMessagedefault GetRetainedMessageResponse getRetainedMessage(GetRetainedMessageRequest getRetainedMessageRequest) throws InvalidRequestException, ResourceNotFoundException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException 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. - Parameters:
- getRetainedMessageRequest- The input for the GetRetainedMessage operation.
- Returns:
- Result of the GetRetainedMessage operation returned by the service.
- See Also:
 
- 
getRetainedMessagedefault GetRetainedMessageResponse getRetainedMessage(Consumer<GetRetainedMessageRequest.Builder> getRetainedMessageRequest) throws InvalidRequestException, ResourceNotFoundException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaGetRetainedMessageRequest.builder()- Parameters:
- getRetainedMessageRequest- A- Consumerthat will call methods on- GetRetainedMessageRequest.Builderto create a request. The input for the GetRetainedMessage operation.
- Returns:
- Result of the GetRetainedMessage operation returned by the service.
- See Also:
 
- 
getThingShadowdefault GetThingShadowResponse getThingShadow(GetThingShadowRequest getThingShadowRequest) throws InvalidRequestException, ResourceNotFoundException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide. - Parameters:
- getThingShadowRequest- The input for the GetThingShadow operation.
- Returns:
- Result of the GetThingShadow operation returned by the service.
- See Also:
 
- 
getThingShadowdefault GetThingShadowResponse getThingShadow(Consumer<GetThingShadowRequest.Builder> getThingShadowRequest) throws InvalidRequestException, ResourceNotFoundException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaGetThingShadowRequest.builder()- Parameters:
- getThingShadowRequest- A- Consumerthat will call methods on- GetThingShadowRequest.Builderto create a request. The input for the GetThingShadow operation.
- Returns:
- Result of the GetThingShadow operation returned by the service.
- See Also:
 
- 
listNamedShadowsForThingdefault ListNamedShadowsForThingResponse listNamedShadowsForThing(ListNamedShadowsForThingRequest listNamedShadowsForThingRequest) throws ResourceNotFoundException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException Lists the shadows for the specified thing. Requires permission to access the ListNamedShadowsForThing action. - Parameters:
- listNamedShadowsForThingRequest-
- Returns:
- Result of the ListNamedShadowsForThing operation returned by the service.
- See Also:
 
- 
listNamedShadowsForThingdefault ListNamedShadowsForThingResponse listNamedShadowsForThing(Consumer<ListNamedShadowsForThingRequest.Builder> listNamedShadowsForThingRequest) throws ResourceNotFoundException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaListNamedShadowsForThingRequest.builder()- Parameters:
- listNamedShadowsForThingRequest- A- Consumerthat will call methods on- ListNamedShadowsForThingRequest.Builderto create a request.
- Returns:
- Result of the ListNamedShadowsForThing operation returned by the service.
- See Also:
 
- 
listRetainedMessagesdefault ListRetainedMessagesResponse listRetainedMessages(ListRetainedMessagesRequest listRetainedMessagesRequest) throws InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException 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. - Parameters:
- listRetainedMessagesRequest-
- Returns:
- Result of the ListRetainedMessages operation returned by the service.
- See Also:
 
- 
listRetainedMessagesdefault ListRetainedMessagesResponse listRetainedMessages(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest) throws InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaListRetainedMessagesRequest.builder()- Parameters:
- listRetainedMessagesRequest- A- Consumerthat will call methods on- ListRetainedMessagesRequest.Builderto create a request.
- Returns:
- Result of the ListRetainedMessages operation returned by the service.
- See Also:
 
- 
listRetainedMessagesPaginatordefault ListRetainedMessagesIterable listRetainedMessagesPaginator(ListRetainedMessagesRequest listRetainedMessagesRequest) throws InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException This is a variant of listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable. The following are few ways to iterate through the response pages: 1) Using a Stream
 2) Using For loopsoftware.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client.listRetainedMessagesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client .listRetainedMessagesPaginator(request); for (software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client.listRetainedMessagesPaginator(request); responses.iterator().forEachRemaining(....);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.- Parameters:
- listRetainedMessagesRequest-
- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
 
- 
listRetainedMessagesPaginatordefault ListRetainedMessagesIterable listRetainedMessagesPaginator(Consumer<ListRetainedMessagesRequest.Builder> listRetainedMessagesRequest) throws InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, AwsServiceException, SdkClientException, IotDataPlaneException This is a variant of listRetainedMessages(software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable. The following are few ways to iterate through the response pages: 1) Using a Stream
 2) Using For loopsoftware.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client.listRetainedMessagesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client .listRetainedMessagesPaginator(request); for (software.amazon.awssdk.services.iotdataplane.model.ListRetainedMessagesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.iotdataplane.paginators.ListRetainedMessagesIterable responses = client.listRetainedMessagesPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaListRetainedMessagesRequest.builder()- Parameters:
- listRetainedMessagesRequest- A- Consumerthat will call methods on- ListRetainedMessagesRequest.Builderto create a request.
- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
 
- 
publishdefault PublishResponse publish(PublishRequest publishRequest) throws InternalFailureException, InvalidRequestException, UnauthorizedException, MethodNotAllowedException, ThrottlingException, AwsServiceException, SdkClientException, IotDataPlaneException 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. - Parameters:
- publishRequest- The input for the Publish operation.
- Returns:
- Result of the Publish operation returned by the service.
- See Also:
 
- 
publishdefault PublishResponse publish(Consumer<PublishRequest.Builder> publishRequest) throws InternalFailureException, InvalidRequestException, UnauthorizedException, MethodNotAllowedException, ThrottlingException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaPublishRequest.builder()- Parameters:
- publishRequest- A- Consumerthat will call methods on- PublishRequest.Builderto create a request. The input for the Publish operation.
- Returns:
- Result of the Publish operation returned by the service.
- See Also:
 
- 
updateThingShadowdefault UpdateThingShadowResponse updateThingShadow(UpdateThingShadowRequest updateThingShadowRequest) throws ConflictException, RequestEntityTooLargeException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide. - Parameters:
- updateThingShadowRequest- The input for the UpdateThingShadow operation.
- Returns:
- Result of the UpdateThingShadow operation returned by the service.
- See Also:
 
- 
updateThingShadowdefault UpdateThingShadowResponse updateThingShadow(Consumer<UpdateThingShadowRequest.Builder> updateThingShadowRequest) throws ConflictException, RequestEntityTooLargeException, InvalidRequestException, ThrottlingException, UnauthorizedException, ServiceUnavailableException, InternalFailureException, MethodNotAllowedException, UnsupportedDocumentEncodingException, AwsServiceException, SdkClientException, IotDataPlaneException 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.Builderavoiding the need to create one manually viaUpdateThingShadowRequest.builder()- Parameters:
- updateThingShadowRequest- A- Consumerthat will call methods on- UpdateThingShadowRequest.Builderto create a request. The input for the UpdateThingShadow operation.
- Returns:
- Result of the UpdateThingShadow operation returned by the service.
- See Also:
 
- 
createCreate aIotDataPlaneClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
- 
builderCreate a builder that can be used to configure and create aIotDataPlaneClient.
- 
serviceMetadata
- 
serviceClientConfigurationDescription copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
- serviceClientConfigurationin interface- AwsClient
- Specified by:
- serviceClientConfigurationin interface- SdkClient
- Returns:
- SdkServiceClientConfiguration
 
 
-