public final class CommunicationTokenRefreshOptions
extends java.lang.Object
This class is used to define how CommunicationTokenCredential should be refreshed
Constructor and Description |
---|
CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher)
Creates a CommunicationTokenRefreshOptions object
|
CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher,
boolean refreshProactively)
Deprecated.
Use
CommunicationTokenRefreshOptions(Callable) instead
and chain fluent setter setRefreshProactively(boolean) |
CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher,
boolean refreshProactively,
java.lang.String initialToken)
Deprecated.
Use
CommunicationTokenRefreshOptions(Callable) instead
and chain fluent setter setRefreshProactively(boolean) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInitialToken() |
java.util.concurrent.Callable<java.lang.String> |
getTokenRefresher() |
boolean |
isRefreshProactively() |
CommunicationTokenRefreshOptions |
setInitialToken(java.lang.String initialToken)
Set the optional serialized JWT token
|
CommunicationTokenRefreshOptions |
setRefreshProactively(boolean refreshProactively)
Set whether the token should be proactively renewed prior to its expiry or on
demand.
|
@Deprecated public CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher, boolean refreshProactively)
CommunicationTokenRefreshOptions(Callable)
instead
and chain fluent setter setRefreshProactively(boolean)
CommunicationTokenRefreshOptions
object
Access token will be fetched on demand and may optionally enable proactive refreshing
tokenRefresher
- the token refresher to provide capacity to fetch fresh token, cannot be nullrefreshProactively
- when set to true, turn on proactive fetching to call
tokenRefresher before token expiry by minutes set
with setCallbackOffsetMinutes or default value of
two minutes@Deprecated public CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher, boolean refreshProactively, java.lang.String initialToken)
CommunicationTokenRefreshOptions(Callable)
instead
and chain fluent setter setRefreshProactively(boolean)
CommunicationTokenRefreshOptions
object
A valid token is supplied and may optionally enable proactive refreshing
tokenRefresher
- the token refresher to provide capacity to fetch fresh token, cannot be nullrefreshProactively
- when set to true, turn on proactive fetching to call
tokenRefresher before token expiry by minutes set
with setCallbackOffsetMinutes or default value of
two minutesinitialToken
- the serialized JWT token, cannot be nulljava.lang.IllegalArgumentException
- if the parameter tokenRefresher or initialToken is null.public CommunicationTokenRefreshOptions(java.util.concurrent.Callable<java.lang.String> tokenRefresher)
tokenRefresher
- The callable token refresher that acquires a fresh token from
the Communication Identity API.
The returned token must be valid (its expiration date
must be set in the future).public java.util.concurrent.Callable<java.lang.String> getTokenRefresher()
public boolean isRefreshProactively()
public CommunicationTokenRefreshOptions setRefreshProactively(boolean refreshProactively)
refreshProactively
- the refreshProactively value to set.public java.lang.String getInitialToken()
public CommunicationTokenRefreshOptions setInitialToken(java.lang.String initialToken)
initialToken
- the initialToken value to set.