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,
Long timeoutInMs)
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 IotHubpageSize - page size for the query response to request query overrequestQueryType - Type of queryIllegalArgumentException - if the input parameters are invalidpublic Query(int pageSize,
QueryType requestQueryType)
throws IllegalArgumentException
pageSize - page size for the query response to request query overrequestQueryType - Type of queryIllegalArgumentException - if the input parameters are invalidpublic QueryResponse sendQueryRequest(IotHubConnectionString iotHubConnectionString, URL url, HttpMethod method, Long timeoutInMs) throws IOException, IotHubException
iotHubConnectionString - Hub Connection Stringurl - URL to Query onmethod - HTTP Method for the requesting a querytimeoutInMs - Maximum time to wait for the hub to respondIOException - If any of the input parameters are not validIotHubException - If HTTP response other then status ok is receivedpublic boolean hasNext()
throws IOException,
IotHubException
IOException - if sending the request is unsuccessful because of input parametersIotHubException - if sending the request is unsuccessful at the Hubpublic Object next() throws IOException, IotHubException, NoSuchElementException
IOException - if sending the request is unsuccessful because of input parametersIotHubException - if sending the request is unsuccessful at the HubNoSuchElementException - if no further elements are availableCopyright © 2017. All rights reserved.