HttpsTransportManager Class

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

Implements

public class HttpsTransportManager
implements IotHubTransportManager

Implementation of the transport manager for https.

Constructor Summary

Constructor Description
HttpsTransportManager(DeviceClientConfig config)

Constructor

Method Summary

Modifier and Type Method and Description
void close()

Close the connection destroying the HttpsIotHubConnection instance.

ResponseMessage getFileUploadSasUri(IotHubTransportMessage message)
MethodResult invokeMethod(MethodRequest methodRequest, 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.

Message receive()

Pull the IotHub looking for new message.

ResponseMessage send(IotHubTransportMessage message, Map<String,String> additionalHeaders)

This is a blocking send message.

ResponseMessage sendFileUploadNotification(IotHubTransportMessage message)

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

HttpsTransportManager

public HttpsTransportManager(DeviceClientConfig config)

Constructor

Parameters:

config - is the set of device configurations.

Throws:

java.lang.IllegalArgumentException - is the config is null.

Method Details

close

public void close()

Close the connection destroying the HttpsIotHubConnection instance.

getFileUploadSasUri

public ResponseMessage getFileUploadSasUri(IotHubTransportMessage message)

Parameters:

message

Throws:

java.io.IOException

invokeMethod

public MethodResult invokeMethod(MethodRequest methodRequest, String deviceId, String moduleId)

Invoke a direct method to the provided uri

Parameters:

methodRequest - 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:

java.io.IOException - if the IotHub cannot be reached
java.net.URISyntaxException - if the IotHub cannot be reached
TransportException - if the IotHub cannot be reached

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 be null is there is no new message to read.

Throws:

java.io.IOException - if the IotHub communication failed.

send

public ResponseMessage 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

Returns:

the IotHub response with the status and payload.

Throws:

java.io.IOException - if the IotHub communication failed.
java.lang.IllegalArgumentException - if the IotHub communication failed.

sendFileUploadNotification

public ResponseMessage sendFileUploadNotification(IotHubTransportMessage message)

Parameters:

message

Throws:

java.io.IOException

Applies to