Class AWSIotDataClient
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceClient
-
- com.amazonaws.services.iotdata.AWSIotDataClient
-
- All Implemented Interfaces:
AWSIotData
- Direct Known Subclasses:
AWSIotDataAsyncClient
@ThreadSafe public class AWSIotDataClient extends AmazonWebServiceClient implements AWSIotData
Client for accessing AWS IoT Data Plane. All service calls made using this client are blocking, and will not return until the service call completes.AWS IoT AWS IoT-Data enables secure, bi-directional communication between Internet-connected things (such as sensors, actuators, embedded devices, or smart appliances) and the AWS cloud. It implements a broker for applications and things to publish messages over HTTP (Publish) and retrieve, update, and delete thing shadows. A thing shadow is a persistent representation of your things and their state in the AWS cloud.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ClientConfigurationFactory
configFactory
Client configuration factory providing ClientConfigurations tailored to this client-
Fields inherited from class com.amazonaws.AmazonWebServiceClient
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
-
-
Constructor Summary
Constructors Constructor Description AWSIotDataClient()
Constructs a new client to invoke service methods on AWS IoT Data Plane.AWSIotDataClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials.AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider.AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider and client configuration options.AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider, client configuration options, and request metric collector.AWSIotDataClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials and client configuration options.AWSIotDataClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeleteThingShadowResult
deleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest)
Deletes the thing 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.GetThingShadowResult
getThingShadow(GetThingShadowRequest getThingShadowRequest)
Gets the thing shadow for the specified thing.PublishResult
publish(PublishRequest publishRequest)
Publishes state information.UpdateThingShadowResult
updateThingShadow(UpdateThingShadowRequest updateThingShadowRequest)
Updates the thing shadow for the specified thing.-
Methods inherited from class com.amazonaws.AmazonWebServiceClient
addRequestHandler, addRequestHandler, beforeMarshalling, configureRegion, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getEndpointPrefix, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setEndpoint, setEndpointPrefix, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.amazonaws.services.iotdata.AWSIotData
setEndpoint, setRegion, shutdown
-
-
-
-
Field Detail
-
configFactory
protected static final ClientConfigurationFactory configFactory
Client configuration factory providing ClientConfigurations tailored to this client
-
-
Constructor Detail
-
AWSIotDataClient
public AWSIotDataClient()
Constructs a new client to invoke service methods on AWS IoT Data Plane. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Instance profile credentials delivered through the Amazon EC2 metadata service
All service calls made using this new client object are blocking, and will not return until the service call completes.
- See Also:
DefaultAWSCredentialsProviderChain
-
AWSIotDataClient
public AWSIotDataClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Instance profile credentials delivered through the Amazon EC2 metadata service
All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
clientConfiguration
- The client configuration options controlling how this client connects to AWS IoT Data Plane (ex: proxy settings, retry counts, etc.).- See Also:
DefaultAWSCredentialsProviderChain
-
AWSIotDataClient
public AWSIotDataClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
-
AWSIotDataClient
public AWSIotDataClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials and client configuration options.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
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.).
-
AWSIotDataClient
public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
-
AWSIotDataClient
public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider and client configuration options.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
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.).
-
AWSIotDataClient
public AWSIotDataClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on AWS IoT Data Plane using the specified AWS account credentials provider, client configuration options, and request metric collector.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
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 collector
-
-
Method Detail
-
deleteThingShadow
public DeleteThingShadowResult deleteThingShadow(DeleteThingShadowRequest deleteThingShadowRequest)
Deletes the thing shadow for the specified thing.
For more information, see DeleteThingShadow in the AWS IoT Developer Guide.
- Specified by:
deleteThingShadow
in interfaceAWSIotData
- Parameters:
deleteThingShadowRequest
- The input for the DeleteThingShadow operation.- Returns:
- Result of the DeleteThingShadow operation returned by the service.
- Throws:
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.
-
getThingShadow
public GetThingShadowResult getThingShadow(GetThingShadowRequest getThingShadowRequest)
Gets the thing shadow for the specified thing.
For more information, see GetThingShadow in the AWS IoT Developer Guide.
- Specified by:
getThingShadow
in interfaceAWSIotData
- Parameters:
getThingShadowRequest
- The input for the GetThingShadow operation.- Returns:
- Result of the GetThingShadow operation returned by the service.
- Throws:
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.
-
publish
public PublishResult publish(PublishRequest publishRequest)
Publishes state information.
For more information, see HTTP Protocol in the AWS IoT Developer Guide.
- Specified by:
publish
in interfaceAWSIotData
- Parameters:
publishRequest
- The input for the Publish operation.- Returns:
- Result of the Publish operation returned by the service.
- Throws:
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.
-
updateThingShadow
public UpdateThingShadowResult updateThingShadow(UpdateThingShadowRequest updateThingShadowRequest)
Updates the thing shadow for the specified thing.
For more information, see UpdateThingShadow in the AWS IoT Developer Guide.
- Specified by:
updateThingShadow
in interfaceAWSIotData
- Parameters:
updateThingShadowRequest
- The input for the UpdateThingShadow operation.- Returns:
- Result of the UpdateThingShadow operation returned by the service.
- Throws:
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.
-
getCachedResponseMetadata
public 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. This data isn't considered part of the result data returned by an operation, so it's available through this separate, diagnostic interface.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.
- Specified by:
getCachedResponseMetadata
in interfaceAWSIotData
- Parameters:
request
- The originally executed request- Returns:
- The response metadata for the specified request, or null if none is available.
-
-