Package com.eventstore.dbclient
Class EventStoreDBClusterClient
- java.lang.Object
-
- com.eventstore.dbclient.EventStoreDBClusterClient
-
public class EventStoreDBClusterClient extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected io.grpc.ManagedChannelchannelprotected java.util.UUIDcurrentChannelIdprotected Endpointendpointprotected java.lang.ExceptionlastExceptionprotected java.util.Optional<com.eventstore.dbclient.ServerInfo>serverInfoprotected EventStoreDBClientSettingssettingsprotected booleanshutdownprotected io.grpc.netty.shaded.io.netty.handler.ssl.SslContextsslContext
-
Constructor Summary
Constructors Constructor Description EventStoreDBClusterClient(java.util.List<java.net.InetSocketAddress> seedNodes, Endpoint domainEndpoint, NodePreference nodePreference, io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext, EventStoreDBClientSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.grpc.ManagedChannelcreateChannel(Endpoint endpoint)protected java.util.concurrent.ExecutorcreateConnectionLoopExecutor()protected booleandoConnect()java.util.concurrent.CompletableFuture<Endpoint>getCurrentEndpoint()EventStoreDBClientSettingsgetSettings()protected voidpushMsg(com.eventstore.dbclient.GrpcClient.Msg msg)<A> java.util.concurrent.CompletableFuture<A>run(java.util.function.Function<io.grpc.ManagedChannel,java.util.concurrent.CompletableFuture<A>> action)<A> java.util.concurrent.CompletableFuture<A>runWithArgs(java.util.function.Function<com.eventstore.dbclient.GrpcClient.WorkItemArgs,java.util.concurrent.CompletableFuture<A>> action)voidshutdown()protected voidsleep(long millis)protected voidstartConnectionLoop()
-
-
-
Field Detail
-
settings
protected final EventStoreDBClientSettings settings
-
sslContext
protected final io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext
-
channel
protected io.grpc.ManagedChannel channel
-
endpoint
protected Endpoint endpoint
-
lastException
protected java.lang.Exception lastException
-
currentChannelId
protected java.util.UUID currentChannelId
-
serverInfo
protected java.util.Optional<com.eventstore.dbclient.ServerInfo> serverInfo
-
shutdown
protected volatile boolean shutdown
-
-
Constructor Detail
-
EventStoreDBClusterClient
public EventStoreDBClusterClient(java.util.List<java.net.InetSocketAddress> seedNodes, Endpoint domainEndpoint, NodePreference nodePreference, io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext, EventStoreDBClientSettings settings)
-
-
Method Detail
-
doConnect
protected boolean doConnect()
-
startConnectionLoop
protected void startConnectionLoop()
-
createConnectionLoopExecutor
protected java.util.concurrent.Executor createConnectionLoopExecutor()
-
pushMsg
protected void pushMsg(com.eventstore.dbclient.GrpcClient.Msg msg)
-
getSettings
public EventStoreDBClientSettings getSettings()
-
runWithArgs
public <A> java.util.concurrent.CompletableFuture<A> runWithArgs(java.util.function.Function<com.eventstore.dbclient.GrpcClient.WorkItemArgs,java.util.concurrent.CompletableFuture<A>> action)
-
run
public <A> java.util.concurrent.CompletableFuture<A> run(java.util.function.Function<io.grpc.ManagedChannel,java.util.concurrent.CompletableFuture<A>> action)
-
getCurrentEndpoint
public java.util.concurrent.CompletableFuture<Endpoint> getCurrentEndpoint()
-
sleep
protected void sleep(long millis)
-
createChannel
protected io.grpc.ManagedChannel createChannel(Endpoint endpoint)
-
shutdown
public void shutdown() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
-