HttpsTransportManager Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.transport.https.HttpsTransportManager

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.

HttpsResponse getFileUploadSasUri(IotHubTransportMessage message)
DirectMethodResponse 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.

HttpsResponse 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.

HttpsResponse sendFileUploadNotification(IotHubTransportMessage message)

Constructor Details

HttpsTransportManager

public HttpsTransportManager(ClientConfiguration config)

Constructor

Parameters:

config - is the set of device configurations.

Throws:

IllegalArgumentException - is the config is null.

Method Details

close

public void close()

Close the connection destroying the HttpsIotHubConnection instance.

getFileUploadSasUri

public HttpsResponse getFileUploadSasUri(IotHubTransportMessage message)

Parameters:

message

invokeMethod

public DirectMethodResponse invokeMethod(DirectMethodRequest directMethodRequest, String deviceId, String moduleId)

Invoke a direct method to the provided uri

Parameters:

directMethodRequest - the method request to make
deviceId - the device id of the device the moduleId belongs to
moduleId - the module id of the module to invoke the method on

Returns:

the result of that request

Throws:

IOException - if the IotHub cannot be reached
TransportException - if any issues occur when sending the http request to its target

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:

topics - is a list of topics to signed in.

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