次の方法で共有


RawTwinQuery Class

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

public class RawTwinQuery

Constructor Summary

Constructor Description
RawTwinQuery(String connectionString)

Constructor to create instance from connection string

RawTwinQuery(String hostName, AzureSasCredential azureSasCredential)

Constructor to create instance from connection string

RawTwinQuery(String hostName, TokenCredential credential)

Constructor to create instance from connection string

Method Summary

Modifier and Type Method and Description
static RawTwinQuery createFromConnectionString(String connectionString)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RawTwinQuery(String connectionString) instead since it does not declare this exception even though it constructs the same RawTwinQuery.

Static constructor to create instance from connection string

synchronized boolean hasNext(Query query)

Returns the availability of next element in response.

synchronized java.lang.String next(Query query)

Returns the next json element available in response

synchronized Query query(String sqlQuery)

Creates a query object for this query using default page size

synchronized Query query(String sqlQuery, Integer pageSize)

Creates a query object for this query

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

RawTwinQuery

public RawTwinQuery(String connectionString)

Constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string

RawTwinQuery

public RawTwinQuery(String hostName, AzureSasCredential azureSasCredential)

Constructor to create instance from connection string

Parameters:

hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")
azureSasCredential - The custom TokenCredential that will provide authentication tokens to this library when they are needed.

RawTwinQuery

public RawTwinQuery(String hostName, TokenCredential credential)

Constructor to create instance from connection string

Parameters:

hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")
credential - The custom TokenCredential that will provide authentication tokens to this library when they are needed. The provided tokens must be Json Web Tokens.

Method Details

createFromConnectionString


public static RawTwinQuery createFromConnectionString(String connectionString)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RawTwinQuery(String connectionString) instead since it does not declare this exception even though it constructs the same RawTwinQuery.

Static constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string

Returns:

The instance of RawTwinQuery

Throws:

java.io.IOException - This exception is never thrown.

hasNext

public synchronized boolean hasNext(Query query)

Returns the availability of next element in response. Sends the request again (if possible) to retrieve response until no response is found.

Parameters:

query - Object corresponding to the query

Returns:

True if available and false otherwise

Throws:

IotHubException - If IotHub could not respond successfully to the query request
java.io.IOException - If IotHub could not respond successfully to the query request

next

public synchronized String next(Query query)

Returns the next json element available in response

Parameters:

query - Object corresponding for this query

Returns:

Next json element as a response to this query

Throws:

java.io.IOException - If any of input parameters are incorrect
IotHubException - If any of input parameters are incorrect
java.util.NoSuchElementException - If any of input parameters are incorrect

query

public synchronized Query query(String sqlQuery)

Creates a query object for this query using default page size

Parameters:

sqlQuery - Sql style query for Raw data over twin

Returns:

Object for the query

Throws:

IotHubException - If IotHub did not respond successfully to the query
java.io.IOException - If IotHub did not respond successfully to the query

query

public synchronized Query query(String sqlQuery, Integer pageSize)

Creates a query object for this query

Parameters:

sqlQuery - Sql style query for Raw data over twin
pageSize - Size to restrict response of query by

Returns:

Object for the query

Throws:

IotHubException - If IotHub did not respond successfully to the query
java.io.IOException - If IotHub did not respond successfully to the query

Applies to