Package com.volcengine.auth
Class DefaultCredentialProvider
- java.lang.Object
-
- com.volcengine.auth.DefaultCredentialProvider
-
- All Implemented Interfaces:
Provider
public class DefaultCredentialProvider extends Object implements Provider
Default provider chain. Walks a fixed list of providers on refresh, selecting the first provider that successfully obtains credentials.Follows the
ProviderCQS contract:isExpired()/retrieve()are pure reads.refresh()is the only method that mutates state. It either refreshes the last successful provider (whenreuseLastProviderEnabledis true) or walks the chain and setslastSuccessProvideron the first success.
Intended to be wrapped in a
CredentialProvider, which serializes refresh through aReadWriteLockand guarantees theisExpired → refresh → retrievesequence. Direct use (without wrapping) is not a supported mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultCredentialProvider.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultCredentialProvider.Builderbuilder()static DefaultCredentialProvidercreate()booleanisExpired()voidrefresh()CredentialValueretrieve()
-
-
-
Method Detail
-
create
public static DefaultCredentialProvider create()
-
builder
public static DefaultCredentialProvider.Builder builder()
-
refresh
public void refresh() throws ApiException- Specified by:
refreshin interfaceProvider- Throws:
ApiException
-
retrieve
public CredentialValue retrieve() throws ApiException
- Specified by:
retrievein interfaceProvider- Throws:
ApiException
-
-