Package io.grpc.xds.client
Class BootstrapperImpl
- java.lang.Object
-
- io.grpc.xds.client.Bootstrapper
-
- io.grpc.xds.client.BootstrapperImpl
-
- Direct Known Subclasses:
GrpcBootstrapperImpl
@Internal public abstract class BootstrapperImpl extends Bootstrapper
ABootstrapper
implementation that reads xDS configurations from local file system.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BootstrapperImpl.FileReader
Reads the content of the file with the given path in the file system.protected static class
BootstrapperImpl.LocalFileReader
-
Nested classes/interfaces inherited from class io.grpc.xds.client.Bootstrapper
Bootstrapper.AuthorityInfo, Bootstrapper.BootstrapInfo, Bootstrapper.CertificateProviderInfo, Bootstrapper.ServerInfo
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_FEATURE_DISABLE_OVERPROVISIONING
static java.lang.String
CLIENT_FEATURE_RESOURCE_IN_SOTW
protected XdsLogger
logger
protected BootstrapperImpl.FileReader
reader
private static java.lang.String
SERVER_FEATURE_IGNORE_RESOURCE_DELETION
-
Fields inherited from class io.grpc.xds.client.Bootstrapper
XDSTP_SCHEME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BootstrapperImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Bootstrapper.BootstrapInfo
bootstrap()
Reads and parses bootstrap config.Bootstrapper.BootstrapInfo
bootstrap(java.util.Map<java.lang.String,?> rawData)
Returns bootstrap configuration given by the raw data in JSON format.protected Bootstrapper.BootstrapInfo.Builder
bootstrapBuilder(java.util.Map<java.lang.String,?> rawData)
private static <T> T
checkForNull(T value, java.lang.String fieldName)
protected abstract java.lang.Object
getImplSpecificConfig(java.util.Map<java.lang.String,?> serverConfig, java.lang.String serverUri)
protected abstract java.lang.String
getJsonContent()
private java.util.List<Bootstrapper.ServerInfo>
parseServerInfos(java.util.List<?> rawServerConfigs, XdsLogger logger)
void
setFileReader(BootstrapperImpl.FileReader reader)
-
-
-
Field Detail
-
CLIENT_FEATURE_DISABLE_OVERPROVISIONING
public static final java.lang.String CLIENT_FEATURE_DISABLE_OVERPROVISIONING
- See Also:
- Constant Field Values
-
CLIENT_FEATURE_RESOURCE_IN_SOTW
public static final java.lang.String CLIENT_FEATURE_RESOURCE_IN_SOTW
- See Also:
- Constant Field Values
-
SERVER_FEATURE_IGNORE_RESOURCE_DELETION
private static final java.lang.String SERVER_FEATURE_IGNORE_RESOURCE_DELETION
- See Also:
- Constant Field Values
-
logger
protected final XdsLogger logger
-
reader
protected BootstrapperImpl.FileReader reader
-
-
Method Detail
-
getJsonContent
protected abstract java.lang.String getJsonContent() throws java.io.IOException, XdsInitializationException
- Throws:
java.io.IOException
XdsInitializationException
-
getImplSpecificConfig
protected abstract java.lang.Object getImplSpecificConfig(java.util.Map<java.lang.String,?> serverConfig, java.lang.String serverUri) throws XdsInitializationException
- Throws:
XdsInitializationException
-
bootstrap
public Bootstrapper.BootstrapInfo bootstrap() throws XdsInitializationException
Reads and parses bootstrap config. The config is expected to be in JSON format.- Specified by:
bootstrap
in classBootstrapper
- Throws:
XdsInitializationException
-
bootstrap
public Bootstrapper.BootstrapInfo bootstrap(java.util.Map<java.lang.String,?> rawData) throws XdsInitializationException
Description copied from class:Bootstrapper
Returns bootstrap configuration given by the raw data in JSON format.- Overrides:
bootstrap
in classBootstrapper
- Throws:
XdsInitializationException
-
bootstrapBuilder
protected Bootstrapper.BootstrapInfo.Builder bootstrapBuilder(java.util.Map<java.lang.String,?> rawData) throws XdsInitializationException
- Throws:
XdsInitializationException
-
parseServerInfos
private java.util.List<Bootstrapper.ServerInfo> parseServerInfos(java.util.List<?> rawServerConfigs, XdsLogger logger) throws XdsInitializationException
- Throws:
XdsInitializationException
-
setFileReader
public void setFileReader(BootstrapperImpl.FileReader reader)
-
checkForNull
private static <T> T checkForNull(T value, java.lang.String fieldName) throws XdsInitializationException
- Throws:
XdsInitializationException
-
-