HttpsIotHubConnection Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. transport. https. HttpsIotHubConnection
- com.
Implements
public class HttpsIotHubConnection
implements IotHubTransportConnection
An HTTPS connection between a device and an IoT Hub. Contains functionality for synchronously connecting to the different IoT Hub resource URIs.
Constructor Summary
Constructor | Description |
---|---|
HttpsIotHubConnection(DeviceClientConfig config) |
Constructs an instance from the given DeviceClientConfig object. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the transport connection. |
java.lang.String |
getConnectionId()
Gives the UUID associated with this connection instance. |
void |
open()
Opens the transport connection object |
Iot |
receiveMessage()
Receives an Iot |
Response |
sendHttpsMessage(HttpsMessage httpsMessage, HttpsMethod httpsMethod, String httpsPath, Map<String,String> additionalHeaders)
Sends an generic https message. |
Iot |
sendMessage(Message message)
Sends an event message. |
boolean |
sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)
Sends the message result for the previously received message. |
void |
setListener(IotHubListener listener)
Sets a listener into the Transport Connection object. |
Methods inherited from java.lang.Object
Constructor Details
HttpsIotHubConnection
public HttpsIotHubConnection(DeviceClientConfig config)
Constructs an instance from the given DeviceClientConfig object.
Parameters:
Method Details
close
public void close()
Closes the transport connection.
getConnectionId
public String getConnectionId()
Gives the UUID associated with this connection instance. This string is used in conjunction with the callbacks with connection status updates to ensure that all connection status updates are relevant to this connection object
open
public void open()
Opens the transport connection object
receiveMessage
public IotHubTransportMessage receiveMessage()
Receives an IotHubTransportMessage, if one exists.
Returns:
Throws:
sendHttpsMessage
public ResponseMessage sendHttpsMessage(HttpsMessage httpsMessage, HttpsMethod httpsMethod, String httpsPath, Map
Sends an generic https message.
Parameters:
/
.
Returns:
Throws:
sendMessage
public IotHubStatusCode sendMessage(Message message)
Sends an event message.
Parameters:
Returns:
Throws:
sendMessageResult
public boolean sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)
Sends the message result for the previously received message.
Parameters:
Throws:
setListener
public void setListener(IotHubListener listener)
Sets a listener into the Transport Connection object. This listener updates the Transport layer of connection status updates, message arrivals, and message acknowledgements
Parameters:
Applies to
Azure SDK for Java