public class Query extends Object
| Constructor and Description |
|---|
Query(int pageSize,
QueryType requestQueryType)
Constructor for Query.
|
Query(String query,
int pageSize,
QueryType requestQueryType)
Constructor for Query.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns the availability of next element in the query response.
|
Object |
next()
provides the next element in query response.
|
QueryResponse |
sendQueryRequest(IotHubConnectionString iotHubConnectionString,
URL url,
HttpMethod method,
int httpConnectTimeout,
int httpReadTimeout,
Proxy proxy)
Sends request for the query to the IotHub.
|
QueryResponse |
sendQueryRequest(IotHubConnectionString iotHubConnectionString,
URL url,
HttpMethod method,
Long timeoutInMs)
Deprecated.
|
QueryResponse |
sendQueryRequest(TokenCredentialCache credentialCache,
com.azure.core.credential.AzureSasCredential azureSasCredential,
IotHubConnectionString iotHubConnectionString,
URL url,
HttpMethod method,
int httpConnectTimeout,
int httpReadTimeout,
Proxy proxy)
Sends request for the query to the IotHub.
|
public Query(String query, int pageSize, QueryType requestQueryType) throws IllegalArgumentException
query - Sql style query to be sent to IotHub.pageSize - page size for the query response to request query over.requestQueryType - Type of query.IllegalArgumentException - if the input parameters are invalid.public Query(int pageSize,
QueryType requestQueryType)
throws IllegalArgumentException
pageSize - page size for the query response to request query over.requestQueryType - Type of query.IllegalArgumentException - if the input parameters are invalid.@Deprecated public QueryResponse sendQueryRequest(IotHubConnectionString iotHubConnectionString, URL url, HttpMethod method, Long timeoutInMs) throws IOException, IotHubException
sendQueryRequest(IotHubConnectionString, URL, HttpMethod, int, int, Proxy) instead.iotHubConnectionString - Hub Connection String.url - URL to Query on.method - HTTP Method for the requesting a query.timeoutInMs - Unused.IOException - If any of the input parameters are not valid.IotHubException - If HTTP response other then status ok is received.public QueryResponse sendQueryRequest(IotHubConnectionString iotHubConnectionString, URL url, HttpMethod method, int httpConnectTimeout, int httpReadTimeout, Proxy proxy) throws IOException, IotHubException
iotHubConnectionString - Hub Connection String.url - URL to Query on.method - HTTP Method for the requesting a query.httpConnectTimeout - the http connect timeout to use for this request.httpReadTimeout - the http read timeout to use for this request.proxy - the proxy to use, or null if no proxy should be used.IOException - If any of the input parameters are not valid.IotHubException - If HTTP response other then status ok is received.public QueryResponse sendQueryRequest(TokenCredentialCache credentialCache, com.azure.core.credential.AzureSasCredential azureSasCredential, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod method, int httpConnectTimeout, int httpReadTimeout, Proxy proxy) throws IOException, IotHubException
credentialCache - The RBAC authorization token provider. May be null if azureSasCredential or iotHubConnectionString is not.azureSasCredential - The SAS authorization token provider. May be null if credential or iotHubConnectionString is not.iotHubConnectionString - The iot hub connection string that SAS tokens will be derived from. May be null if azureSasCredential or credential is not.url - URL to Query on.method - HTTP Method for the requesting a query.httpConnectTimeout - the http connect timeout to use for this request.httpReadTimeout - the http read timeout to use for this request.proxy - the proxy to use, or null if no proxy should be used.IOException - If any of the input parameters are not valid.IotHubException - If HTTP response other then status ok is received.public boolean hasNext()
throws IOException,
IotHubException
IOException - if sending the request is unsuccessful because of input parameters.IotHubException - if sending the request is unsuccessful at the Hub.public Object next() throws IOException, IotHubException, NoSuchElementException
IOException - if sending the request is unsuccessful because of input parameters.IotHubException - if sending the request is unsuccessful at the Hub.NoSuchElementException - if no further elements are available.Copyright © 2022. All rights reserved.