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

grpc / grpc-java / #18797

17 Aug 2023 11:32PM UTC coverage: 88.278% (-0.03%) from 88.304%
#18797

push

github-actions

web-flow
buildscripts: add missing $GRADLE_FLAGS to enable AndroidX (#10504)

30342 of 34371 relevant lines covered (88.28%)

0.88 hits per line

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

80.0
/../xds/src/main/java/io/grpc/xds/RouterFilter.java
1
/*
2
 * Copyright 2021 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 com.google.protobuf.Message;
20
import io.grpc.ClientInterceptor;
21
import io.grpc.LoadBalancer.PickSubchannelArgs;
22
import io.grpc.ServerInterceptor;
23
import io.grpc.xds.Filter.ClientInterceptorBuilder;
24
import io.grpc.xds.Filter.ServerInterceptorBuilder;
25
import java.util.concurrent.ScheduledExecutorService;
26
import javax.annotation.Nullable;
27

28
/**
29
 * Router filter implementation. Currently this filter does not parse any field in the config.
30
 */
31
enum RouterFilter implements Filter, ClientInterceptorBuilder, ServerInterceptorBuilder {
1✔
32
  INSTANCE;
1✔
33

34
  static final String TYPE_URL =
35
      "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router";
36

37
  static final FilterConfig ROUTER_CONFIG = new FilterConfig() {
1✔
38
    @Override
39
    public String typeUrl() {
40
      return RouterFilter.TYPE_URL;
1✔
41
    }
42

43
    @Override
44
    public String toString() {
45
      return "ROUTER_CONFIG";
×
46
    }
47
  };
48

49
  @Override
50
  public String[] typeUrls() {
51
    return new String[] { TYPE_URL };
1✔
52
  }
53

54
  @Override
55
  public ConfigOrError<? extends FilterConfig> parseFilterConfig(Message rawProtoMessage) {
56
    return ConfigOrError.fromConfig(ROUTER_CONFIG);
1✔
57
  }
58

59
  @Override
60
  public ConfigOrError<? extends FilterConfig> parseFilterConfigOverride(Message rawProtoMessage) {
61
    return ConfigOrError.fromError("Router Filter should not have override config");
×
62
  }
63

64
  @Nullable
65
  @Override
66
  public ClientInterceptor buildClientInterceptor(
67
      FilterConfig config, @Nullable FilterConfig overrideConfig, PickSubchannelArgs args,
68
      ScheduledExecutorService scheduler) {
69
    return null;
1✔
70
  }
71

72
  @Nullable
73
  @Override
74
  public ServerInterceptor buildServerInterceptor(
75
      FilterConfig config, @Nullable Filter.FilterConfig overrideConfig) {
76
    return null;
1✔
77
  }
78
}
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

© 2026 Coveralls, Inc