Package io.grpc.netty
Class UdsNameResolver
- java.lang.Object
-
- io.grpc.NameResolver
-
- io.grpc.netty.UdsNameResolver
-
final class UdsNameResolver extends NameResolver
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.NameResolver
NameResolver.Args, NameResolver.ConfigOrError, NameResolver.Factory, NameResolver.Listener, NameResolver.Listener2, NameResolver.ResolutionResult, NameResolver.ResolutionResultAttr, NameResolver.ServiceConfigParser
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringauthorityprivate NameResolver.Listener2listener
-
Constructor Summary
Constructors Constructor Description UdsNameResolver(java.lang.String authority, java.lang.String targetPath, NameResolver.Args args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetServiceAuthority()Returns the authority used to authenticate connections to servers.voidrefresh()Re-resolve the name.private voidresolve()voidshutdown()Stops the resolution.voidstart(NameResolver.Listener2 listener)Starts the resolution.-
Methods inherited from class io.grpc.NameResolver
start
-
-
-
-
Field Detail
-
listener
private NameResolver.Listener2 listener
-
authority
private final java.lang.String authority
-
-
Constructor Detail
-
UdsNameResolver
UdsNameResolver(java.lang.String authority, java.lang.String targetPath, NameResolver.Args args)
-
-
Method Detail
-
getServiceAuthority
public java.lang.String getServiceAuthority()
Description copied from class:NameResolverReturns the authority used to authenticate connections to servers. It must be from a trusted source, because if the authority is tampered with, RPCs may be sent to the attackers which may leak sensitive user data.An implementation must generate it without blocking, typically in line, and must keep it unchanged.
NameResolvers created from the same factory with the same argument must return the same authority.- Specified by:
getServiceAuthorityin classNameResolver
-
start
public void start(NameResolver.Listener2 listener)
Description copied from class:NameResolverStarts the resolution. The method is not supposed to throw any exceptions. That might cause the Channel that the name resolver is serving to crash. Errors should be propagated throughNameResolver.Listener2.onError(io.grpc.Status).An instance may not be started more than once, by any overload of this method, even after an intervening call to
NameResolver.shutdown().- Overrides:
startin classNameResolver- Parameters:
listener- used to receive updates on the target
-
refresh
public void refresh()
Description copied from class:NameResolverRe-resolve the name.Can only be called after
NameResolver.start(io.grpc.NameResolver.Listener)has been called.This is only a hint. Implementation takes it as a signal but may not start resolution immediately. It should never throw.
The default implementation is no-op.
- Overrides:
refreshin classNameResolver
-
resolve
private void resolve()
-
shutdown
public void shutdown()
Description copied from class:NameResolverStops the resolution. Updates to the Listener will stop.- Specified by:
shutdownin classNameResolver
-
-