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 of
DefaultCredentialsRefreshService.DefaultCredentialsRefreshServiceBuilder
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapproachingExpirationStrategy
(Function<Duration, Boolean> approachingExpirationStrategy) Set the strategy to trigger an early refresh before attempting to connect.build()
Create theDefaultCredentialsRefreshService
instance.refreshDelayStrategy
(Function<Duration, Duration> refreshDelayStrategy) Set the strategy to schedule credentials refresh after credentials retrieval.scheduler
(ScheduledThreadPoolExecutor scheduler)
-
Constructor Details
-
DefaultCredentialsRefreshServiceBuilder
public DefaultCredentialsRefreshServiceBuilder()
-
-
Method Details
-
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:
-
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:
-
build
Create theDefaultCredentialsRefreshService
instance.- Returns:
-