Package com.rabbitmq.client.amqp.oauth2
Class TokenCredentialsManager
java.lang.Object
com.rabbitmq.client.amqp.oauth2.TokenCredentialsManager
- All Implemented Interfaces:
CredentialsManager
Credentials manager implementation that requests and refreshes tokens.
It also keeps track of registration and update them with refreshed tokens when appropriate.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.rabbitmq.client.amqp.oauth2.CredentialsManager
CredentialsManager.AuthenticationCallback, CredentialsManager.NoOpCredentialsManager, CredentialsManager.NoOpRegistration, CredentialsManager.Registration
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from interface com.rabbitmq.client.amqp.oauth2.CredentialsManager
NO_OP
-
Constructor Summary
ConstructorDescriptionTokenCredentialsManager
(TokenRequester requester, ScheduledExecutorService scheduledExecutorService, Function<Instant, Duration> refreshDelayStrategy) -
Method Summary
Modifier and TypeMethodDescriptionratioRefreshDelayStrategy
(float ratio) register
(String name, CredentialsManager.AuthenticationCallback updateCallback) Register a component for authentication.
-
Field Details
-
DEFAULT_REFRESH_DELAY_STRATEGY
-
-
Constructor Details
-
TokenCredentialsManager
public TokenCredentialsManager(TokenRequester requester, ScheduledExecutorService scheduledExecutorService, Function<Instant, Duration> refreshDelayStrategy)
-
-
Method Details
-
register
public CredentialsManager.Registration register(String name, CredentialsManager.AuthenticationCallback updateCallback) Description copied from interface:CredentialsManager
Register a component for authentication.- Specified by:
register
in interfaceCredentialsManager
- Parameters:
name
- component name (must be unique)updateCallback
- callback to update the component authentication- Returns:
- the registration (must be closed when no longer necessary)
-
ratioRefreshDelayStrategy
-