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
ABootstrapperimplementation that reads xDS configurations from local file system.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBootstrapperImpl.FileReaderReads the content of the file with the given path in the file system.protected static classBootstrapperImpl.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.StringCLIENT_FEATURE_DISABLE_OVERPROVISIONINGstatic java.lang.StringCLIENT_FEATURE_RESOURCE_IN_SOTWprotected XdsLoggerloggerprotected BootstrapperImpl.FileReaderreaderprivate static java.lang.StringSERVER_FEATURE_IGNORE_RESOURCE_DELETION-
Fields inherited from class io.grpc.xds.client.Bootstrapper
XDSTP_SCHEME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBootstrapperImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Bootstrapper.BootstrapInfobootstrap()Reads and parses bootstrap config.Bootstrapper.BootstrapInfobootstrap(java.util.Map<java.lang.String,?> rawData)Returns bootstrap configuration given by the raw data in JSON format.protected Bootstrapper.BootstrapInfo.BuilderbootstrapBuilder(java.util.Map<java.lang.String,?> rawData)private static <T> TcheckForNull(T value, java.lang.String fieldName)protected abstract java.lang.ObjectgetImplSpecificConfig(java.util.Map<java.lang.String,?> serverConfig, java.lang.String serverUri)protected abstract java.lang.StringgetJsonContent()private java.util.List<Bootstrapper.ServerInfo>parseServerInfos(java.util.List<?> rawServerConfigs, XdsLogger logger)voidsetFileReader(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.IOExceptionXdsInitializationException
-
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:
bootstrapin classBootstrapper- Throws:
XdsInitializationException
-
bootstrap
public Bootstrapper.BootstrapInfo bootstrap(java.util.Map<java.lang.String,?> rawData) throws XdsInitializationException
Description copied from class:BootstrapperReturns bootstrap configuration given by the raw data in JSON format.- Overrides:
bootstrapin 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
-
-