IotHubConnectionString Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. IotHubConnectionString
- com.
public class IotHubConnectionString
Parser for the Iothub connection string.
Constructor Summary
Constructor | Description |
---|---|
IotHubConnectionString(String connectionString) |
CONSTRUCTOR. |
IotHubConnectionString(String hostName, String deviceId, String sharedAccessKey, String sharedAccessToken) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getDeviceId()
Getter for the deviceId. |
String | getGatewayHostName() |
String |
getHostName()
Getter for the hostName. |
String |
getHubName()
Getter for the hubName. |
String | getModuleId() |
String |
getSharedAccessKey()
Getter for the sharedAccessKey. |
String |
getSharedAccessToken()
Getter for the sharedAccessToken. |
boolean |
isUsingX509()
Getter for UsingX509 |
void |
setSharedAccessToken(String sharedAccessToken)
Setter for the shared access token |
Constructor Details
IotHubConnectionString
public IotHubConnectionString(String connectionString)
CONSTRUCTOR.
Parameters:
Throws:
if the provided connectionString isnull
</code> , empty, or not valid or if the hostName in the connection string is not a valid URI. </p>
IotHubConnectionString
public IotHubConnectionString(String hostName, String deviceId, String sharedAccessKey, String sharedAccessToken)
Constructor.
Parameters:
hostName
- the IoT Hub hostname.
deviceId
- the device ID.
sharedAccessKey
- the device key.
sharedAccessToken
- the shared access token.
Throws:
IllegalArgumentException
- if the IoT Hub hostname does not contain a valid IoT Hub name as its prefix or if the IoT Hub hostname does not conform to RFC 3986.
Method Details
getDeviceId
public String getDeviceId()
Getter for the deviceId.
Returns:
string with the deviceId in the connectionString
getGatewayHostName
public String getGatewayHostName()
getHostName
public String getHostName()
Getter for the hostName.
Returns:
string with the hostName in the connectionString
getHubName
public String getHubName()
Getter for the hubName.
Returns:
string with the hubName in the connectionString
getModuleId
public String getModuleId()
getSharedAccessKey
public String getSharedAccessKey()
Getter for the sharedAccessKey.
Returns:
string with the sharedAccessKey in the connectionString. It can benull
</code> . </p>
getSharedAccessToken
public String getSharedAccessToken()
Getter for the sharedAccessToken.
Returns:
string with the sharedAccessToken in the connectionString. It can benull
</code> . </p>
isUsingX509
public boolean isUsingX509()
Getter for UsingX509
Returns:
The value of UsingX509
setSharedAccessToken
public void setSharedAccessToken(String sharedAccessToken)
Setter for the shared access token
Parameters:
sharedAccessToken
- the new token value to set
Throws:
IllegalArgumentException
- if the provided value is null or empty
Applies to
Azure SDK for Java