Package com.azure.communication.common
Class CommunicationTokenRefreshOptions
java.lang.Object
com.azure.communication.common.CommunicationTokenRefreshOptions
Options for refreshing CommunicationTokenCredential
-
Constructor Summary
ConstructorDescriptionCommunicationTokenRefreshOptions
(Supplier<String> tokenRefresher) Creates a CommunicationTokenRefreshOptions objectCommunicationTokenRefreshOptions
(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively) Deprecated.CommunicationTokenRefreshOptions
(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively, String initialToken) Deprecated.UseCommunicationTokenRefreshOptions(Supplier)
instead and chain fluent setterssetRefreshProactively(boolean)
,setInitialToken(String)
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Use synchronous token refresher instead.boolean
setInitialToken
(String initialToken) Set the optional serialized JWT tokensetRefreshProactively
(boolean refreshProactively) Set whether the token should be proactively renewed prior to its expiry or on demand.
-
Constructor Details
-
CommunicationTokenRefreshOptions
@Deprecated public CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively) Deprecated.UseCommunicationTokenRefreshOptions(Supplier)
instead and chain fluent settersetRefreshProactively(boolean)
Creates a CommunicationTokenRefreshOptions object- Parameters:
tokenRefresher
- The asynchronous callback function that acquires a fresh token from the Communication Identity API, e.g. by calling the CommunicationIdentityClientrefreshProactively
- Determines whether the token should be proactively renewed prior to its expiry or on demand.
-
CommunicationTokenRefreshOptions
@Deprecated public CommunicationTokenRefreshOptions(Supplier<Mono<String>> tokenRefresher, boolean refreshProactively, String initialToken) Deprecated.UseCommunicationTokenRefreshOptions(Supplier)
instead and chain fluent setterssetRefreshProactively(boolean)
,setInitialToken(String)
Creates a CommunicationTokenRefreshOptions object- Parameters:
tokenRefresher
- The asynchronous callback function that acquires a fresh token from the Communication Identity API, e.g. by calling the CommunicationIdentityClientrefreshProactively
- Determines whether the token should be proactively renewed prior to its expiry or on demand.initialToken
- The optional serialized JWT token
-
CommunicationTokenRefreshOptions
Creates a CommunicationTokenRefreshOptions object- Parameters:
tokenRefresher
- The synchronous callback function that acquires a fresh token from the Communication Identity API, e.g. by calling the CommunicationIdentityClient The returned token must be valid (its expiration date must be set in the future).
-
-
Method Details
-
getTokenRefresher
Deprecated.Use synchronous token refresher instead.- Returns:
- The asynchronous token refresher to provide capacity to fetch fresh token
-
getTokenRefresherSync
- Returns:
- The synchronous token refresher to provide capacity to fetch fresh token
-
isRefreshProactively
public boolean isRefreshProactively()- Returns:
- Whether or not to refresh token proactively
-
setRefreshProactively
Set whether the token should be proactively renewed prior to its expiry or on demand.- Parameters:
refreshProactively
- the refreshProactively value to set.- Returns:
- the CommunicationTokenRefreshOptions object itself.
-
getInitialToken
- Returns:
- The initial token
-
setInitialToken
Set the optional serialized JWT token- Parameters:
initialToken
- the initialToken value to set.- Returns:
- the CommunicationTokenRefreshOptions object itself.
-
CommunicationTokenRefreshOptions(Supplier)
instead and chain fluent settersetRefreshProactively(boolean)