1919import com .google .common .annotations .VisibleForTesting ;
2020import com .google .common .collect .ImmutableList ;
2121import com .google .common .collect .ImmutableMap ;
22- import io .grpc .CallCredentials ;
23- import io .grpc .ChannelCredentials ;
24- import io .grpc .CompositeChannelCredentials ;
2522import io .grpc .Internal ;
2623import io .grpc .InternalLogId ;
2724import io .grpc .internal .GrpcUtil ;
@@ -79,13 +76,9 @@ protected BootstrapperImpl() {
7976
8077 protected abstract String getJsonContent () throws IOException , XdsInitializationException ;
8178
82- protected abstract Object getImplSpecificChannelCredConfig (
83- Map <String , ?> serverConfig , String serverUri )
79+ protected abstract Object getImplSpecificConfig (Map <String , ?> serverConfig , String serverUri )
8480 throws XdsInitializationException ;
8581
86- protected abstract Object getImplSpecificCallCredConfig (
87- Map <String , ?> serverConfig , String serverUri )
88- throws XdsInitializationException ;
8982
9083 /**
9184 * Reads and parses bootstrap config. The config is expected to be in JSON format.
@@ -260,9 +253,7 @@ private List<ServerInfo> parseServerInfos(List<?> rawServerConfigs, XdsLogger lo
260253 }
261254 logger .log (XdsLogLevel .INFO , "xDS server URI: {0}" , serverUri );
262255
263- Object implSpecificChannelCredConfig =
264- getImplSpecificChannelCredConfig (serverConfig , serverUri );
265- Object implSpecificCallCredConfig = getImplSpecificCallCredConfig (serverConfig , serverUri );
256+ Object implSpecificConfig = getImplSpecificConfig (serverConfig , serverUri );
266257
267258 boolean resourceTimerIsTransientError = false ;
268259 boolean ignoreResourceDeletion = false ;
@@ -276,17 +267,10 @@ private List<ServerInfo> parseServerInfos(List<?> rawServerConfigs, XdsLogger lo
276267 && serverFeatures .contains (SERVER_FEATURE_RESOURCE_TIMER_IS_TRANSIENT_ERROR );
277268 }
278269 servers .add (
279- ServerInfo .create (
280- serverUri ,
281- (implSpecificCallCredConfig != null )
282- ? CompositeChannelCredentials .create (
283- (ChannelCredentials ) implSpecificChannelCredConfig ,
284- (CallCredentials ) implSpecificCallCredConfig )
285- : implSpecificChannelCredConfig ,
286- ignoreResourceDeletion ,
287- serverFeatures != null
288- && serverFeatures .contains (SERVER_FEATURE_TRUSTED_XDS_SERVER ),
289- resourceTimerIsTransientError ));
270+ ServerInfo .create (serverUri , implSpecificConfig , ignoreResourceDeletion ,
271+ serverFeatures != null
272+ && serverFeatures .contains (SERVER_FEATURE_TRUSTED_XDS_SERVER ),
273+ resourceTimerIsTransientError ));
290274 }
291275 return servers .build ();
292276 }
0 commit comments