Package io.grpc
Class NameResolver.Factory
- java.lang.Object
-
- io.grpc.NameResolver.Factory
-
- Direct Known Subclasses:
NameResolverProvider
- Enclosing class:
- NameResolver
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770") public abstract static class NameResolver.Factory extends java.lang.Object
Factory that createsNameResolverinstances.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static Attributes.Key<java.lang.Integer>PARAMS_DEFAULT_PORTDeprecated.this will be deleted along withnewNameResolver(URI, Attributes)in a future release.static Attributes.Key<ProxyDetector>PARAMS_PROXY_DETECTORDeprecated.this will be deleted along withnewNameResolver(URI, Attributes)in a future release
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract java.lang.StringgetDefaultScheme()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.NameResolvernewNameResolver(java.net.URI targetUri, Attributes params)Deprecated.ImplementnewNameResolver(URI, NameResolver.Helper)instead.NameResolvernewNameResolver(java.net.URI targetUri, NameResolver.Args args)Creates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory.NameResolvernewNameResolver(java.net.URI targetUri, NameResolver.Helper helper)Deprecated.implementnewNameResolver(URI, NameResolver.Args)instead
-
-
-
Field Detail
-
PARAMS_DEFAULT_PORT
@Deprecated public static final Attributes.Key<java.lang.Integer> PARAMS_DEFAULT_PORT
Deprecated.this will be deleted along withnewNameResolver(URI, Attributes)in a future release.The port number used in case the target or the underlying naming system doesn't provide a port number.- Since:
- 1.0.0
-
PARAMS_PROXY_DETECTOR
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/5113") @Deprecated public static final Attributes.Key<ProxyDetector> PARAMS_PROXY_DETECTOR
Deprecated.this will be deleted along withnewNameResolver(URI, Attributes)in a future releaseIf the NameResolver wants to support proxy, it should inquire thisProxyDetector. See documentation onProxyDetectorabout how proxies work in gRPC.
-
-
Method Detail
-
newNameResolver
@Nullable @Deprecated public NameResolver newNameResolver(java.net.URI targetUri, Attributes params)
Deprecated.ImplementnewNameResolver(URI, NameResolver.Helper)instead. This is going to be deleted in a future release.Creates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Parameters:
targetUri- the target URI to be resolved, whose scheme must not benullparams- optional parameters. Canonical keys are defined asPARAMS_*fields inNameResolver.Factory.- Since:
- 1.0.0
-
newNameResolver
@Deprecated @Nullable public NameResolver newNameResolver(java.net.URI targetUri, NameResolver.Helper helper)
Deprecated.implementnewNameResolver(URI, NameResolver.Args)insteadCreates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Parameters:
targetUri- the target URI to be resolved, whose scheme must not benullhelper- utility that may be used by the NameResolver implementation- Since:
- 1.19.0
-
newNameResolver
public NameResolver newNameResolver(java.net.URI targetUri, NameResolver.Args args)
Creates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Parameters:
targetUri- the target URI to be resolved, whose scheme must not benullargs- other information that may be useful- Since:
- 1.21.0
-
getDefaultScheme
public abstract 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.- Since:
- 1.0.0
-
-