public class ConfigMappedNameResolverFactory extends NameResolver.Factory
NameResolver
factory that uses the the properties to rewrite the target uri.
The delegated factory can access the name
and
properties
for the client via the extended and forwarded
Attributes
.
PARAMS_DEFAULT_PORT
Constructor and Description |
---|
ConfigMappedNameResolverFactory(GrpcChannelsProperties config,
NameResolver.Factory delegate,
Function<String,URI> defaultUriMapper)
Creates a new ConfigMappedNameResolverFactory with the given config that resolves the remapped target uri using
the given delegate.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultScheme() |
NameResolver |
newNameResolver(URI targetUri,
Attributes params) |
String |
toString() |
public ConfigMappedNameResolverFactory(GrpcChannelsProperties config, NameResolver.Factory delegate, Function<String,URI> defaultUriMapper)
config
- The config used to remap the target uri.delegate
- The delegate used to resolve the remapped target uri.defaultUriMapper
- The function to use when no uri is configured for a certain endpoint. This can be useful
if the address can be derived from the client name.@Nullable public NameResolver newNameResolver(URI targetUri, Attributes params)
newNameResolver
in class NameResolver.Factory
public String getDefaultScheme()
getDefaultScheme
in class NameResolver.Factory