Package io.grpc.grpclb
Class SecretGrpclbNameResolverProvider.Provider
- java.lang.Object
-
- io.grpc.NameResolver.Factory
-
- io.grpc.NameResolverProvider
-
- io.grpc.grpclb.SecretGrpclbNameResolverProvider.Provider
-
- Enclosing class:
- SecretGrpclbNameResolverProvider
public static final class SecretGrpclbNameResolverProvider.Provider extends NameResolverProvider
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
IS_ANDROID
private static java.lang.String
SCHEME
-
Constructor Summary
Constructors Constructor Description Provider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDefaultScheme()
Returns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)
is given an authority string instead of a compliant URI.java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>>
getProducedSocketAddressTypes()
Returns theSocketAddress
types this provider's name-resolver is capable of producing.protected boolean
isAvailable()
Whether this provider is available for use, taking the current environment into consideration.GrpclbNameResolver
newNameResolver(java.net.URI targetUri, NameResolver.Args args)
Creates aNameResolver
for the given target URI, ornull
if the given URI cannot be resolved by this factory.int
priority()
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.-
Methods inherited from class io.grpc.NameResolverProvider
getScheme
-
-
-
-
Field Detail
-
SCHEME
private static final java.lang.String SCHEME
- See Also:
- Constant Field Values
-
IS_ANDROID
private static final boolean IS_ANDROID
-
-
Method Detail
-
newNameResolver
public GrpclbNameResolver newNameResolver(java.net.URI targetUri, NameResolver.Args args)
Description copied from class:NameResolver.Factory
Creates aNameResolver
for the given target URI, ornull
if the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Specified by:
newNameResolver
in classNameResolver.Factory
- Parameters:
targetUri
- the target URI to be resolved, whose scheme must not benull
args
- other information that may be useful
-
getDefaultScheme
public java.lang.String getDefaultScheme()
Description copied from class:NameResolver.Factory
Returns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)
is given an authority string instead of a compliant URI.- Specified by:
getDefaultScheme
in classNameResolver.Factory
-
isAvailable
protected boolean isAvailable()
Description copied from class:NameResolverProvider
Whether this provider is available for use, taking the current environment into consideration. Iffalse
, no other methods are safe to be called.- Specified by:
isAvailable
in classNameResolverProvider
-
priority
public int priority()
Description copied from class:NameResolverProvider
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
priority
in classNameResolverProvider
-
getProducedSocketAddressTypes
public java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getProducedSocketAddressTypes()
Description copied from class:NameResolverProvider
Returns theSocketAddress
types this provider's name-resolver is capable of producing. This enables selection of the appropriateManagedChannelProvider
for a channel.- Overrides:
getProducedSocketAddressTypes
in classNameResolverProvider
- Returns:
- the
SocketAddress
types this provider's name-resolver is capable of producing.
-
-