Class GRPCClient<T extends GRPCClient<T>>

java.lang.Object
org.summerboot.jexpress.nio.grpc.GRPCClient<T>
Type Parameters:
T -

public abstract class GRPCClient<T extends GRPCClient<T>> extends Object
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Field Details

    • uri

      protected final URI uri
    • channelBuilder

      protected final io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder channelBuilder
    • channel

      protected io.grpc.ManagedChannel channel
  • Constructor Details

    • GRPCClient

      public GRPCClient(URI uri) throws SSLException
      Parameters:
      uri - The URI format should be one of tcp://host:port or unix:///path/to/uds.sock
      Throws:
      SSLException
    • GRPCClient

      public GRPCClient(URI uri, @Nullable KeyManagerFactory keyManagerFactory, @Nullable TrustManagerFactory trustManagerFactory, @Nullable String overrideAuthority, @Nullable Iterable<String> ciphers, @Nullable String... tlsVersionProtocols) throws SSLException
      Parameters:
      uri - The URI format should be one of tcp://host:port, tls://host:port, or unix:///path/to/uds.sock
      keyManagerFactory - The Remote Caller identity
      trustManagerFactory - The Remote Caller trusted identities
      overrideAuthority -
      ciphers -
      tlsVersionProtocols - "TLSv1.2", "TLSv1.3"
      Throws:
      SSLException
    • GRPCClient

      public GRPCClient(URI uri, io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder channelBuilder)
      Parameters:
      uri - The URI format should be one of tcp://host:port, tls://host:port, or unix:///path/to/uds.sock
      channelBuilder -
  • Method Details

    • getNettyChannelBuilder

      public static io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder getNettyChannelBuilder(URI uri, @Nullable KeyManagerFactory keyManagerFactory, @Nullable TrustManagerFactory trustManagerFactory, @Nullable String overrideAuthority, @Nullable Iterable<String> ciphers, @Nullable String... tlsVersionProtocols) throws SSLException
      Parameters:
      uri - The URI format should be one of tcp://host:port, tls://host:port, or unix:///path/to/uds.sock
      keyManagerFactory - The Remote Caller identity
      trustManagerFactory - The Remote Caller trusted identities
      overrideAuthority -
      ciphers -
      tlsVersionProtocols - "TLSv1.2", "TLSv1.3"
      Returns:
      Throws:
      SSLException
    • NettyChannelBuilder

      public static io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder NettyChannelBuilder(URI uri) throws SSLException
      Parameters:
      uri - The URI format should be one of tcp://host:port or unix:///path/to/uds.sock
      Returns:
      Throws:
      SSLException
    • connect

      public T connect()
    • onConnected

      protected abstract void onConnected(io.grpc.ManagedChannel channel)
      Parameters:
      channel -
    • disconnect

      public void disconnect()