Package io.grpc.xds.internal
Class GoogleDefaultXdsCredentialsProvider
java.lang.Object
io.grpc.xds.XdsCredentialsProvider
io.grpc.xds.internal.GoogleDefaultXdsCredentialsProvider
A wrapper class that supports
GoogleDefaultChannelCredentials
for
Xds by implementing XdsCredentialsProvider
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getName()
Returns the xDS credential name associated with this provider which makes it selectable viaXdsCredentialsRegistry.getProvider(java.lang.String)
.boolean
Whether this provider is available for use, taking the current environment into consideration.protected io.grpc.ChannelCredentials
newChannelCredentials
(Map<String, ?> jsonConfig) Creates aChannelCredentials
from the given jsonConfig, ornull
if the given config is invalid.int
priority()
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.
-
Field Details
-
CREDS_NAME
- See Also:
-
-
Constructor Details
-
GoogleDefaultXdsCredentialsProvider
public GoogleDefaultXdsCredentialsProvider()
-
-
Method Details
-
newChannelCredentials
Description copied from class:XdsCredentialsProvider
Creates aChannelCredentials
from the given jsonConfig, ornull
if the given config is invalid. The provider is free to ignore the config if it's not needed for producing the channel credentials.- Specified by:
newChannelCredentials
in classXdsCredentialsProvider
- Parameters:
jsonConfig
- json config that can be consumed by the provider to create the channel credentials
-
getName
Description copied from class:XdsCredentialsProvider
Returns the xDS credential name associated with this provider which makes it selectable viaXdsCredentialsRegistry.getProvider(java.lang.String)
. This is called only when the class is loaded. It shouldn't change, and there is no point doing so.- Specified by:
getName
in classXdsCredentialsProvider
-
isAvailable
public boolean isAvailable()Description copied from class:XdsCredentialsProvider
Whether this provider is available for use, taking the current environment into consideration. Iffalse
,XdsCredentialsProvider.newChannelCredentials(java.util.Map<java.lang.String, ?>)
is not safe to be called.- Specified by:
isAvailable
in classXdsCredentialsProvider
-
priority
public int priority()Description copied from class:XdsCredentialsProvider
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
priority
in classXdsCredentialsProvider
-