HttpsTransportManager Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. transport. https. HttpsTransportManager
- com.
public class HttpsTransportManager
Implementation of the transport manager for https.
Constructor Summary
Constructor | Description |
---|---|
HttpsTransportManager(ClientConfiguration config) |
Constructor |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection destroying the HttpsIotHubConnection instance. |
Https |
getFileUploadSasUri(IotHubTransportMessage message) |
Direct |
invokeMethod(DirectMethodRequest directMethodRequest, String deviceId, String moduleId)
Invoke a direct method to the provided uri |
void |
open()
Opens the connection by creating a new instance of the HttpsIotHubConnection. |
void |
open(String[] topics)
Opens the connection by creating a new instance of the HttpsIotHubConnection. The provided topics have no effect for HTTPS protocol, and it is ignored. |
Message |
receive()
Pull the IotHub looking for new message. |
Https |
send(IotHubTransportMessage message, Map<String, String> additionalHeaders)
This is a blocking send message. It send the provide message, wait for the IotHub answer, and return is in the ResponseMessage, which contains the status and the payload. |
Https |
sendFileUploadNotification(IotHubTransportMessage message) |
Constructor Details
HttpsTransportManager
public HttpsTransportManager(ClientConfiguration config)
Constructor
Parameters:
Throws:
Method Details
close
public void close()
Close the connection destroying the HttpsIotHubConnection instance.
getFileUploadSasUri
public HttpsResponse getFileUploadSasUri(IotHubTransportMessage message)
Parameters:
invokeMethod
public DirectMethodResponse invokeMethod(DirectMethodRequest directMethodRequest, String deviceId, String moduleId)
Invoke a direct method to the provided uri
Parameters:
Returns:
Throws:
open
public void open()
Opens the connection by creating a new instance of the HttpsIotHubConnection.
open
public void open(String[] topics)
Opens the connection by creating a new instance of the HttpsIotHubConnection. The provided topics have no effect for HTTPS protocol, and it is ignored.
Parameters:
receive
public Message receive()
Pull the IotHub looking for new message.
Returns:
New message from the IotHub. It can benull
</code> is there is no new message to read. </p>
Throws:
IOException
- if the IotHub communication failed.
send
public HttpsResponse send(IotHubTransportMessage message, Map additionalHeaders)
This is a blocking send message. It send the provide message, wait for the IotHub answer, and return is in the ResponseMessage, which contains the status and the payload.
Parameters:
message
- is the message to send.
additionalHeaders
- the http headers to use in the request.
Returns:
the IotHub response with the status and payload.
Throws:
IOException
- if the IotHub communication failed.
IllegalArgumentException
- if the provided message is null, or invalid.
sendFileUploadNotification
public HttpsResponse sendFileUploadNotification(IotHubTransportMessage message)
Parameters:
message
Applies to
Azure SDK for Java