Package com.rabbitmq.stream.oauth2
Class TokenCredentialsManager
java.lang.Object
com.rabbitmq.stream.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.stream.oauth2.CredentialsManager
CredentialsManager.AuthenticationCallback, CredentialsManager.NoOpCredentialsManager, CredentialsManager.NoOpRegistration, CredentialsManager.Registration -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface com.rabbitmq.stream.oauth2.CredentialsManager
NO_OP -
Constructor Summary
ConstructorsConstructorDescriptionTokenCredentialsManager(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:CredentialsManagerRegister a component for authentication.- Specified by:
registerin 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
-