Class ManagedChannelFactory

java.lang.Object
io.deephaven.util.grpc.ManagedChannelFactory

public final class ManagedChannelFactory extends Object
Creates a ManagedChannel for Deephaven gRPC services.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkCertificateExpiry(com.fishlib.io.logger.Logger log, int thresholdDays, KeyStore keyStore, String label, Consumer<String> expirationWarningConsumer)
     
    static io.deephaven.shadow.core.io.grpc.ManagedChannel
    forClient(com.fishlib.io.logger.Logger log, DhService dhService, io.deephaven.enterprise.resolver.EtcdResolverContext.Builder etcdResolverContextBuilder)
    Build a managed channel for the specified service, using a DeephavenNameResolver to find the target addresses and ports via etcd client.
    static io.deephaven.shadow.core.io.grpc.ManagedChannel
    forClient(com.fishlib.io.logger.Logger log, DhService dhService, io.deephaven.enterprise.resolver.HttpResolverContext.Builder httpResolverContextBuilder)
    Build a managed channel for the specified service, using a DeephavenNameResolver to find the target addresses and ports via HTTP.
    static io.deephaven.shadow.core.io.grpc.ManagedChannel
    forClient(com.fishlib.io.logger.Logger log, String serviceName, int port, String... hosts)
    Build a managed channel for the specified service.
    static io.deephaven.shadow.core.io.grpc.ManagedChannel
    forClient(com.fishlib.io.logger.Logger log, String serviceName, InetAddress addr, int port)
    Build a managed channel for the specified service.
    static io.deephaven.shadow.core.io.netty.handler.ssl.SslContext
    getServerSslContext(com.fishlib.io.logger.Logger log, Consumer<String> expirationWarningConsumer)
     
    static io.deephaven.enterprise.resolver.EtcdResolverContext.Builder
    makeEtcdResolverContextBuilderFor(com.fishlib.io.logger.Logger log, io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient)
     
    static io.deephaven.enterprise.resolver.HttpResolverContext.Builder
    makeHttpResolverContextBuilderFor(com.fishlib.io.logger.Logger log, String resolverUrl)
     
    static <T extends io.deephaven.enterprise.resolver.ResolverContext.BuilderCommon<T>>
    T
    setAuthorityValuesFromProperties(com.fishlib.configuration.Configuration configuration, DhService dhService, T ctxBuilder)
    Configure authority overrides for name resolution if properties for them exist.

    Methods inherited from class java.lang.Object

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

    • CHANNEL_OVERRIDE_AUTHORITY_PROP

      public static final String CHANNEL_OVERRIDE_AUTHORITY_PROP
      See Also:
    • NAME_RESOLVER_OVERRIDE_AUTHORITY_PROP

      public static final String NAME_RESOLVER_OVERRIDE_AUTHORITY_PROP
      See Also:
    • NAME_RESOLVER_ATTR_AUTHORITY_OVERRIDE_TO_HOST_PROP

      public static final String NAME_RESOLVER_ATTR_AUTHORITY_OVERRIDE_TO_HOST_PROP
      See Also:
  • Constructor Details

    • ManagedChannelFactory

      public ManagedChannelFactory()
  • Method Details

    • forClient

      @NotNull public static io.deephaven.shadow.core.io.grpc.ManagedChannel forClient(com.fishlib.io.logger.Logger log, @NotNull String serviceName, InetAddress addr, int port)
      Build a managed channel for the specified service.
      Parameters:
      log - a logger to use
      serviceName - the service name; used as a prefix for properties and for logging
      addr - server address
      port - port
      Returns:
      a new ManagedChannel
    • forClient

      @NotNull public static io.deephaven.shadow.core.io.grpc.ManagedChannel forClient(@NotNull com.fishlib.io.logger.Logger log, @NotNull String serviceName, int port, String... hosts)
      Build a managed channel for the specified service.
      Parameters:
      log - the logger to use
      serviceName - the name of the service (eg, "PersistentQueryController")
      port - port
      hosts - server hosts
      Returns:
      a new ManagedChannel
    • setAuthorityValuesFromProperties

      @NotNull public static <T extends io.deephaven.enterprise.resolver.ResolverContext.BuilderCommon<T>> T setAuthorityValuesFromProperties(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull DhService dhService, @NotNull T ctxBuilder)
      Configure authority overrides for name resolution if properties for them exist.
      Parameters:
      configuration - the configuration to check for service name override
      dhService - provides service name
      ctxBuilder - the context to potentially set logic on
      Returns:
      the context to potentially set logic on
    • forClient

      @NotNull public static io.deephaven.shadow.core.io.grpc.ManagedChannel forClient(@NotNull com.fishlib.io.logger.Logger log, DhService dhService, @NotNull io.deephaven.enterprise.resolver.EtcdResolverContext.Builder etcdResolverContextBuilder)
      Build a managed channel for the specified service, using a DeephavenNameResolver to find the target addresses and ports via etcd client.
      Parameters:
      log - the logger to use
      dhService - the service that the channel will connect to.
      etcdResolverContextBuilder - the resolver context builder, specifying attributes for name resolution (eg, the etcd client to use).
      Returns:
      a new ManagedChannel
    • forClient

      @NotNull public static io.deephaven.shadow.core.io.grpc.ManagedChannel forClient(@NotNull com.fishlib.io.logger.Logger log, DhService dhService, @NotNull io.deephaven.enterprise.resolver.HttpResolverContext.Builder httpResolverContextBuilder)
      Build a managed channel for the specified service, using a DeephavenNameResolver to find the target addresses and ports via HTTP.
      Parameters:
      log - the logger to use
      dhService - the service that the channel will connect to.
      httpResolverContextBuilder - the resolver context builder, specifying attributes for name resolution (eg, the target URL to use).
      Returns:
      a new ManagedChannel
    • getServerSslContext

      public static io.deephaven.shadow.core.io.netty.handler.ssl.SslContext getServerSslContext(com.fishlib.io.logger.Logger log, @Nullable Consumer<String> expirationWarningConsumer)
    • checkCertificateExpiry

      public static void checkCertificateExpiry(com.fishlib.io.logger.Logger log, int thresholdDays, KeyStore keyStore, String label, Consumer<String> expirationWarningConsumer)
    • makeEtcdResolverContextBuilderFor

      public static io.deephaven.enterprise.resolver.EtcdResolverContext.Builder makeEtcdResolverContextBuilderFor(@NotNull com.fishlib.io.logger.Logger log, io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient)
    • makeHttpResolverContextBuilderFor

      public static io.deephaven.enterprise.resolver.HttpResolverContext.Builder makeHttpResolverContextBuilderFor(@NotNull com.fishlib.io.logger.Logger log, String resolverUrl)