Package com.rabbitmq.client.impl
Class DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
- java.lang.Object
-
- com.rabbitmq.client.impl.DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
-
- Enclosing class:
- DefaultCredentialsRefreshService
public static class DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder extends Object
Builder to create instances ofDefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
.
-
-
Constructor Summary
Constructors Constructor Description DefaultCredentialsRefreshServiceBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
approachingExpirationStrategy(Function<Duration,Boolean> approachingExpirationStrategy)
Set the strategy to trigger an early refresh before attempting to connect.DefaultCredentialsRefreshService
build()
Create theDefaultCredentialsRefreshService
instance.DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
refreshDelayStrategy(Function<Duration,Duration> refreshDelayStrategy)
Set the strategy to schedule credentials refresh after credentials retrieval.DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
scheduler(ScheduledThreadPoolExecutor scheduler)
-
-
-
Method Detail
-
scheduler
public DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder scheduler(ScheduledThreadPoolExecutor scheduler)
-
refreshDelayStrategy
public DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder refreshDelayStrategy(Function<Duration,Duration> refreshDelayStrategy)
Set the strategy to schedule credentials refresh after credentials retrieval.Default is a 80 % ratio-based strategy (refresh is scheduled after 80 % of the time before expiration, e.g. 48 minutes for a token with a validity of 60 minutes, that is refresh will be scheduled 12 minutes before the token actually expires).
- Parameters:
refreshDelayStrategy
-- Returns:
- this builder instance
- See Also:
DefaultCredentialsRefreshService.refreshDelayStrategy
,DefaultCredentialsRefreshService.ratioRefreshDelayStrategy(double)
-
approachingExpirationStrategy
public DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder approachingExpirationStrategy(Function<Duration,Boolean> approachingExpirationStrategy)
Set the strategy to trigger an early refresh before attempting to connect.Default is to never advise to refresh before connecting.
- Parameters:
approachingExpirationStrategy
-- Returns:
- this builder instances
- See Also:
DefaultCredentialsRefreshService.approachingExpirationStrategy
,CredentialsRefreshService.isApproachingExpiration(Duration)
-
build
public DefaultCredentialsRefreshService build()
Create theDefaultCredentialsRefreshService
instance.- Returns:
-
-