Router filter implementation. Currently this filter does not parse any field in the config.
| 22 | * Router filter implementation. Currently this filter does not parse any field in the config. |
| 23 | */ |
| 24 | final class RouterFilter implements Filter { |
| 25 | private static final RouterFilter INSTANCE = new RouterFilter(); |
| 26 | |
| 27 | static final String TYPE_URL = |
| 28 | "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"; |
| 29 | |
| 30 | static final FilterConfig ROUTER_CONFIG = new FilterConfig() { |
| 31 | @Override |
| 32 | public String typeUrl() { |
| 33 | return TYPE_URL; |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public String toString() { |
| 38 | return "ROUTER_CONFIG"; |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | static final class Provider implements Filter.Provider { |
| 43 | @Override |
| 44 | public String[] typeUrls() { |
| 45 | return new String[]{TYPE_URL}; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public boolean isClientFilter() { |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public boolean isServerFilter() { |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public RouterFilter newInstance(String name) { |
| 60 | return INSTANCE; |
| 61 | } |
| 62 | |
| 63 | @Override |
| 64 | public ConfigOrError<? extends FilterConfig> parseFilterConfig( |
| 65 | Message rawProtoMessage, FilterConfigParseContext context) { |
| 66 | return ConfigOrError.fromConfig(ROUTER_CONFIG); |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | public ConfigOrError<? extends FilterConfig> parseFilterConfigOverride( |
| 71 | Message rawProtoMessage, FilterConfigParseContext context) { |
| 72 | return ConfigOrError.fromError("Router Filter should not have override config"); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | private RouterFilter() {} |
| 77 | } |
nothing calls this directly
no outgoing calls
no test coverage detected