public abstract static class NameResolver.Factory extends Object
Modifier and Type | Field and Description |
---|---|
static Attributes.Key<Integer> |
PARAMS_DEFAULT_PORT
The port number used in case the target or the underlying naming system doesn't provide a
port number.
|
Constructor and Description |
---|
Factory() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getDefaultScheme()
Returns the default scheme, which will be used to construct a URI when
ManagedChannelBuilder.forTarget(String) is given an authority string instead of a compliant
URI. |
abstract NameResolver |
newNameResolver(URI targetUri,
Attributes params)
Creates a
NameResolver for the given target URI, or null if the given URI
cannot be resolved by this factory. |
public static final Attributes.Key<Integer> PARAMS_DEFAULT_PORT
@Nullable public abstract NameResolver newNameResolver(URI targetUri, Attributes params)
NameResolver
for the given target URI, or null
if the given URI
cannot be resolved by this factory. The decision should be solely based on the scheme of the
URI.targetUri
- the target URI to be resolved, whose scheme must not be null
params
- optional parameters. Canonical keys are defined as PARAMS_*
fields in
NameResolver.Factory
.public abstract String getDefaultScheme()
ManagedChannelBuilder.forTarget(String)
is given an authority string instead of a compliant
URI.