IotHubUri Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. net. IotHubUri
- com.
public final class IotHubUri
A URI for a device to connect to an IoT Hub.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final java.lang.String |
API_VERSION
The API version will be passed as a param in the URI. |
Constructor Summary
| Modifier | Constructor | Description | |
|---|---|---|---|
| protected | IotHubUri() | ||
| IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, String moduleId) |
Constructor. |
||
| IotHubUri(String iotHubHostname, String deviceId, String iotHubMethodPath, Map<String,String> queryParams, String moduleId) |
Constructor. |
||
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| static java.lang.String | getApiVersionString() |
| java.lang.String |
getHostname()
Returns the string representation of the IoT Hub hostname. |
| java.lang.String |
getPath()
Returns the string representation of the IoT Hub path. |
| static java.lang.String |
getResourceUri(String iotHubHostname, String deviceId, String moduleId)
Returns the string representation of the IoT Hub resource URI. |
| java.lang.String |
toString()
Returns the string representation of the IoT Hub URI. |
| java.lang.String | toStringWithoutApiVersion() |
Methods inherited from java.lang.Object
Field Details
API_VERSION
public static final String 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, String moduleId)
Constructor. Equivalent to new IotHubUri(iotHubHostname, deviceId, iotHubMethodPath, null).
Parameters:
IotHubUri
public 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.
Parameters:
Method Details
getApiVersionString
public static String getApiVersionString()
getHostname
public String getHostname()
Returns the string representation of the IoT Hub hostname.
Returns:
getPath
public String getPath()
Returns the string representation of the IoT Hub path.
Returns:
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:
Returns:
toString
public String toString()
Returns the string representation of the IoT Hub URI.
Overrides:
IotHubUri.toString()Returns:
toStringWithoutApiVersion
public String toStringWithoutApiVersion()