Package io.grpc.xds.internal
Class TlsXdsCredentialsProvider
- java.lang.Object
-
- io.grpc.xds.XdsCredentialsProvider
-
- io.grpc.xds.internal.TlsXdsCredentialsProvider
-
public final class TlsXdsCredentialsProvider extends XdsCredentialsProvider
A wrapper class that supportsTlsChannelCredentials
for Xds by implementingXdsCredentialsProvider
.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CREDS_NAME
-
Constructor Summary
Constructors Constructor Description TlsXdsCredentialsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getName()
Returns the xDS credential name associated with this provider which makes it selectable viaXdsCredentialsRegistry.getProvider(java.lang.String)
.boolean
isAvailable()
Whether this provider is available for use, taking the current environment into consideration.protected io.grpc.ChannelCredentials
newChannelCredentials(java.util.Map<java.lang.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 Detail
-
CREDS_NAME
private static final java.lang.String CREDS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
newChannelCredentials
protected io.grpc.ChannelCredentials newChannelCredentials(java.util.Map<java.lang.String,?> jsonConfig)
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
protected java.lang.String 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
-
-