public class HttpsIotHubConnection extends Object
| Modifier and Type | Field and Description |
|---|---|
protected DeviceClientConfig |
config
The client configuration.
|
protected static Object |
HTTPS_CONNECTION_LOCK
The HTTPS connection lock.
|
protected String |
messageEtag
The message e-tag.
|
| Constructor and Description |
|---|
HttpsIotHubConnection(DeviceClientConfig config)
Constructs an instance from the given
DeviceClientConfig
object. |
| Modifier and Type | Method and Description |
|---|---|
Message |
receiveMessage()
Receives a message, if one exists.
|
protected static String |
sanitizeEtag(String dirtyEtag)
Removes double quotes from the e-tag property.
|
IotHubStatusCode |
sendEvent(HttpsMessage msg)
Sends an event message.
|
void |
sendMessageResult(IotHubMessageResult result)
Sends the message result for the previously received
message.
|
protected static final Object HTTPS_CONNECTION_LOCK
protected final DeviceClientConfig config
protected String messageEtag
public HttpsIotHubConnection(DeviceClientConfig config)
DeviceClientConfig
object.config - the client configuration.public IotHubStatusCode sendEvent(HttpsMessage msg) throws IOException
msg - the event message.IOException - if the IoT Hub could not be reached.public Message receiveMessage() throws IOException
IOException - if the IoT Hub could not be reached.public void sendMessageResult(IotHubMessageResult result) throws IOException
result - the message result (one of IotHubMessageResult.COMPLETE,
IotHubMessageResult.ABANDON, or IotHubMessageResult.REJECT).IllegalStateException - if sendMessageResult is called before
receiveMessage() is called.IOException - if the IoT Hub could not be reached.Copyright © 2017. All rights reserved.