CommunicationTokenRefreshOptions Class
- java.
lang. Object - com.
azure. communication. common. CommunicationTokenRefreshOptions
- com.
public final class CommunicationTokenRefreshOptions
Options for refreshing CommunicationTokenCredential
Constructor Summary
| Constructor | Description |
|---|---|
| CommunicationTokenRefreshOptions(Supplier<String> tokenRefresher) |
Creates a Communication |
| CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively) |
Deprecated
Use CommunicationTokenRefreshOptions(Supplier<String> tokenRefresher) instead and chain fluent setter setRefreshProactively(boolean refreshProactively)
Creates a Communication |
| CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively, String initialToken) |
Deprecated
Use CommunicationTokenRefreshOptions(Supplier<String> tokenRefresher) instead and chain fluent setters setRefreshProactively(boolean refreshProactively), setInitialToken(String initialToken)
Creates a Communication |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| String |
getInitialToken()
Gets the initial token |
| Supplier<Mono<String>> |
getTokenRefresher()
Deprecated
Use synchronous token refresher instead.
Gets the asynchronous token refresher to provide capacity to fetch fresh token |
| Supplier<String> |
getTokenRefresherSync()
Gets the synchronous token refresher to provide capacity to fetch fresh token |
| boolean |
isRefreshProactively()
Whether to refresh token proactively |
|
Communication |
setInitialToken(String initialToken)
Set the optional serialized JWT token |
|
Communication |
setRefreshProactively(boolean refreshProactively)
Set whether the token should be proactively renewed prior to its expiry or on demand. |
Methods inherited from java.lang.Object
Constructor Details
CommunicationTokenRefreshOptions
public CommunicationTokenRefreshOptions(Supplier<String> tokenRefresher)
Creates a CommunicationTokenRefreshOptions object
Parameters:
CommunicationTokenRefreshOptions
@Deprecated
public CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively)
Deprecated
Creates a CommunicationTokenRefreshOptions object
Parameters:
CommunicationTokenRefreshOptions
@Deprecated
public CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively, String initialToken)
Deprecated
Creates a CommunicationTokenRefreshOptions object
Parameters:
Method Details
getInitialToken
public String getInitialToken()
Gets the initial token
Returns:
getTokenRefresher
@Deprecated
public Supplier<Mono<String>> getTokenRefresher()
Deprecated
Gets the asynchronous token refresher to provide capacity to fetch fresh token
Returns:
getTokenRefresherSync
public Supplier<String> getTokenRefresherSync()
Gets the synchronous token refresher to provide capacity to fetch fresh token
Returns:
isRefreshProactively
public boolean isRefreshProactively()
Whether to refresh token proactively
Returns:
setInitialToken
public CommunicationTokenRefreshOptions setInitialToken(String initialToken)
Set the optional serialized JWT token
Parameters:
Returns:
setRefreshProactively
public CommunicationTokenRefreshOptions setRefreshProactively(boolean refreshProactively)
Set whether the token should be proactively renewed prior to its expiry or on demand.
Parameters:
Returns: