azure-docs-sdk-java/docs-ref-autogen/com.microsoft.azure.sdk.iot...

687 строки
80 KiB
YAML

### YamlMime:JavaType
uid: "com.microsoft.azure.sdk.iot.device.DeviceClient"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient"
name: "DeviceClient"
nameWithType: "DeviceClient"
summary: "The public-facing API."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient?alt=com.microsoft.azure.sdk.iot.device.InternalClient&text=InternalClient\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.close()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.close&text=close\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.closeNow()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.closeNow&text=closeNow\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.getConfig()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.getConfig&text=getConfig\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.getProductInfo()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.getProductInfo&text=getProductInfo\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.isMultiplexed()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.isMultiplexed&text=isMultiplexed\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.open()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.open&text=open\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.registerConnectionStatusChangeCallback(com.microsoft.azure.sdk.iot.device.IotHubConnectionStatusChangeCallback,java.lang.Object)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.registerConnectionStatusChangeCallback&text=registerConnectionStatusChangeCallback\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendEventAsync(com.microsoft.azure.sdk.iot.device.Message,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendEventAsync&text=sendEventAsync\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendEventBatchAsync(java.util.List<com.microsoft.azure.sdk.iot.device.Message>,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendEventBatchAsync&text=sendEventBatchAsync\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties(com.microsoft.azure.sdk.iot.device.ReportedPropertiesParameters)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties&text=sendReportedProperties\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties(java.util.Set<com.microsoft.azure.sdk.iot.device.DeviceTwin.Property>)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties&text=sendReportedProperties\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties(java.util.Set<com.microsoft.azure.sdk.iot.device.DeviceTwin.Property>,int)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties&text=sendReportedProperties\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties(java.util.Set<com.microsoft.azure.sdk.iot.device.DeviceTwin.Property>,java.lang.Integer,com.microsoft.azure.sdk.iot.device.CorrelatingMessageCallback,java.lang.Object,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.sendReportedProperties&text=sendReportedProperties\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.setAsMultiplexed()?alt=com.microsoft.azure.sdk.iot.device.InternalClient.setAsMultiplexed&text=setAsMultiplexed\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.setOperationTimeout(long)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.setOperationTimeout&text=setOperationTimeout\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.setOption(java.lang.String,java.lang.Object)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.setOption&text=setOption\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.setProxySettings(com.microsoft.azure.sdk.iot.device.ProxySettings)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.setProxySettings&text=setProxySettings\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.setRetryPolicy(com.microsoft.azure.sdk.iot.device.transport.RetryPolicy)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.setRetryPolicy&text=setRetryPolicy\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.subscribeToDesiredProperties(java.util.Map<com.microsoft.azure.sdk.iot.device.DeviceTwin.Property,com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<com.microsoft.azure.sdk.iot.device.DeviceTwin.PropertyCallBack<java.lang.String,java.lang.Object>,java.lang.Object>>)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.subscribeToDesiredProperties&text=subscribeToDesiredProperties\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient.subscribeToTwinDesiredProperties(java.util.Map<com.microsoft.azure.sdk.iot.device.DeviceTwin.Property,com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack,java.lang.Object>>)?alt=com.microsoft.azure.sdk.iot.device.InternalClient.subscribeToTwinDesiredProperties&text=subscribeToTwinDesiredProperties\" data-throw-if-not-resolved=\"False\" />"
- classRef: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"java.lang.Object.clone()?alt=java.lang.Object.clone&text=clone\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.equals(java.lang.Object)?alt=java.lang.Object.equals&text=equals\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.finalize()?alt=java.lang.Object.finalize&text=finalize\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.getClass()?alt=java.lang.Object.getClass&text=getClass\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.hashCode()?alt=java.lang.Object.hashCode&text=hashCode\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.notify()?alt=java.lang.Object.notify&text=notify\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.notifyAll()?alt=java.lang.Object.notifyAll&text=notifyAll\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.toString()?alt=java.lang.Object.toString&text=toString\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.wait()?alt=java.lang.Object.wait&text=wait\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.wait(long)?alt=java.lang.Object.wait&text=wait\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Object.wait(long,int)?alt=java.lang.Object.wait&text=wait\" data-throw-if-not-resolved=\"False\" />"
syntax: "public final class **DeviceClient**</br> extends <xref href=\"com.microsoft.azure.sdk.iot.device.InternalClient?alt=com.microsoft.azure.sdk.iot.device.InternalClient&text=InternalClient\" data-throw-if-not-resolved=\"False\" /></br> implements <xref href=\"java.io.Closeable?alt=java.io.Closeable&text=Closeable\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient()"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient()"
name: "DeviceClient()"
nameWithType: "DeviceClient.DeviceClient()"
modifiers:
- "protected"
syntax: "protected DeviceClient()"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol)"
name: "DeviceClient(String connString, IotHubClientProtocol protocol)"
nameWithType: "DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol)"
summary: "Constructor that takes a connection string as an argument."
parameters:
- description: "the connection string. The connection string is a set\n of key-value pairs that are separated by ';', with the keys and values\n separated by '='. It should contain values for the following keys:\n <code>HostName</code>, <code>DeviceId</code>, and <code>SharedAccessKey</code>."
name: "connString"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "the communication protocol used (i.e. HTTPS)."
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceClient(String connString, IotHubClientProtocol protocol)"
exceptions:
- description: "if any of <code>connString</code> or\n <code>protocol</code> are <code>null</code>; or if <code>connString</code> is missing\n one of the following attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
- description: "if any of <code>connString</code> or\n <code>protocol</code> are <code>null</code>; or if <code>connString</code> is missing\n one of the following attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Constructor that takes a connection string as an argument."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,com.microsoft.azure.sdk.iot.device.ClientOptions)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, ClientOptions clientOptions)"
name: "DeviceClient(String connString, IotHubClientProtocol protocol, ClientOptions clientOptions)"
nameWithType: "DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, ClientOptions clientOptions)"
summary: "Constructor that takes a connection string as an argument."
parameters:
- description: "the connection string. The connection string is a set\n of key-value pairs that are separated by ';', with the keys and values\n separated by '='. It should contain values for the following keys:\n <code>HostName</code>, <code>DeviceId</code>, and <code>SharedAccessKey</code>."
name: "connString"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "the communication protocol used (i.e. HTTPS)"
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
- description: "The options that allow configuration of the device client instance during initialization"
name: "clientOptions"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.ClientOptions?alt=com.microsoft.azure.sdk.iot.device.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceClient(String connString, IotHubClientProtocol protocol, ClientOptions clientOptions)"
exceptions:
- description: "if any of <code>connString</code> or\n <code>protocol</code> are <code>null</code>; or if <code>connString</code> is missing\n one of the following attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
- description: "if any of <code>connString</code> or\n <code>protocol</code> are <code>null</code>; or if <code>connString</code> is missing\n one of the following attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Constructor that takes a connection string as an argument."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,java.lang.String,boolean,java.lang.String,boolean)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, String publicKeyCertificate, boolean isCertificatePath, String privateKey, boolean isPrivateKeyPath)"
name: "DeviceClient(String connString, IotHubClientProtocol protocol, String publicKeyCertificate, boolean isCertificatePath, String privateKey, boolean isPrivateKeyPath)"
nameWithType: "DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, String publicKeyCertificate, boolean isCertificatePath, String privateKey, boolean isPrivateKeyPath)"
summary: "Constructor that uses x509 authentication for communicating with Iot<wbr>Hub"
deprecatedTag: "For x509 authentication, use <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,com.microsoft.azure.sdk.iot.device.ClientOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#DeviceClient(String, IotHubClientProtocol, ClientOptions)\"></xref> and provide an SSLContext instance in the <xref uid=\"com.microsoft.azure.sdk.iot.device.ClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientOptions\"></xref> instance. For a sample on how to build this SSLContext, see [this code][] which references a helper class for building SSLContext objects for x509 authentication as well as for SAS based authentication. When not using this deprecated constructor, you can safely exclude the Bouncycastle dependencies that this library declares. See [this pom.xml][] for an example of how to do this.\n\n\n[this code]: https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-samples/send-event-x509/src/main/java/samples/com/microsoft/azure/sdk/iot/SendEventX509.java\n[this pom.xml]: https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-samples/send-event-x509/pom.xml"
parameters:
- description: "the connection string for the x509 device to connect as (format: \"HostName=...;DeviceId=...;x509=true\")"
name: "connString"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "the protocol to use when communicating with IotHub"
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
- description: "the PEM formatted public key certificate or the path to a PEM formatted public key certificate file.\n Append if there is any intermediate or chained certificates to the end of the public certificate file in the following format:\n -----BEGIN CERTIFICATE-----\n (Primary SSL certificate)\n -----END CERTIFICATE-----\n ----BEGIN CERTIFICATE-----\n (Intermediate certificate)\n -----END CERTIFICATE-----\n -----BEGIN CERTIFICATE-----\n (Root certificate)\n -----END CERTIFICATE-----"
name: "publicKeyCertificate"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "if the provided publicKeyCertificate is a path to a file containing the PEM formatted public key certificate"
name: "isCertificatePath"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- description: "the PEM formatted private key or the path to a PEM formatted private key file"
name: "privateKey"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "if the provided privateKey is a path to a file containing the PEM formatted private key"
name: "isPrivateKeyPath"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public DeviceClient(String connString, IotHubClientProtocol protocol, String publicKeyCertificate, boolean isCertificatePath, String privateKey, boolean isPrivateKeyPath)"
exceptions:
- description: "if the hostname in the connection string is not a valid URI"
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
desc: "Constructor that uses x509 authentication for communicating with IotHub"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,javax.net.ssl.SSLContext)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, SSLContext sslContext)"
name: "DeviceClient(String connString, IotHubClientProtocol protocol, SSLContext sslContext)"
nameWithType: "DeviceClient.DeviceClient(String connString, IotHubClientProtocol protocol, SSLContext sslContext)"
summary: "Creates a device client that uses the provided SSLContext for SSL negotiation"
deprecatedTag: "For x509 authentication, use <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,com.microsoft.azure.sdk.iot.device.ClientOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#DeviceClient(String, IotHubClientProtocol, ClientOptions)\"></xref> and provide an SSLContext instance in the <xref uid=\"com.microsoft.azure.sdk.iot.device.ClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientOptions\"></xref> instance. For a sample on how to build this SSLContext, see [this code][] which references a helper class for building SSLContext objects for x509 authentication as well as for SAS based authentication. When not using this deprecated constructor, you can safely exclude the Bouncycastle dependencies that this library declares. See [this pom.xml][] for an example of how to do this.\n\n\n[this code]: https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-samples/send-event-x509/src/main/java/samples/com/microsoft/azure/sdk/iot/SendEventX509.java\n[this pom.xml]: https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-samples/send-event-x509/pom.xml"
parameters:
- description: "the connection string for the device. May be an x509 connection string (format: \"HostName=...;DeviceId=...;x509=true\")\n and it may be a SAS connection string (format: \"HostName=...;DeviceId=...;SharedAccessKey=...\"). If\n this connection string is an x509 connection string, the client will use the provided SSLContext for authentication."
name: "connString"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "the protocol to use when communicating with IotHub"
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
- description: "the ssl context that will be used during authentication. If the provided connection string does not contain\n SAS based credentials, then the sslContext will be used for x509 authentication. If the provided connection string\n does contain SAS based credentials, the sslContext will still be used during SSL negotiation."
name: "sslContext"
type: "<xref href=\"javax.net.ssl.SSLContext?alt=javax.net.ssl.SSLContext&text=SSLContext\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public DeviceClient(String connString, IotHubClientProtocol protocol, SSLContext sslContext)"
exceptions:
- description: "if the hostname in the connection string is not a valid URI"
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
desc: "Creates a device client that uses the provided SSLContext for SSL negotiation"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,com.microsoft.azure.sdk.iot.device.TransportClient)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String connString, TransportClient transportClient)"
name: "DeviceClient(String connString, TransportClient transportClient)"
nameWithType: "DeviceClient.DeviceClient(String connString, TransportClient transportClient)"
summary: "Constructor that takes a connection string and a transport client as an argument."
deprecatedTag: "<xref uid=\"com.microsoft.azure.sdk.iot.device.MultiplexingClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"MultiplexingClient\"></xref> should be used instead of <xref uid=\"com.microsoft.azure.sdk.iot.device.TransportClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TransportClient\"></xref> for creating all multiplexed connections."
parameters:
- description: "the connection string. The connection string is a set\n of key-value pairs that are separated by ';', with the keys and values\n separated by '='. It should contain values for the following keys:\n <code>HostName</code>, <code>DeviceId</code>, and <code>SharedAccessKey</code>."
name: "connString"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "the transport client to use by the device client."
name: "transportClient"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.TransportClient?alt=com.microsoft.azure.sdk.iot.device.TransportClient&text=TransportClient\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public DeviceClient(String connString, TransportClient transportClient)"
exceptions:
- description: "if <code>connString</code>\n or if <code>connString</code> is missing one of the following\n attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
- description: "if <code>connString</code>\n or if <code>connString</code> is missing one of the following\n attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
- description: "if <code>connString</code>\n or if <code>connString</code> is missing one of the following\n attributes:<code>HostName</code>, <code>DeviceId</code>, or\n <code>SharedAccessKey</code> or if the IoT hub hostname does not conform to\n RFC 3986 or if the provided <code>connString</code> is for an x509 authenticated device"
type: "<xref href=\"java.lang.UnsupportedOperationException?alt=java.lang.UnsupportedOperationException&text=UnsupportedOperationException\" data-throw-if-not-resolved=\"False\" />"
desc: "Constructor that takes a connection string and a transport client as an argument."
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,java.lang.String,com.microsoft.azure.sdk.iot.device.SasTokenProvider,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol)"
name: "DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol)"
nameWithType: "DeviceClient.DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol)"
summary: "Constructor that allows for the client's SAS token generation to be controlled by the user."
parameters:
- description: "The host name of the IoT Hub that this client will connect to."
name: "hostName"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The Id of the device that the connection will identify as."
name: "deviceId"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The provider of all SAS tokens that are used during authentication."
name: "sasTokenProvider"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.SasTokenProvider?alt=com.microsoft.azure.sdk.iot.device.SasTokenProvider&text=SasTokenProvider\" data-throw-if-not-resolved=\"False\" />"
- description: "The protocol that the client will connect over."
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol)"
desc: "Constructor that allows for the client's SAS token generation to be controlled by the user. Note that options in this client such as setting the SAS token expiry time will throw <xref uid=\"java.lang.UnsupportedOperationException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"UnsupportedOperationException\"></xref> since the SDK no longer controls that when this constructor is used."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(java.lang.String,java.lang.String,com.microsoft.azure.sdk.iot.device.SasTokenProvider,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,com.microsoft.azure.sdk.iot.device.ClientOptions)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
name: "DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
nameWithType: "DeviceClient.DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
summary: "Constructor that allows for the client's SAS token generation to be controlled by the user."
parameters:
- description: "The host name of the IoT Hub that this client will connect to."
name: "hostName"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The Id of the device that the connection will identify as."
name: "deviceId"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The provider of all SAS tokens that are used during authentication."
name: "sasTokenProvider"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.SasTokenProvider?alt=com.microsoft.azure.sdk.iot.device.SasTokenProvider&text=SasTokenProvider\" data-throw-if-not-resolved=\"False\" />"
- description: "The protocol that the client will connect over."
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
- description: "The options that allow configuration of the device client instance during initialization."
name: "clientOptions"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.ClientOptions?alt=com.microsoft.azure.sdk.iot.device.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceClient(String hostName, String deviceId, SasTokenProvider sasTokenProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
desc: "Constructor that allows for the client's SAS token generation to be controlled by the user. Note that options in this client such as setting the SAS token expiry time will throw <xref uid=\"java.lang.UnsupportedOperationException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"UnsupportedOperationException\"></xref> since the SDK no longer controls that when this constructor is used."
fields:
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.CONNECTION_STRING_CHARSET"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.CONNECTION_STRING_CHARSET"
name: "CONNECTION_STRING_CHARSET"
nameWithType: "DeviceClient.CONNECTION_STRING_CHARSET"
deprecatedTag: "as of release 1.2.27 this value is deprecated and will not be replaced. The charset used for URL-encoding the device ID in the connection string."
modifiers:
- "static"
- "final"
field:
type: "<xref href=\"java.nio.charset.Charset?alt=java.nio.charset.Charset&text=Charset\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static final Charset CONNECTION_STRING_CHARSET"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.DEVICE_ID_ATTRIBUTE"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.DEVICE_ID_ATTRIBUTE"
name: "DEVICE_ID_ATTRIBUTE"
nameWithType: "DeviceClient.DEVICE_ID_ATTRIBUTE"
deprecatedTag: "as of release 1.2.27 this value is deprecated and will not be replaced. The device ID attribute name in a connection string."
modifiers:
- "static"
- "final"
field:
value: "DeviceId="
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static final String DEVICE_ID_ATTRIBUTE"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.HOSTNAME_ATTRIBUTE"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.HOSTNAME_ATTRIBUTE"
name: "HOSTNAME_ATTRIBUTE"
nameWithType: "DeviceClient.HOSTNAME_ATTRIBUTE"
deprecatedTag: "as of release 1.2.27 this value is deprecated and will not be replaced. The hostname attribute name in a connection string."
modifiers:
- "static"
- "final"
field:
value: "HostName="
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static final String HOSTNAME_ATTRIBUTE"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS"
name: "RECEIVE_PERIOD_MILLIS"
nameWithType: "DeviceClient.RECEIVE_PERIOD_MILLIS"
modifiers:
- "protected"
field:
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "protected long RECEIVE_PERIOD_MILLIS"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_AMQPS"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_AMQPS"
name: "RECEIVE_PERIOD_MILLIS_AMQPS"
nameWithType: "DeviceClient.RECEIVE_PERIOD_MILLIS_AMQPS"
deprecatedTag: "as of release 1.2.27 these value is deprecated and replaced by <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.setOption(java.lang.String,java.lang.Object)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#setOption(String, Object)\"></xref> **SetMinimumPollingInterval** to change it. The number of milliseconds the transport will wait between polling for messages."
modifiers:
- "static"
field:
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static long RECEIVE_PERIOD_MILLIS_AMQPS"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_HTTPS"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_HTTPS"
name: "RECEIVE_PERIOD_MILLIS_HTTPS"
nameWithType: "DeviceClient.RECEIVE_PERIOD_MILLIS_HTTPS"
modifiers:
- "static"
field:
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static long RECEIVE_PERIOD_MILLIS_HTTPS"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_MQTT"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.RECEIVE_PERIOD_MILLIS_MQTT"
name: "RECEIVE_PERIOD_MILLIS_MQTT"
nameWithType: "DeviceClient.RECEIVE_PERIOD_MILLIS_MQTT"
modifiers:
- "static"
field:
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static long RECEIVE_PERIOD_MILLIS_MQTT"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.SEND_PERIOD_MILLIS"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.SEND_PERIOD_MILLIS"
name: "SEND_PERIOD_MILLIS"
nameWithType: "DeviceClient.SEND_PERIOD_MILLIS"
deprecatedTag: "as of release 1.2.27 this value is deprecated and replaced by <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.setOption(java.lang.String,java.lang.Object)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#setOption(String, Object)\"></xref> **SetSendInterval** to change it. The number of milliseconds the transport will wait between sending out messages."
modifiers:
- "static"
field:
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static long SEND_PERIOD_MILLIS"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.SHARED_ACCESS_KEY_ATTRIBUTE"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.SHARED_ACCESS_KEY_ATTRIBUTE"
name: "SHARED_ACCESS_KEY_ATTRIBUTE"
nameWithType: "DeviceClient.SHARED_ACCESS_KEY_ATTRIBUTE"
deprecatedTag: "as of release 1.2.27 this value is deprecated and will not be replaced. The shared access key attribute name in a connection string."
modifiers:
- "static"
- "final"
field:
value: "SharedAccessKey="
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static final String SHARED_ACCESS_KEY_ATTRIBUTE"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.SHARED_ACCESS_TOKEN_ATTRIBUTE"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.SHARED_ACCESS_TOKEN_ATTRIBUTE"
name: "SHARED_ACCESS_TOKEN_ATTRIBUTE"
nameWithType: "DeviceClient.SHARED_ACCESS_TOKEN_ATTRIBUTE"
deprecatedTag: "as of release 1.2.27 this value is deprecated and will not be replaced. The shared access signature attribute name in a connection string."
modifiers:
- "static"
- "final"
field:
value: "SharedAccessSignature="
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public static final String SHARED_ACCESS_TOKEN_ATTRIBUTE"
hasDeprecatedTag: true
methods:
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.<Type1,Type2>startDeviceTwin(com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object,com.microsoft.azure.sdk.iot.device.DeviceTwin.PropertyCallBack<Type1,Type2>,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.<Type1,Type2>startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.PropertyCallBack<Type1,Type2> genericPropertyCallBack, Object genericPropertyCallBackContext)"
name: "<Type1,Type2>startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.PropertyCallBack<Type1,Type2> genericPropertyCallBack, Object genericPropertyCallBackContext)"
nameWithType: "DeviceClient.<Type1,Type2>startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.PropertyCallBack<Type1,Type2> genericPropertyCallBack, Object genericPropertyCallBackContext)"
summary: "Starts the device twin."
parameters:
- description: "the IotHubEventCallback callback for providing the status of Device Twin operations. Cannot be <code>null</code>."
name: "deviceTwinStatusCallback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubEventCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubEventCallback&text=IotHubEventCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the status callback. Can be <code>null</code>."
name: "deviceTwinStatusCallbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
- description: "the PropertyCallBack callback for providing any changes in desired properties. Cannot be <code>null</code>."
name: "genericPropertyCallBack"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceTwin.PropertyCallBack?alt=com.microsoft.azure.sdk.iot.device.DeviceTwin.PropertyCallBack&text=PropertyCallBack\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"Type1?alt=Type1&text=Type1\" data-throw-if-not-resolved=\"False\" />,<xref href=\"Type2?alt=Type2&text=Type2\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "the context to be passed to the property callback. Can be <code>null</code>."
name: "genericPropertyCallBackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void <Type1,Type2>startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.PropertyCallBack<Type1,Type2> genericPropertyCallBack, Object genericPropertyCallBackContext)"
exceptions:
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.UnsupportedOperationException?alt=java.lang.UnsupportedOperationException&text=UnsupportedOperationException\" data-throw-if-not-resolved=\"False\" />"
desc: "Starts the device twin. This device client will receive a callback with the current state of the full twin, including reported properties and desired properties. After that callback is received, this device client will receive a callback each time a desired property is updated. That callback will either contain the full desired properties set, or only the updated desired property depending on how the desired property was changed. IoT Hub supports a PUT and a PATCH on the twin. The PUT will cause this device client to receive the full desired properties set, and the PATCH will cause this device client to only receive the updated desired properties. Similarly, the version of each desired property will be incremented from a PUT call, and only the actually updated desired property will have its version incremented from a PATCH call. The java service client library uses the PATCH call when updated desired properties, but it builds the patch such that all properties are included in the patch. As a result, the device side will receive full twin updates, not partial updates. See [PUT][] and [PATCH][]\n\n\n[PUT]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/replacedevicetwin\n[PATCH]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/updatedevicetwin"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.close()"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.close()"
name: "close()"
nameWithType: "DeviceClient.close()"
summary: "Completes all current outstanding requests and closes the IoT Hub client."
deprecatedTag: ": As of release 1.1.25 this call is replaced by <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.closeNow()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#closeNow()\"></xref>"
overridden: "com.microsoft.azure.sdk.iot.device.InternalClient.close()"
syntax: "</br>public void close()"
exceptions:
- description: "if the connection to an IoT Hub cannot be closed."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Completes all current outstanding requests and closes the IoT Hub client. Must be called to terminate the background thread that is sending data to IoT Hub. After `closeNow()` is called, the IoT Hub client is no longer usable. If the client is already closed, the function shall do nothing."
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.closeNow()"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.closeNow()"
name: "closeNow()"
nameWithType: "DeviceClient.closeNow()"
summary: "Closes the IoT Hub client by releasing any resources held by client."
overridden: "com.microsoft.azure.sdk.iot.device.InternalClient.closeNow()"
syntax: "public void closeNow()"
exceptions:
- description: "if the connection to an IoT Hub cannot be closed."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Closes the IoT Hub client by releasing any resources held by client. When closeNow is called all the messages that were in transit or pending to be sent will be informed to the user in the callbacks and any existing connection to IotHub will be closed. Must be called to terminate the background thread that is sending data to IoT Hub. After `closeNow()` is called, the IoT Hub client is no longer usable. If the client is already closed, the function shall do nothing."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUpload(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUpload(FileUploadCompletionNotification notification)"
name: "completeFileUpload(FileUploadCompletionNotification notification)"
nameWithType: "DeviceClient.completeFileUpload(FileUploadCompletionNotification notification)"
summary: "Notify IoT Hub that a file upload has been completed, successfully or otherwise."
parameters:
- description: "The notification details, including if the file upload succeeded."
name: "notification"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification?alt=com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification&text=FileUploadCompletionNotification\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void completeFileUpload(FileUploadCompletionNotification notification)"
exceptions:
- description: "If this HTTPS request fails to send."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Notify IoT Hub that a file upload has been completed, successfully or otherwise. See [this documentation][] for more details.\n\n\n[this documentation]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-file-upload#notify-iot-hub-of-a-completed-file-upload"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUploadAsync(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUploadAsync(FileUploadCompletionNotification notification)"
name: "completeFileUploadAsync(FileUploadCompletionNotification notification)"
nameWithType: "DeviceClient.completeFileUploadAsync(FileUploadCompletionNotification notification)"
summary: "Notify IoT Hub that a file upload has been completed, successfully or otherwise."
deprecatedTag: "This function is not actually async, so use <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUpload(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#completeFileUpload(FileUploadCompletionNotification)\"></xref> to avoid confusion"
parameters:
- description: "The notification details, including if the file upload succeeded."
name: "notification"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification?alt=com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification&text=FileUploadCompletionNotification\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public void completeFileUploadAsync(FileUploadCompletionNotification notification)"
exceptions:
- description: "If this HTTPS request fails to send."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Notify IoT Hub that a file upload has been completed, successfully or otherwise. See [this documentation][] for more details.\n\n\n[this documentation]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-file-upload#notify-iot-hub-of-a-completed-file-upload"
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.createFromSecurityProvider(java.lang.String,java.lang.String,com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol)"
name: "createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol)"
nameWithType: "DeviceClient.createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol)"
summary: "Creates a device client that uses the provided security provider for authentication."
modifiers:
- "static"
parameters:
- description: "The hostname of the iot hub to connect to (format: \"yourHubName.azure-devices.net\")"
name: "uri"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The id for the device to use"
name: "deviceId"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The security provider for the device"
name: "securityProvider"
type: "<xref href=\"com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider?alt=com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider&text=SecurityProvider\" data-throw-if-not-resolved=\"False\" />"
- description: "The protocol the device shall use for communication to the IoT Hub"
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static DeviceClient createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol)"
exceptions:
- description: "If the provided connString could not be parsed."
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
- description: "If the provided connString could not be parsed."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Creates a device client that uses the provided security provider for authentication."
returns:
description: "The created device client instance"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceClient?alt=com.microsoft.azure.sdk.iot.device.DeviceClient&text=DeviceClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.createFromSecurityProvider(java.lang.String,java.lang.String,com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider,com.microsoft.azure.sdk.iot.device.IotHubClientProtocol,com.microsoft.azure.sdk.iot.device.ClientOptions)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
name: "createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
nameWithType: "DeviceClient.createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
summary: "Creates a device client that uses the provided security provider for authentication."
modifiers:
- "static"
parameters:
- description: "The hostname of the iot hub to connect to (format: \"yourHubName.azure-devices.net\")"
name: "uri"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The id for the device to use"
name: "deviceId"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The security provider for the device"
name: "securityProvider"
type: "<xref href=\"com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider?alt=com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider&text=SecurityProvider\" data-throw-if-not-resolved=\"False\" />"
- description: "The protocol the device shall use for communication to the IoT Hub"
name: "protocol"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubClientProtocol?alt=com.microsoft.azure.sdk.iot.device.IotHubClientProtocol&text=IotHubClientProtocol\" data-throw-if-not-resolved=\"False\" />"
- description: "The options that allow configuration of the device client instance during initialization"
name: "clientOptions"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.ClientOptions?alt=com.microsoft.azure.sdk.iot.device.ClientOptions&text=ClientOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static DeviceClient createFromSecurityProvider(String uri, String deviceId, SecurityProvider securityProvider, IotHubClientProtocol protocol, ClientOptions clientOptions)"
exceptions:
- description: "If the provided connString could not be parsed."
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
- description: "If the provided connString could not be parsed."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Creates a device client that uses the provided security provider for authentication."
returns:
description: "The created device client instance"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceClient?alt=com.microsoft.azure.sdk.iot.device.DeviceClient&text=DeviceClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.getDeviceTwin()"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.getDeviceTwin()"
name: "getDeviceTwin()"
nameWithType: "DeviceClient.getDeviceTwin()"
summary: "Retrieves the twin's latest desired properties"
syntax: "public void getDeviceTwin()"
exceptions:
- description: "if the iothub cannot be reached"
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Retrieves the twin's latest desired properties"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.getFileUploadSasUri(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriRequest)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.getFileUploadSasUri(FileUploadSasUriRequest request)"
name: "getFileUploadSasUri(FileUploadSasUriRequest request)"
nameWithType: "DeviceClient.getFileUploadSasUri(FileUploadSasUriRequest request)"
summary: "Get a file upload SAS URI which the Azure Storage SDK can use to upload a file to blob for this device."
parameters:
- description: "The request details for getting the SAS URI, including the destination blob name."
name: "request"
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriRequest?alt=com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriRequest&text=FileUploadSasUriRequest\" data-throw-if-not-resolved=\"False\" />"
syntax: "public FileUploadSasUriResponse getFileUploadSasUri(FileUploadSasUriRequest request)"
exceptions:
- description: "If this HTTPS request fails to send."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
- description: "If this HTTPS request fails to send."
type: "<xref href=\"java.net.URISyntaxException?alt=java.net.URISyntaxException&text=URISyntaxException\" data-throw-if-not-resolved=\"False\" />"
desc: "Get a file upload SAS URI which the Azure Storage SDK can use to upload a file to blob for this device. See [this documentation][] for more details.\n\n\n[this documentation]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-file-upload#initialize-a-file-upload"
returns:
description: "The file upload details to be used with the Azure Storage SDK in order to upload a file from this device."
type: "<xref href=\"com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriResponse?alt=com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriResponse&text=FileUploadSasUriResponse\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.open()"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.open()"
name: "open()"
nameWithType: "DeviceClient.open()"
summary: "Starts asynchronously sending and receiving messages from an IoT Hub."
overridden: "com.microsoft.azure.sdk.iot.device.InternalClient.open()"
syntax: "public void open()"
exceptions:
- description: "if a connection to an IoT Hub cannot be established."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Starts asynchronously sending and receiving messages from an IoT Hub. If the client is already open, the function shall do nothing."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.registerConnectionStateCallback(com.microsoft.azure.sdk.iot.device.IotHubConnectionStateCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.registerConnectionStateCallback(IotHubConnectionStateCallback callback, Object callbackContext)"
name: "registerConnectionStateCallback(IotHubConnectionStateCallback callback, Object callbackContext)"
nameWithType: "DeviceClient.registerConnectionStateCallback(IotHubConnectionStateCallback callback, Object callbackContext)"
summary: "Registers a callback to be executed whenever the connection to the device is lost or established."
deprecatedTag: "as of release 1.10.0 by <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.registerConnectionStatusChangeCallback*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#registerConnectionStatusChangeCallback(IotHubConnectionStatusChangeCallback callback, Object callbackContext)\"></xref>"
parameters:
- description: "the callback to be called."
name: "callback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubConnectionStateCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubConnectionStateCallback&text=IotHubConnectionStateCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "a context to be passed to the callback. Can be\n <code>null</code> if no callback is provided."
name: "callbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public void registerConnectionStateCallback(IotHubConnectionStateCallback callback, Object callbackContext)"
exceptions:
- description: "if the provided callback is null"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Registers a callback to be executed whenever the connection to the device is lost or established."
hasDeprecatedTag: true
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.setMessageCallback(com.microsoft.azure.sdk.iot.device.MessageCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.setMessageCallback(MessageCallback callback, Object context)"
name: "setMessageCallback(MessageCallback callback, Object context)"
nameWithType: "DeviceClient.setMessageCallback(MessageCallback callback, Object context)"
summary: "Sets the message callback."
parameters:
- description: "the message callback. Can be <code>null</code>."
name: "callback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.MessageCallback?alt=com.microsoft.azure.sdk.iot.device.MessageCallback&text=MessageCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the callback. Can be <code>null</code>."
name: "context"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceClient setMessageCallback(MessageCallback callback, Object context)"
exceptions:
- description: "if the callback is <code>null</code> but a context is\n passed in."
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Sets the message callback."
returns:
description: "itself, for fluent setting."
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceClient?alt=com.microsoft.azure.sdk.iot.device.DeviceClient&text=DeviceClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.setOption(java.lang.String,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.setOption(String optionName, Object value)"
name: "setOption(String optionName, Object value)"
nameWithType: "DeviceClient.setOption(String optionName, Object value)"
summary: "Sets a runtime option identified by parameter `optionName` to `value`."
overridden: "com.microsoft.azure.sdk.iot.device.InternalClient.setOption(java.lang.String,java.lang.Object)"
parameters:
- description: "the option name to modify"
name: "optionName"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "an object of the appropriate type for the option's value"
name: "value"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void setOption(String optionName, Object value)"
exceptions:
- description: "if the provided optionName is null"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Sets a runtime option identified by parameter `optionName` to `value`. The options that can be set via this API are: - **SetMinimumPollingInterval** \\- this option is applicable only when the transport configured with this client is HTTP. This option specifies the interval in milliseconds between calls to the service checking for availability of new messages. The value is expected to be of type `long`. - **SetSendInterval** \\- this option is applicable to all protocols. This value sets the period (in milliseconds) that this SDK spawns threads to send queued messages. Even if no message is queued, this thread will be spawned. - **SetReceiveInterval** \\- this option is applicable to all protocols in case of HTTPS protocol, this option acts the same as `SetMinimumPollingInterval` in case of MQTT and AMQP protocols, this option specifies the interval in milliseconds between spawning a thread that dequeues a message from the SDK's queue of received messages. - **SetCertificatePath** \\- this option is applicable only when the transport configured with this client is AMQP. This option specifies the path to the certificate used to verify peer. The value is expected to be of type `String`. - **SetSASTokenExpiryTime** \\- this option is applicable for HTTP/ AMQP/MQTT. This option specifies the interval in seconds after which SASToken expires. If the transport is already open then setting this option will restart the transport with the updated expiry time, and will use that expiry time length for all subsequently generated sas tokens. The value is expected to be of type `long`. - **SetHttpsReadTimeout** \\- this option is applicable for HTTPS. This option specifies the read timeout in milliseconds per https request made by this client. By default, this value is 4 minutes. The value is expected to be of type `int`. - **SetHttpsConnectTimeout** \\- this option is applicable for HTTPS. This option specifies the connect timeout in milliseconds per https request made by this client. By default, this value is 0 (no connect timeout). The value is expected to be of type `int`. - **SetAmqpOpenAuthenticationSessionTimeout** \\- this option is applicable for AMQP with SAS token authentication. This option specifies the timeout in seconds to wait to open the authentication session. By default, this value is 20 seconds. The value is expected to be of type `int`. - **SetAmqpOpenDeviceSessionsTimeout** \\- this option is applicable for AMQP. This option specifies the timeout in seconds to open the device sessions. By default, this value is 60 seconds. The value is expected to be of type `int`."
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.startDeviceTwin(com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object,com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertiesCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertiesCallback genericPropertiesCallBack, Object genericPropertyCallBackContext)"
name: "startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertiesCallback genericPropertiesCallBack, Object genericPropertyCallBackContext)"
nameWithType: "DeviceClient.startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertiesCallback genericPropertiesCallBack, Object genericPropertyCallBackContext)"
summary: "Starts the device twin."
parameters:
- description: "the IotHubEventCallback callback for providing the status of Device Twin operations. Cannot be <code>null</code>."
name: "deviceTwinStatusCallback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubEventCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubEventCallback&text=IotHubEventCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the status callback. Can be <code>null</code>."
name: "deviceTwinStatusCallbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
- description: "the TwinPropertyCallBack callback for providing any changes in desired properties. Cannot be <code>null</code>."
name: "genericPropertiesCallBack"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertiesCallback?alt=com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertiesCallback&text=TwinPropertiesCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the property callback. Can be <code>null</code>."
name: "genericPropertyCallBackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertiesCallback genericPropertiesCallBack, Object genericPropertyCallBackContext)"
exceptions:
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.UnsupportedOperationException?alt=java.lang.UnsupportedOperationException&text=UnsupportedOperationException\" data-throw-if-not-resolved=\"False\" />"
desc: "Starts the device twin. This device client will receive a callback with the current state of the full twin, including reported properties and desired properties. After that callback is received, this device client will receive a callback each time a desired property is updated. That callback will either contain the full desired properties set, or only the updated desired property depending on how the desired property was changed. IoT Hub supports a PUT and a PATCH on the twin. The PUT will cause this device client to receive the full desired properties set, and the PATCH will cause this device client to only receive the updated desired properties. Similarly, the version of each desired property will be incremented from a PUT call, and only the actually updated desired property will have its version incremented from a PATCH call. The java service client library uses the PATCH call when updated desired properties, but it builds the patch such that all properties are included in the patch. As a result, the device side will receive full twin updates, not partial updates. See [PUT][] and [PATCH][]\n\n\n[PUT]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/replacedevicetwin\n[PATCH]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/updatedevicetwin"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.startDeviceTwin(com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object,com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertyCallBack genericPropertyCallBack, Object genericPropertyCallBackContext)"
name: "startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertyCallBack genericPropertyCallBack, Object genericPropertyCallBackContext)"
nameWithType: "DeviceClient.startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertyCallBack genericPropertyCallBack, Object genericPropertyCallBackContext)"
summary: "Starts the device twin."
parameters:
- description: "the IotHubEventCallback callback for providing the status of Device Twin operations. Cannot be <code>null</code>."
name: "deviceTwinStatusCallback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubEventCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubEventCallback&text=IotHubEventCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the status callback. Can be <code>null</code>."
name: "deviceTwinStatusCallbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
- description: "the TwinPropertyCallBack callback for providing any changes in desired properties. Cannot be <code>null</code>."
name: "genericPropertyCallBack"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack?alt=com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack&text=TwinPropertyCallBack\" data-throw-if-not-resolved=\"False\" />"
- description: "the context to be passed to the property callback. Can be <code>null</code>. *"
name: "genericPropertyCallBackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void startDeviceTwin(IotHubEventCallback deviceTwinStatusCallback, Object deviceTwinStatusCallbackContext, DeviceTwin.TwinPropertyCallBack genericPropertyCallBack, Object genericPropertyCallBackContext)"
exceptions:
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the callback is <code>null</code>"
type: "<xref href=\"java.lang.UnsupportedOperationException?alt=java.lang.UnsupportedOperationException&text=UnsupportedOperationException\" data-throw-if-not-resolved=\"False\" />"
desc: "Starts the device twin. This device client will receive a callback with the current state of the full twin, including reported properties and desired properties. After that callback is received, this device client will receive a callback each time a desired property is updated. That callback will either contain the full desired properties set, or only the updated desired property depending on how the desired property was changed. IoT Hub supports a PUT and a PATCH on the twin. The PUT will cause this device client to receive the full desired properties set, and the PATCH will cause this device client to only receive the updated desired properties. Similarly, the version of each desired property will be incremented from a PUT call, and only the actually updated desired property will have its version incremented from a PATCH call. The java service client library uses the PATCH call when updated desired properties, but it builds the patch such that all properties are included in the patch. As a result, the device side will receive full twin updates, not partial updates. See [PUT][] and [PATCH][]\n\n\n[PUT]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/replacedevicetwin\n[PATCH]: https://docs.microsoft.com/en-us/rest/api/iothub/service/twin/updatedevicetwin"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.subscribeToDeviceMethod(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback,java.lang.Object,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
name: "subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
nameWithType: "DeviceClient.subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
summary: "Subscribes to device methods"
parameters:
- description: "Callback on which device methods shall be invoked. Cannot be <code>null</code>."
name: "deviceMethodCallback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback?alt=com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback&text=DeviceMethodCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "Context for device method callback. Can be <code>null</code>."
name: "deviceMethodCallbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
- description: "Callback for providing IotHub status for device methods. Cannot be <code>null</code>."
name: "deviceMethodStatusCallback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubEventCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubEventCallback&text=IotHubEventCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "Context for device method status callback. Can be <code>null</code>."
name: "deviceMethodStatusCallbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void subscribeToDeviceMethod(DeviceTwin.DeviceMethodCallback deviceMethodCallback, Object deviceMethodCallbackContext, IotHubEventCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)"
exceptions:
- description: "if called when client is not opened."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
- description: "if called when client is not opened."
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
desc: "Subscribes to device methods"
- uid: "com.microsoft.azure.sdk.iot.device.DeviceClient.uploadToBlobAsync(java.lang.String,java.io.InputStream,long,com.microsoft.azure.sdk.iot.device.IotHubEventCallback,java.lang.Object)"
fullName: "com.microsoft.azure.sdk.iot.device.DeviceClient.uploadToBlobAsync(String destinationBlobName, InputStream inputStream, long streamLength, IotHubEventCallback callback, Object callbackContext)"
name: "uploadToBlobAsync(String destinationBlobName, InputStream inputStream, long streamLength, IotHubEventCallback callback, Object callbackContext)"
nameWithType: "DeviceClient.uploadToBlobAsync(String destinationBlobName, InputStream inputStream, long streamLength, IotHubEventCallback callback, Object callbackContext)"
summary: "Asynchronously upload a stream to the IoT Hub."
deprecatedTag: "Use <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.getFileUploadSasUri(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadSasUriRequest)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getFileUploadSasUri(FileUploadSasUriRequest)\"></xref> to get the SAS URI, use the azure storage SDK to upload a file to that SAS URI, and then use <xref uid=\"com.microsoft.azure.sdk.iot.device.DeviceClient.completeFileUpload(com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#completeFileUpload(FileUploadCompletionNotification)\"></xref> to notify Iot Hub that your file upload has completed, successfully or otherwise. This method does all three of these tasks for you, but has limited configuration options."
parameters:
- description: "is a string with the name of the file in the storage."
name: "destinationBlobName"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "is a InputStream with the stream to upload in the blob."
name: "inputStream"
type: "<xref href=\"java.io.InputStream?alt=java.io.InputStream&text=InputStream\" data-throw-if-not-resolved=\"False\" />"
- description: "is a long with the number of bytes in the stream to upload."
name: "streamLength"
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- description: "the callback to be invoked when a file is uploaded."
name: "callback"
type: "<xref href=\"com.microsoft.azure.sdk.iot.device.IotHubEventCallback?alt=com.microsoft.azure.sdk.iot.device.IotHubEventCallback&text=IotHubEventCallback\" data-throw-if-not-resolved=\"False\" />"
- description: "a context to be passed to the callback. Can be <code>null</code>."
name: "callbackContext"
type: "<xref href=\"java.lang.Object?alt=java.lang.Object&text=Object\" data-throw-if-not-resolved=\"False\" />"
syntax: "</br>public void uploadToBlobAsync(String destinationBlobName, InputStream inputStream, long streamLength, IotHubEventCallback callback, Object callbackContext)"
exceptions:
- description: "if the provided blob name, or the file path is <code>null</code>,\n empty or not valid, or if the callback is <code>null</code>."
type: "<xref href=\"java.lang.IllegalArgumentException?alt=java.lang.IllegalArgumentException&text=IllegalArgumentException\" data-throw-if-not-resolved=\"False\" />"
- description: "if the provided blob name, or the file path is <code>null</code>,\n empty or not valid, or if the callback is <code>null</code>."
type: "<xref href=\"java.io.IOException?alt=java.io.IOException&text=IOException\" data-throw-if-not-resolved=\"False\" />"
desc: "Asynchronously upload a stream to the IoT Hub. NOTE: IotHub does not currently support CA signed devices using file upload. Please use SAS based authentication or self signed certificates."
hasDeprecatedTag: true
type: "class"
desc: "The public-facing API. Allows a single logical or physical device to connect to an IoT Hub. The IoT Hub client supports sending events to and receiving messages from an IoT Hub.\n\nTo support these workflows, the client library will provide the following abstractions: a message, with its payload and associated properties; and a client, which sends and receives messages.\n\nThe client buffers messages while the network is down, and re-sends them when the network comes back online. It also batches messages to improve communication efficiency (HTTPS only).\n\nThe client supports HTTPS 1.1 and AMQPS 1.0 transports."
implements:
- "<xref href=\"java.io.Closeable?alt=java.io.Closeable&text=Closeable\" data-throw-if-not-resolved=\"False\" />"
metadata: {}
package: "com.microsoft.azure.sdk.iot.device"
artifact: com.microsoft.azure.sdk.iot:iot-device-client:1.30.1