public class AmqpSend extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AmqpSendHandler |
amqpSendHandler |
protected String |
hostName |
protected IotHubServiceClientProtocol |
iotHubServiceClientProtocol |
protected String |
sasToken |
protected String |
userName |
| Constructor and Description |
|---|
AmqpSend(String hostName,
com.azure.core.credential.AzureSasCredential sasTokenProvider,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext) |
AmqpSend(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Constructor to set up connection parameters
|
AmqpSend(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions)
Constructor to set up connection parameters
|
AmqpSend(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext)
Constructor to set up connection parameters
|
AmqpSend(String hostName,
com.azure.core.credential.TokenCredential credential,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Invalidate AmqpsSendHandler member variable
|
void |
open()
Create AmqpsSendHandler and store it in a member variable
|
void |
send(String deviceId,
String moduleId,
Message message)
Create binary message
Initialize and start Proton reactor
Send the created message
|
protected final String hostName
protected String userName
protected String sasToken
protected AmqpSendHandler amqpSendHandler
protected IotHubServiceClientProtocol iotHubServiceClientProtocol
public AmqpSend(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol)
hostName - The address string of the service (example: AAA.BBB.CCC)userName - The username string to use SASL authentication (example: user@sas.service)sasToken - The SAS token stringiotHubServiceClientProtocol - protocol to usepublic AmqpSend(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions)
hostName - The address string of the service (example: AAA.BBB.CCC)userName - The username string to use SASL authentication (example: user@sas.service)sasToken - The SAS token stringiotHubServiceClientProtocol - protocol to useproxyOptions - the proxy options to tunnel through, if a proxy should be used.public AmqpSend(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
hostName - The address string of the service (example: AAA.BBB.CCC)userName - The username string to use SASL authentication (example: user@sas.service)sasToken - The SAS token stringiotHubServiceClientProtocol - protocol to useproxyOptions - the proxy options to tunnel through, if a proxy should be used.sslContext - the custom SSL context to open the connection with.public AmqpSend(String hostName, com.azure.core.credential.TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
public AmqpSend(String hostName, com.azure.core.credential.AzureSasCredential sasTokenProvider, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
public void open()
public void close()
public void send(String deviceId, String moduleId, Message message) throws IOException, IotHubException
deviceId - The device name stringmoduleId - The module name stringmessage - The message to be sentIOException - This exception is thrown if the AmqpSend object is not initializedIotHubException - If IotHub rejects the message for any reasonCopyright © 2022. All rights reserved.