Class ChannelFactory


  • public class ChannelFactory
    extends Object
    Factory class that creates ManagedChannel objects that corresponds to given gRPC stubs.
    • Constructor Detail

      • ChannelFactory

        public ChannelFactory​(String endpoint)
        Constructs ChannelFactory object for given endpoint. Uses default service to endpoint mapping if default endpoint are given. Otherwise, queries endpoint service to obtain actual service to endpoint mapping.
        Parameters:
        endpoint - Yandex.Cloud API endpoint
      • ChannelFactory

        public ChannelFactory​(String endpoint,
                              String userAgent)
        Constructs ChannelFactory object for given endpoint with given user agent. Uses default service to endpoint mapping if default endpoint are given. Otherwise, queries endpoint service to obtain actual service to endpoint mapping.
        Parameters:
        endpoint - Yandex.Cloud API endpoint
        userAgent - user agent for API calls
    • Method Detail

      • getDefaultChannelFactory

        public static ChannelFactory getDefaultChannelFactory()
      • getChannel

        public io.grpc.ManagedChannel getChannel​(Class<? extends io.grpc.stub.AbstractStub> clazz)
        Provides a ManagedChannel object that corresponds to given gRPC stub. Resolves gRPC stub class to endpoint and returns cached ManagedChannel object if available. Otherwise, creates a new ManagedChannel object for the resolved endpoint and returns it.
        Parameters:
        clazz - gRPC stub class
        Returns:
        ManagedChannel object that corresponds to the given class