Package org.summerboot.jexpress.nio.grpc
Class GRPCClient<T extends GRPCClient<T>>
java.lang.Object
org.summerboot.jexpress.nio.grpc.GRPCClient<T>
- Type Parameters:
T-
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.grpc.ManagedChannelprotected final io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilderprotected final URI -
Constructor Summary
ConstructorsConstructorDescriptionGRPCClient(URI uri) GRPCClient(URI uri, io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder channelBuilder) GRPCClient(URI uri, KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, String overrideAuthority, Iterable<String> ciphers, String... tlsVersionProtocols) -
Method Summary
Modifier and TypeMethodDescriptionconnect()voidstatic io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuildergetNettyChannelBuilder(URI uri, KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, String overrideAuthority, Iterable<String> ciphers, String... tlsVersionProtocols) static io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilderNettyChannelBuilder(URI uri) protected abstract voidonConnected(io.grpc.ManagedChannel channel)
-
Field Details
-
uri
-
channelBuilder
protected final io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder channelBuilder -
channel
protected io.grpc.ManagedChannel channel
-
-
Constructor Details
-
GRPCClient
- 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.sockkeyManagerFactory- The Remote Caller identitytrustManagerFactory- The Remote Caller trusted identitiesoverrideAuthority-ciphers-tlsVersionProtocols- "TLSv1.2", "TLSv1.3"- Throws:
SSLException
-
GRPCClient
- Parameters:
uri- The URI format should be one of tcp://host:port, tls://host:port, or unix:///path/to/uds.sockchannelBuilder-
-
-
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.sockkeyManagerFactory- The Remote Caller identitytrustManagerFactory- The Remote Caller trusted identitiesoverrideAuthority-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
-
onConnected
protected abstract void onConnected(io.grpc.ManagedChannel channel) - Parameters:
channel-
-
disconnect
public void disconnect()
-