public class ConfigMappedNameResolverFactory
extends io.grpc.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
.
Constructor and Description |
---|
ConfigMappedNameResolverFactory(GrpcChannelsProperties config,
io.grpc.NameResolver.Factory delegate,
java.util.function.Function<java.lang.String,java.net.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 |
---|---|
java.lang.String |
getDefaultScheme() |
io.grpc.NameResolver |
newNameResolver(java.net.URI targetUri,
io.grpc.Attributes params) |
java.lang.String |
toString() |
public ConfigMappedNameResolverFactory(GrpcChannelsProperties config, io.grpc.NameResolver.Factory delegate, java.util.function.Function<java.lang.String,java.net.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 io.grpc.NameResolver newNameResolver(java.net.URI targetUri, io.grpc.Attributes params)
newNameResolver
in class io.grpc.NameResolver.Factory
public java.lang.String getDefaultScheme()
getDefaultScheme
in class io.grpc.NameResolver.Factory
public java.lang.String toString()
toString
in class java.lang.Object