@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AWSIotDataClient extends AmazonWebServiceClient implements AWSIotData
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.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Constructor and Description |
---|
AWSIotDataClient()
Deprecated.
|
AWSIotDataClient(AWSCredentials awsCredentials)
Deprecated.
use
AwsClientBuilder.withCredentials(AWSCredentialsProvider) for example:
AWSIotDataClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build(); |
AWSIotDataClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
|
AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider)
Deprecated.
|
AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
|
AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
|
AWSIotDataClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static AWSIotDataClientBuilder |
builder() |
DeleteThingShadowResult |
deleteThingShadow(DeleteThingShadowRequest request)
Deletes the shadow for the specified thing.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
GetRetainedMessageResult |
getRetainedMessage(GetRetainedMessageRequest request)
Gets the details of a single retained message for the specified topic.
|
GetThingShadowResult |
getThingShadow(GetThingShadowRequest request)
Gets the shadow for the specified thing.
|
ListNamedShadowsForThingResult |
listNamedShadowsForThing(ListNamedShadowsForThingRequest request)
Lists the shadows for the specified thing.
|
ListRetainedMessagesResult |
listRetainedMessages(ListRetainedMessagesRequest request)
Lists summary information about the retained messages stored for the account.
|
PublishResult |
publish(PublishRequest request)
Publishes an MQTT message.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
UpdateThingShadowResult |
updateThingShadow(UpdateThingShadowRequest request)
Updates the shadow for the specified thing.
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion
@Deprecated public AWSIotDataClient()
AWSIotDataClientBuilder.defaultClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AWSIotDataClient(ClientConfiguration clientConfiguration)
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this client connects to AWS IoT Data Plane (ex: proxy
settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
@Deprecated public AWSIotDataClient(AWSCredentials awsCredentials)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
for example:
AWSIotDataClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.@Deprecated public AWSIotDataClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to AWS IoT Data Plane (ex: proxy
settings, retry counts, etc.).@Deprecated public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.@Deprecated public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to AWS IoT Data Plane (ex: proxy
settings, retry counts, etc.).@Deprecated public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
and
AwsClientBuilder.withMetricsCollector(RequestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to AWS IoT Data Plane (ex: proxy
settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic static AWSIotDataClientBuilder builder()
public DeleteThingShadowResult deleteThingShadow(DeleteThingShadowRequest request)
Deletes the shadow for the specified thing.
Requires permission to access the DeleteThingShadow action.
For more information, see DeleteThingShadow in the IoT Developer Guide.
deleteThingShadow
in interface AWSIotData
deleteThingShadowRequest
- The input for the DeleteThingShadow operation.ResourceNotFoundException
- The specified resource does not exist.InvalidRequestException
- The request is not valid.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.UnsupportedDocumentEncodingException
- The document encoding is not supported.public GetRetainedMessageResult getRetainedMessage(GetRetainedMessageRequest request)
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.
getRetainedMessage
in interface AWSIotData
getRetainedMessageRequest
- The input for the GetRetainedMessage operation.InvalidRequestException
- The request is not valid.ResourceNotFoundException
- The specified resource does not exist.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.public GetThingShadowResult getThingShadow(GetThingShadowRequest request)
Gets the shadow for the specified thing.
Requires permission to access the GetThingShadow action.
For more information, see GetThingShadow in the IoT Developer Guide.
getThingShadow
in interface AWSIotData
getThingShadowRequest
- The input for the GetThingShadow operation.InvalidRequestException
- The request is not valid.ResourceNotFoundException
- The specified resource does not exist.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.UnsupportedDocumentEncodingException
- The document encoding is not supported.public ListNamedShadowsForThingResult listNamedShadowsForThing(ListNamedShadowsForThingRequest request)
Lists the shadows for the specified thing.
Requires permission to access the ListNamedShadowsForThing action.
listNamedShadowsForThing
in interface AWSIotData
listNamedShadowsForThingRequest
- ResourceNotFoundException
- The specified resource does not exist.InvalidRequestException
- The request is not valid.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.public ListRetainedMessagesResult listRetainedMessages(ListRetainedMessagesRequest request)
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.
listRetainedMessages
in interface AWSIotData
listRetainedMessagesRequest
- InvalidRequestException
- The request is not valid.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.public PublishResult publish(PublishRequest request)
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.
publish
in interface AWSIotData
publishRequest
- The input for the Publish operation.InternalFailureException
- An unexpected error has occurred.InvalidRequestException
- The request is not valid.UnauthorizedException
- You are not authorized to perform this operation.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.ThrottlingException
- The rate exceeds the limit.public UpdateThingShadowResult updateThingShadow(UpdateThingShadowRequest request)
Updates the shadow for the specified thing.
Requires permission to access the UpdateThingShadow action.
For more information, see UpdateThingShadow in the IoT Developer Guide.
updateThingShadow
in interface AWSIotData
updateThingShadowRequest
- The input for the UpdateThingShadow operation.ConflictException
- The specified version does not match the version of the document.RequestEntityTooLargeException
- The payload exceeds the maximum size allowed.InvalidRequestException
- The request is not valid.ThrottlingException
- The rate exceeds the limit.UnauthorizedException
- You are not authorized to perform this operation.ServiceUnavailableException
- The service is temporarily unavailable.InternalFailureException
- An unexpected error has occurred.MethodNotAllowedException
- The specified combination of HTTP verb and URI is not supported.UnsupportedDocumentEncodingException
- The document encoding is not supported.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AWSIotData
request
- The originally executed requestpublic void shutdown()
AmazonWebServiceClient
shutdown
in interface AWSIotData
shutdown
in class AmazonWebServiceClient