Package com.rabbitmq.client.impl
Interface CredentialsProvider
-
- All Known Implementing Classes:
DefaultCredentialsProvider
,OAuth2ClientCredentialsGrantCredentialsProvider
,RefreshProtectedCredentialsProvider
public interface CredentialsProvider
Provider interface for establishing credentials for connecting to the broker. Especially useful for situations where credentials might expire or change before a recovery takes place or where it is convenient to plug in an outside custom implementation.- Since:
- 5.2.0
- See Also:
CredentialsRefreshService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getPassword()
Password/secret/token to use for authenticationdefault Duration
getTimeBeforeExpiration()
The time before the credentials expire, if they do expire.String
getUsername()
Username to use for authenticationdefault void
refresh()
Instructs the provider to refresh or renew credentials.
-
-
-
Method Detail
-
getUsername
String getUsername()
Username to use for authentication- Returns:
- username
-
getPassword
String getPassword()
Password/secret/token to use for authentication- Returns:
- password/secret/token
-
getTimeBeforeExpiration
default Duration getTimeBeforeExpiration()
The time before the credentials expire, if they do expire.If credentials do not expire, must return null. Default behavior is to return null, assuming credentials never expire.
- Returns:
- time before expiration
-
refresh
default void refresh()
Instructs the provider to refresh or renew credentials.Default behavior is no-op.
-
-