Class ManagedChannelImplBuilder.DirectAddressNameResolverProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.net.SocketAddress address  
      (package private) java.lang.String authority  
      (package private) java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> producedSocketAddressTypes  
    • 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 when ManagedChannelBuilder.forTarget(String) is given an authority string instead of a compliant URI.
      java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getProducedSocketAddressTypes()
      Returns the SocketAddress 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.
      NameResolver newNameResolver​(java.net.URI notUsedUri, NameResolver.Args args)
      Creates a NameResolver for the given target URI, or null if the given URI cannot be resolved by this factory.
      protected int priority()
      A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • address

        final java.net.SocketAddress address
      • authority

        final java.lang.String authority
      • producedSocketAddressTypes

        final java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> producedSocketAddressTypes
    • Constructor Detail

      • DirectAddressNameResolverProvider

        DirectAddressNameResolverProvider​(java.net.SocketAddress address,
                                          java.lang.String authority)
    • Method Detail

      • newNameResolver

        public NameResolver newNameResolver​(java.net.URI notUsedUri,
                                            NameResolver.Args args)
        Description copied from class: NameResolver.Factory
        Creates a 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.
        Specified by:
        newNameResolver in class NameResolver.Factory
        Parameters:
        notUsedUri - the target URI to be resolved, whose scheme must not be null
        args - other information that may be useful
      • isAvailable

        protected boolean isAvailable()
        Description copied from class: NameResolverProvider
        Whether this provider is available for use, taking the current environment into consideration. If false, no other methods are safe to be called.
        Specified by:
        isAvailable in class NameResolverProvider
      • priority

        protected 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 class NameResolverProvider
      • getProducedSocketAddressTypes

        public java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getProducedSocketAddressTypes()
        Description copied from class: NameResolverProvider
        Returns the SocketAddress types this provider's name-resolver is capable of producing. This enables selection of the appropriate ManagedChannelProvider for a channel.
        Overrides:
        getProducedSocketAddressTypes in class NameResolverProvider
        Returns:
        the SocketAddress types this provider's name-resolver is capable of producing.