Class DeephavenClusterConnection
java.lang.Object
io.deephaven.enterprise.dnd.client.DeephavenClusterConnection
An object that maintains connections to Deephaven services on a remote cluster. This is used by the Java Client to
create and subscribe to queries, and also used by Core+ workers to connect to queries on different clusters.
-
Constructor Summary
ConstructorsConstructorDescriptionDeephavenClusterConnection
(@NotNull String connectionUrl) Create a new, unauthenticated connection to the specified Deephaven cluster. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close all connections to the remote host.boolean
delegateToken
(@NotNull io.deephaven.enterprise.auth.AuthToken delegateToken) Use a delegate token to authenticate.io.deephaven.enterprise.auth.AuthenticationClient
Get theAuthenticationClient
for the cluster.io.deephaven.enterprise.controller.client.ControllerClientGrpc
Get thecontroller client
for the cluster.Get theScheduledExecutorService
used for connections created by this object.io.deephaven.enterprise.auth.UserContext
Get the authenticatedUserContext
for this object.io.grpc.ManagedChannel
makeGrpcChannel
(@NotNull String host, int port, @Nullable Map<String, String> extraHeaders) Construct a gRPC channel for communication with the Persistent Queryboolean
Authenticate with the server using a username and passwordboolean
privateKey
(@NotNull String keyFile) Authenticate to the server using a private key file.void
setMaxInboundMessageSize
(int maxInboundMessageSize) Set the maximum inbound message size for connections created by this object.
-
Constructor Details
-
DeephavenClusterConnection
Create a new, unauthenticated connection to the specified Deephaven cluster. Users should call one ofpassword(String, String)
,privateKey(String)
ordelegateToken(AuthToken)
to authenticate with the server before accessing the provided services.- Parameters:
connectionUrl
- the url of the remote system in the format `https://server-address:port/iris/connection.json`- Throws:
IOException
- if there is a problem establishing a connection to the remote cluster.
-
-
Method Details
-
close
public void close()Close all connections to the remote host. -
password
Authenticate with the server using a username and password- Parameters:
user
- the usernamepassword
- the password- Returns:
- true if successfully authenticated, false otherwise.
-
privateKey
Authenticate to the server using a private key file.- Parameters:
keyFile
- the private key file- Returns:
- true if successfully authenticated, false otherwise.
-
delegateToken
public boolean delegateToken(@NotNull @NotNull io.deephaven.enterprise.auth.AuthToken delegateToken) Use a delegate token to authenticate.- Parameters:
delegateToken
- the token to authenticate with- Returns:
- true if successfully authenticated, false otherwise.
-
setMaxInboundMessageSize
public void setMaxInboundMessageSize(int maxInboundMessageSize) Set the maximum inbound message size for connections created by this object.- Parameters:
maxInboundMessageSize
- the new max inbound message size
-
getControllerClient
public io.deephaven.enterprise.controller.client.ControllerClientGrpc getControllerClient()Get thecontroller client
for the cluster. The controller client will automatically be authenticated when any of the authentication methods have completed successfully.- Returns:
- the
ControllerClientGrpc
-
getAuthenticationClient
public io.deephaven.enterprise.auth.AuthenticationClient getAuthenticationClient()Get theAuthenticationClient
for the cluster.- Returns:
- the authentication client
-
getExecutor
Get theScheduledExecutorService
used for connections created by this object.- Returns:
- the
ScheduledExecutorService
-
getUserContext
public io.deephaven.enterprise.auth.UserContext getUserContext() throws io.deephaven.enterprise.auth.NotAuthenticatedExceptionGet the authenticatedUserContext
for this object.- Returns:
- the authenticated
UserContext
- Throws:
io.deephaven.enterprise.auth.NotAuthenticatedException
- if this connection has not been authenticated
-
makeGrpcChannel
public io.grpc.ManagedChannel makeGrpcChannel(@NotNull @NotNull String host, int port, @Nullable @Nullable Map<String, String> extraHeaders) throws IOExceptionConstruct a gRPC channel for communication with the Persistent Query- Parameters:
host
- the host of the queryport
- the port of the queryextraHeaders
- a map of any extra HTTP headers to include, or null if none.- Returns:
- a new
ManagedChannel
for communication with the Persistent Query - Throws:
IOException
- if there was a problem creating the channel
-