public abstract class IotHubSasTokenAuthenticationProvider extends IotHubAuthenticationProvider
| Modifier and Type | Field and Description |
|---|---|
protected IotHubSasToken |
sasToken |
protected long |
tokenValidSecs
The number of seconds after which the generated SAS token for a message
will become invalid.
|
deviceId, gatewayHostname, hostname, moduleId| Constructor and Description |
|---|
IotHubSasTokenAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId) |
IotHubSasTokenAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
long tokenValidSecs,
int timeBufferPercentage) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canRefreshToken() |
int |
getMillisecondsBeforeProactiveRenewal() |
abstract char[] |
getSasToken() |
long |
getTokenValidSecs() |
boolean |
isAuthenticationProviderRenewalNecessary()
Returns true if the this authentication provider is no longer valid.
|
boolean |
isSasTokenExpired() |
void |
setTokenValidSecs(long tokenValidSecs) |
boolean |
shouldRefreshToken(boolean proactivelyRenew)
Returns true if the saved token should be refreshed
|
getDeviceId, getGatewayHostname, getHostname, getModuleId, getSSLContextprotected long tokenValidSecs
currentTime() + DEVICE_KEY_VALID_LENGTH, as a salt when generating our
SAS token.protected IotHubSasToken sasToken
public IotHubSasTokenAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId)
public IotHubSasTokenAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
long tokenValidSecs,
int timeBufferPercentage)
public abstract boolean canRefreshToken()
public abstract char[] getSasToken()
throws java.io.IOException,
TransportException
java.io.IOExceptionTransportExceptionpublic void setTokenValidSecs(long tokenValidSecs)
public boolean isAuthenticationProviderRenewalNecessary()
public boolean isSasTokenExpired()
public boolean shouldRefreshToken(boolean proactivelyRenew)
proactivelyRenew - if true, this function will return true even if the saved token has not expired, but only
if the token has lived beyond its time buffer percentagepublic int getMillisecondsBeforeProactiveRenewal()
public long getTokenValidSecs()
Copyright © 2023. All rights reserved.