Class IotJobsV2Client
- java.lang.Object
-
- software.amazon.awssdk.iot.iotjobs.IotJobsV2Client
-
- All Implemented Interfaces:
AutoCloseable
public class IotJobsV2Client extends Object implements AutoCloseable
The AWS IoT jobs service can be used to define a set of remote operations that are sent to and executed on one or more devices connected to AWS IoT. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#jobs-mqtt-api
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Releases all resources used by the client.software.amazon.awssdk.crt.iot.StreamingOperation
createJobExecutionsChangedStream(JobExecutionsChangedSubscriptionRequest request, V2ClientStreamOptions<JobExecutionsChangedEvent> options)
Creates a stream of JobExecutionsChanged notifications for a given IoT thing.software.amazon.awssdk.crt.iot.StreamingOperation
createNextJobExecutionChangedStream(NextJobExecutionChangedSubscriptionRequest request, V2ClientStreamOptions<NextJobExecutionChangedEvent> options)
AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-nextjobexecutionchangedCompletableFuture<DescribeJobExecutionResponse>
describeJobExecution(DescribeJobExecutionRequest request)
Gets detailed information about a job execution.CompletableFuture<GetPendingJobExecutionsResponse>
getPendingJobExecutions(GetPendingJobExecutionsRequest request)
Gets the list of all jobs for a thing that are not in a terminal state.static IotJobsV2Client
newFromMqtt311(software.amazon.awssdk.crt.mqtt.MqttClientConnection protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options)
Constructs a new IotJobsV2Client, using an MQTT311 client as transportstatic IotJobsV2Client
newFromMqtt5(software.amazon.awssdk.crt.mqtt5.Mqtt5Client protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options)
Constructs a new IotJobsV2Client, using an MQTT5 client as transportCompletableFuture<StartNextJobExecutionResponse>
startNextPendingJobExecution(StartNextPendingJobExecutionRequest request)
Gets and starts the next pending job execution for a thing (status IN_PROGRESS or QUEUED).CompletableFuture<UpdateJobExecutionResponse>
updateJobExecution(UpdateJobExecutionRequest request)
Updates the status of a job execution.
-
-
-
Method Detail
-
newFromMqtt5
public static IotJobsV2Client newFromMqtt5(software.amazon.awssdk.crt.mqtt5.Mqtt5Client protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options)
Constructs a new IotJobsV2Client, using an MQTT5 client as transport- Parameters:
protocolClient
- the MQTT5 client to useoptions
- configuration options to use
-
newFromMqtt311
public static IotJobsV2Client newFromMqtt311(software.amazon.awssdk.crt.mqtt.MqttClientConnection protocolClient, software.amazon.awssdk.crt.iot.MqttRequestResponseClientOptions options)
Constructs a new IotJobsV2Client, using an MQTT311 client as transport- Parameters:
protocolClient
- the MQTT311 client to useoptions
- 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 interfaceAutoCloseable
-
describeJobExecution
public CompletableFuture<DescribeJobExecutionResponse> describeJobExecution(DescribeJobExecutionRequest request)
Gets detailed information about a job execution. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution- Parameters:
request
- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
getPendingJobExecutions
public CompletableFuture<GetPendingJobExecutionsResponse> getPendingJobExecutions(GetPendingJobExecutionsRequest request)
Gets the list of all jobs for a thing that are not in a terminal state. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions- Parameters:
request
- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
startNextPendingJobExecution
public CompletableFuture<StartNextJobExecutionResponse> startNextPendingJobExecution(StartNextPendingJobExecutionRequest request)
Gets and starts the next pending job execution for a thing (status IN_PROGRESS or QUEUED). AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution- Parameters:
request
- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
updateJobExecution
public CompletableFuture<UpdateJobExecutionResponse> updateJobExecution(UpdateJobExecutionRequest request)
Updates the status of a job execution. You can optionally create a step timer by setting a value for the stepTimeoutInMinutes property. If you don't update the value of this property by running UpdateJobExecution again, the job execution times out when the step timer expires. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution- Parameters:
request
- modeled request to perform- Returns:
- a future that will complete with the corresponding response
-
createJobExecutionsChangedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createJobExecutionsChangedStream(JobExecutionsChangedSubscriptionRequest request, V2ClientStreamOptions<JobExecutionsChangedEvent> options)
Creates a stream of JobExecutionsChanged notifications for a given IoT thing. AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-jobexecutionschanged- Parameters:
request
- modeled streaming operation subscription configurationoptions
- 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
-
createNextJobExecutionChangedStream
public software.amazon.awssdk.crt.iot.StreamingOperation createNextJobExecutionChangedStream(NextJobExecutionChangedSubscriptionRequest request, V2ClientStreamOptions<NextJobExecutionChangedEvent> options)
AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-nextjobexecutionchanged- Parameters:
request
- modeled streaming operation subscription configurationoptions
- 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
-
-