QueryCollection Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.service.devicetwin.QueryCollection

public class QueryCollection

Constructor Summary

Modifier Constructor Description
protected QueryCollection(int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, int httpConnectTimeout, int httpReadTimeout, Proxy proxy)

Constructor for non-sql based queries.

protected QueryCollection(int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, long timeout)

Deprecated

Constructor for non-sql based queries.

protected QueryCollection(String query, int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, int httpConnectTimeout, int httpReadTimeout, Proxy proxy)

Constructor for sql based queries

protected QueryCollection(String query, int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, long timeout)

Deprecated

Constructor for sql based queries.

Method Summary

Modifier and Type Method and Description
protected java.lang.Integer getPageSize()

Getter for page size.

protected boolean hasNext()

Returns if this query collection has a next collection to return.

protected QueryCollectionResponse<java.lang.String> next()

Returns the next QueryCollectionResponse object.

protected QueryCollectionResponse<java.lang.String> next(QueryOptions options)

Returns the next QueryCollectionResponse object.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

QueryCollection

protected QueryCollection(int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, int httpConnectTimeout, int httpReadTimeout, Proxy proxy)

Constructor for non-sql based queries.

Parameters:

pageSize - the size of the page to return per query collection response.
requestQueryType - the type of query this is.
iotHubConnectionString - the connection string to connect with to query against.
url - the url to query against.
httpMethod - the http method to call with the query.
httpConnectTimeout - the http connect timeout to use.
httpReadTimeout - the http read timeout to use.
proxy - the proxy type

QueryCollection


protected QueryCollection(int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, long timeout)

Deprecated

Constructor for non-sql based queries.

Parameters:

pageSize - the size of the page to return per query collection response.
requestQueryType - the type of query this is.
iotHubConnectionString - the connection string to connect with to query against.
url - the url to query against.
httpMethod - the http method to call with the query.
timeout - unused.

QueryCollection

protected QueryCollection(String query, int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, int httpConnectTimeout, int httpReadTimeout, Proxy proxy)

Constructor for sql based queries

Parameters:

query - the sql query to use.
pageSize - the size of the page to return per query collection response.
requestQueryType - the type of query this is.
iotHubConnectionString - the connection string to connect with to query against.
url - the url to query against.
httpMethod - the http method to call with the query.
httpConnectTimeout - the http connect timeout to use.
httpReadTimeout - the http read timeout to use.
proxy - proxy type

QueryCollection


protected QueryCollection(String query, int pageSize, QueryType requestQueryType, IotHubConnectionString iotHubConnectionString, URL url, HttpMethod httpMethod, long timeout)

Deprecated

Constructor for sql based queries.

Parameters:

query - the sql query to use.
pageSize - the size of the page to return per query collection response.
requestQueryType - the type of query this is.
iotHubConnectionString - the connection string to connect with to query against.
url - the url to query against.
httpMethod - the http method to call with the query.
timeout - unused.

Method Details

getPageSize

protected Integer getPageSize()

Getter for page size.

Returns:

the page size of this.

hasNext

protected boolean hasNext()

Returns if this query collection has a next collection to return.

Returns:

true if there is another page to return in the query and false otherwise.

next

protected QueryCollectionResponse next()

Returns the next QueryCollectionResponse object. The query shall continue with the same page size and use the internally saved continuation token.

Returns:

The next QueryCollectionResponse object or null if there is not a next QueryCollectionResponse object.

Throws:

java.io.IOException - If an IOException occurs when calling the Service API, or if the results of that call are unexpected.
IotHubException - If an IOException occurs when calling the Service API, or if the results of that call are unexpected.

next

protected QueryCollectionResponse next(QueryOptions options)

Returns the next QueryCollectionResponse object. If the provided query options have a continuation token, the query shall continue from that token. The query shall use the page size set in the query options.

Parameters:

options - The options for the query.

Returns:

The next QueryCollectionResponse object or null if there is no next QueryCollectionResponse object.

Throws:

java.io.IOException - If an IOException occurs when calling the Service API, or if the results of that call are unexpected.
IotHubException - If an IOException occurs when calling the Service API, or if the results of that call are unexpected.

Applies to