• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

grpc / grpc-java / #19747

21 Mar 2025 10:19PM UTC coverage: 88.583% (-0.02%) from 88.604%
#19747

push

github

web-flow
xds: add support for custom per-target credentials on the transport (#11951)

34606 of 39066 relevant lines covered (88.58%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/../xds/src/main/java/io/grpc/xds/InternalSharedXdsClientPoolProvider.java
1
/*
2
 * Copyright 2022 The gRPC Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package io.grpc.xds;
18

19
import io.grpc.CallCredentials;
20
import io.grpc.Internal;
21
import io.grpc.MetricRecorder;
22
import io.grpc.internal.ObjectPool;
23
import io.grpc.xds.client.XdsClient;
24
import io.grpc.xds.client.XdsInitializationException;
25
import java.util.Map;
26

27
/**
28
 * Accessor for global factory for managing XdsClient instance.
29
 */
30
@Internal
31
public final class InternalSharedXdsClientPoolProvider {
32
  // Prevent instantiation
33
  private InternalSharedXdsClientPoolProvider() {}
34

35
  public static void setDefaultProviderBootstrapOverride(Map<String, ?> bootstrap) {
36
    SharedXdsClientPoolProvider.getDefaultProvider().setBootstrapOverride(bootstrap);
×
37
  }
×
38

39
  public static ObjectPool<XdsClient> getOrCreate(String target)
40
      throws XdsInitializationException {
41
    return getOrCreate(target, new MetricRecorder() {});
×
42
  }
43

44
  public static ObjectPool<XdsClient> getOrCreate(String target, MetricRecorder metricRecorder)
45
      throws XdsInitializationException {
46
    return getOrCreate(target, metricRecorder, null);
×
47
  }
48

49
  public static ObjectPool<XdsClient> getOrCreate(
50
      String target, MetricRecorder metricRecorder, CallCredentials transportCallCredentials)
51
      throws XdsInitializationException {
52
    return SharedXdsClientPoolProvider.getDefaultProvider()
×
53
        .getOrCreate(target, metricRecorder, transportCallCredentials);
×
54
  }
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc