IotHubUri Class

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

public class IotHubUri

A URI for a device to connect to an IoT Hub.

Field Summary

Modifier and Type Field and Description
final String API_VERSION

The API version will be passed as a param in the URI.

Constructor Summary

Constructor Description
IotHubUri()
IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, Map<String, String> queryParams, String moduleId)

Constructor. Creates a URI to an IoT Hub method. The URI does not include a protocol. The function will safely escape the given arguments.

IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, String moduleId)

Constructor. Equivalent to new IotHubUri(iotHubHostname, deviceId,

iotHubMethodPath, null) 

</code> .</p>

Method Summary

Modifier and Type Method and Description
String getApiVersionString()
String getHostname()

Returns the string representation of the IoT Hub hostname.

String getPath()

Returns the string representation of the IoT Hub path.

String getResourceUri(String iotHubHostname, String deviceId, String moduleId)

Returns the string representation of the IoT Hub resource URI. The IoT Hub resource URI is the hostname and path component that is common to all IoT Hub communication methods between the given device and IoT Hub. Safely escapes the IoT Hub resource URI.

String toString()

Returns the string representation of the IoT Hub URI.

String toStringWithoutApiVersion()

Field Details

API_VERSION

public static final String API_VERSION= "api-version=" + TransportUtils.IOTHUB_API_VERSION

The API version will be passed as a param in the URI.

Constructor Details

IotHubUri

protected IotHubUri()

IotHubUri

public IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, Map queryParams, String moduleId)

Constructor. Creates a URI to an IoT Hub method. The URI does not include a protocol. The function will safely escape the given arguments.

Parameters:

iotHubHostname - the IoT Hub hostname.
deviceId - the device ID.
iotHubMethodPath - the path from the IoT Hub resource to the method.
queryParams - the URL query parameters. Can be null.
moduleId - the module ID. May be null

IotHubUri

public IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, String moduleId)

Constructor. Equivalent to new IotHubUri(iotHubHostname, deviceId,

iotHubMethodPath, null) 

</code> .</p>

Parameters:

iotHubHostname - the IoT Hub hostname.
deviceId - the device ID.
iotHubMethodPath - the path from the IoT Hub resource to the method.
moduleId - the module ID.

Method Details

getApiVersionString

public static String getApiVersionString()

getHostname

public String getHostname()

Returns the string representation of the IoT Hub hostname.

Returns:

the string representation of the IoT Hub hostname.

getPath

public String getPath()

Returns the string representation of the IoT Hub path.

Returns:

the string representation of the IoT Hub path.

getResourceUri

public static String getResourceUri(String iotHubHostname, String deviceId, String moduleId)

Returns the string representation of the IoT Hub resource URI. The IoT Hub resource URI is the hostname and path component that is common to all IoT Hub communication methods between the given device and IoT Hub. Safely escapes the IoT Hub resource URI.

Parameters:

iotHubHostname - the IoT Hub hostname.
deviceId - the device ID.
moduleId - the module ID.

Returns:

the string representation of the IoT Hub resource URI.

toString

public String toString()

Returns the string representation of the IoT Hub URI.

Returns:

the string representation of the IoT Hub URI.

toStringWithoutApiVersion

public String toStringWithoutApiVersion()

Applies to