ContractAPIAmqp Class
- java.
lang. Object - ProvisioningDeviceClientContract
- com.
microsoft. azure. sdk. iot. provisioning. device. internal. contract. amqp. ContractAPIAmqp
- com.
public class ContractAPIAmqp extends ProvisioningDeviceClientContract
Constructor Summary
Constructor | Description |
---|---|
ContractAPIAmqp(ProvisioningDeviceClientConfig provisioningDeviceClientConfig) |
This constructor creates an instance of DpsAPIAmqps class and initializes member variables |
Method Summary
Modifier and Type | Method and Description |
---|---|
synchronized void |
authenticateWithProvisioningService(RequestData requestData, ResponseCallback responseCallback, Object callbackContext)
Requests hub to authenticate this connection and start the registration process over AMQP |
synchronized void |
close()
Indicates to close the connection |
String | getConnectionId() |
String | getHostName() |
synchronized void |
getRegistrationStatus(RequestData requestData, ResponseCallback responseCallback, Object callbackContext)
Gets the registration status over AMQP |
synchronized void |
open(RequestData requestData)
Indicates need to open AMQP connection |
synchronized void |
requestNonceForTPM(RequestData requestData, ResponseCallback responseCallback, Object authorizationCallbackContext)
Requests hub to provide a device key to begin authentication over AMQP (Only for TPM) |
Inherited Members
Constructor Details
ContractAPIAmqp
public ContractAPIAmqp(ProvisioningDeviceClientConfig provisioningDeviceClientConfig)
This constructor creates an instance of DpsAPIAmqps class and initializes member variables
Parameters:
Config used for provisioning Cannot benull
</code> . </p>
Throws:
ProvisioningDeviceClientException
- is thrown when any of the input parameters are invalid
Method Details
authenticateWithProvisioningService
public synchronized void authenticateWithProvisioningService(RequestData requestData, ResponseCallback responseCallback, Object callbackContext)
Requests hub to authenticate this connection and start the registration process over AMQP
Parameters:
requestData
- A nonnull
</code> value with all the required request data </p>
responseCallback
- A nonnull
</code> value for the callback </p>
callbackContext
- An object for context. Can benull
</code></p>
Throws:
ProvisioningDeviceClientException
- If any of the parameters are invalid (null
</code> or empty) </p>
ProvisioningDeviceTransportException
- If any of the API calls to transport fail
ProvisioningDeviceHubException
- If hub responds back with an invalid status
close
public synchronized void close()
Indicates to close the connection
Throws:
ProvisioningDeviceConnectionException
- If close could not succeed
getConnectionId
public String getConnectionId()
getHostName
public String getHostName()
getRegistrationStatus
public synchronized void getRegistrationStatus(RequestData requestData, ResponseCallback responseCallback, Object callbackContext)
Gets the registration status over AMQP
Parameters:
requestData
- A nonnull
</code> value with all the request data </p>
responseCallback
- A nonnull
</code> value for the callback </p>
callbackContext
- An object for context. Can benull
</code></p>
Throws:
ProvisioningDeviceClientException
- If any of the parameters are invalid (null
</code> or empty) </p>
ProvisioningDeviceTransportException
- If any of the API calls to transport fail
ProvisioningDeviceHubException
- If hub responds back with an invalid status
open
public synchronized void open(RequestData requestData)
Indicates need to open AMQP connection
Parameters:
requestData
- Data used for the connection initialization
Throws:
ProvisioningDeviceConnectionException
- is thrown when any of the input parameters are invalid
requestNonceForTPM
public synchronized void requestNonceForTPM(RequestData requestData, ResponseCallback responseCallback, Object authorizationCallbackContext)
Requests hub to provide a device key to begin authentication over AMQP (Only for TPM)
Parameters:
requestData
- A nonnull
</code> value for the RequestData to be used </p>
responseCallback
- A nonnull
</code> value for the callback </p>
authorizationCallbackContext
- An object for context. Can benull
</code></p>
Throws:
ProvisioningDeviceClientException
- If any of the parameters are invalid (null
</code> or empty) </p>
ProvisioningDeviceTransportException
- If any of the API calls to transport fail
ProvisioningDeviceHubException
- If hub responds back with an invalid status
Applies to
Azure SDK for Java