你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
JobClient Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. jobs. JobClient
- com.
public class JobClient
JobClient enables service client to schedule and cancel jobs for a group of devices using the IoTHub.
Constructor Summary
Modifier | Constructor | Description | |
---|---|---|---|
protected | JobClient() | ||
JobClient(String connectionString) |
Constructor to create instance from connection string |
||
JobClient(String hostName, AzureSasCredential azureSasCredential) |
Create a new Job |
||
JobClient(String hostName, AzureSasCredential azureSasCredential, JobClientOptions options) |
Create a new Job |
||
JobClient(String hostName, TokenCredential credential) |
Create a new Job |
||
JobClient(String hostName, TokenCredential credential, JobClientOptions options) |
Create a new Job |
||
JobClient(String connectionString, JobClientOptions options) |
Constructor to create instance from connection string |
Method Summary
Modifier and Type | Method and Description |
---|---|
synchronized
Job |
cancelJob(String jobId)
Cancel a current jod on the Io |
static
Job |
createFromConnectionString(String connectionString)
Deprecated
because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use JobClient(String connectionString) instead since it does not declare this exception even though it constructs the same Job
Static constructor to create instance from connection string |
synchronized
Job |
getJob(String jobId)
Get the current job on the iot |
synchronized
Job |
getNextJob(Query query)
returns the next job result in response. |
synchronized boolean |
hasNextJob(Query query)
returns the availability of next job result in response. |
synchronized Query |
queryDeviceJob(String sqlQuery)
Query for device Job limited by default page size of 100 for response |
synchronized Query |
queryDeviceJob(String sqlQuery, Integer pageSize)
Query for device Job |
synchronized Query |
queryJobResponse(JobType jobType, JobStatus jobStatus)
Query the iot hub for a jobs response. |
synchronized Query |
queryJobResponse(JobType jobType, JobStatus jobStatus, Integer pageSize)
Query the iot hub for a jobs response. |
synchronized
Job |
scheduleDeviceMethod(String jobId, String queryCondition, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload, Date startTimeUtc, long maxExecutionTimeInSeconds)
Creates a new Job to invoke method on one or multiple devices |
synchronized
Job |
scheduleUpdateTwin(String jobId, String queryCondition, DeviceTwinDevice updateTwin, Date startTimeUtc, long maxExecutionTimeInSeconds)
Creates a new Job to update twin tags and desired properties on one or multiple devices |
Methods inherited from java.lang.Object
Constructor Details
JobClient
protected JobClient()
JobClient
public JobClient(String connectionString)
Constructor to create instance from connection string
Parameters:
JobClient
public JobClient(String hostName, AzureSasCredential azureSasCredential)
Create a new JobClient instance.
Parameters:
JobClient
public JobClient(String hostName, AzureSasCredential azureSasCredential, JobClientOptions options)
Create a new JobClient instance.
Parameters:
JobClient
public JobClient(String hostName, TokenCredential credential)
Create a new JobClient instance.
Parameters:
JobClient
public JobClient(String hostName, TokenCredential credential, JobClientOptions options)
Create a new JobClient instance.
Parameters:
JobClient
public JobClient(String connectionString, JobClientOptions options)
Constructor to create instance from connection string
Parameters:
Method Details
cancelJob
public synchronized JobResult cancelJob(String jobId)
Cancel a current jod on the IoTHub
Parameters:
Returns:
Throws:
createFromConnectionString
public static JobClient createFromConnectionString(String connectionString)
Deprecated
Static constructor to create instance from connection string
Parameters:
Returns:
Throws:
getJob
public synchronized JobResult getJob(String jobId)
Get the current job on the iotHub.
Parameters:
Returns:
Throws:
getNextJob
public synchronized JobResult getNextJob(Query query)
returns the next job result in response. Query's further if page size has been met and has next is not called
Parameters:
Returns:
Throws:
hasNextJob
public synchronized boolean hasNextJob(Query query)
returns the availability of next job result in response. Query's further if page size has been met
Parameters:
Returns:
Throws:
queryDeviceJob
public synchronized Query queryDeviceJob(String sqlQuery)
Query for device Job limited by default page size of 100 for response
Parameters:
Returns:
Throws:
queryDeviceJob
public synchronized Query queryDeviceJob(String sqlQuery, Integer pageSize)
Query for device Job
Parameters:
Returns:
Throws:
queryJobResponse
public synchronized Query queryJobResponse(JobType jobType, JobStatus jobStatus)
Query the iot hub for a jobs response. Query response are limited by default page size per attempt
Parameters:
Returns:
Throws:
queryJobResponse
public synchronized Query queryJobResponse(JobType jobType, JobStatus jobStatus, Integer pageSize)
Query the iot hub for a jobs response. Query response are limited by page size per attempt
Parameters:
Returns:
Throws:
scheduleDeviceMethod
public synchronized JobResult scheduleDeviceMethod(String jobId, String queryCondition, String methodName, Long responseTimeoutInSeconds, Long connectTimeoutInSeconds, Object payload, Date startTimeUtc, long maxExecutionTimeInSeconds)
Creates a new Job to invoke method on one or multiple devices
Parameters:
null
or empty
null
.
null
.
null
.
Returns:
Throws:
scheduleUpdateTwin
public synchronized JobResult scheduleUpdateTwin(String jobId, String queryCondition, DeviceTwinDevice updateTwin, Date startTimeUtc, long maxExecutionTimeInSeconds)
Creates a new Job to update twin tags and desired properties on one or multiple devices
Parameters:
null
or empty
Returns:
Throws:
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将推出:在整个 2024 年,我们将逐步取消以“GitHub 问题”作为内容的反馈机制,并将其替换为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈