Top-level class: Client#

Description#

The Client class is the main entry point to the Deephaven Client API. Use connect to connect to a Deephaven instance, then call getManager to get a TableHandleManager

Example:

const char *server = "localhost:10000";
auto client = Client::connect(server);
auto manager = client.getManager();
auto mydata = manager.fetchTable("MyData");
auto filtered = t1.where("Price < 100").sort("Timestamp").tail(5);

Declarations#

class Client#

The main class for interacting with Deephaven. Start here to connect with the server and to get a TableHandleManager.

Public Functions

Client(Client &&other) noexcept#

Move constructor

Client &operator=(Client &&other) noexcept#

Move assigment operator.

~Client()#

Destructor

TableHandleManager getManager() const#

Gets a TableHandleManager which you can use to create empty tables, fetch tables, and so on. You can create more than one TableHandleManager.

Returns:

The TableHandleManager.

Public Static Functions

static Client connect(const std::string &target, const ClientOptions &options = {})#

Factory method to connect to a Deephaven server using the specified options.

Parameters:
  • target – A connection string in the format host:port. For example “localhost:10000”.

  • options – An options object for setting options like authentication and script language.

Returns:

A Client object conneted to the Deephaven server.

class ClientOptions#

Public Functions

ClientOptions(ClientOptions &&other) noexcept#

Move constructor

ClientOptions &operator=(ClientOptions &&other) noexcept#

Move assigment operator.

~ClientOptions()#

Destructor

ClientOptions &setDefaultAuthentication()#

Modifies the ClientOptions object to set the default authentication scheme.

Returns:

*this, so that methods can be chained.

ClientOptions &setBasicAuthentication(const std::string &username, const std::string &password)#

Modifies the ClientOptions object to set the basic authentication scheme.

Returns:

*this, so that methods can be chained.

ClientOptions &setCustomAuthentication(const std::string &authenticationKey, const std::string &authenticationValue)#

Modifies the ClientOptions object to set a custom authentication scheme.

Returns:

*this, so that methods can be chained.

ClientOptions &setSessionType(std::string sessionType)#

Modifies the ClientOptions object to set the scripting language for the session.

Parameters:

sessionType – The scripting language for the session, such as “groovy” or “python”.

Returns:

*this, so that methods can be chained.

ClientOptions &setUseTls(bool useTls)#

Configure whether to set server connections as TLS

Parameters:

useTls – true if server connections should be TLS/SSL, false for insecure.

Returns:

*this, to be used for chaining

ClientOptions &setTlsRootCerts(std::string tlsRootCerts)#

Sets a PEM-encoded certificate root for server connections. The empty string means use system defaults.

Parameters:

pem – a PEM encoded certificate chain.

Returns:

*this, to be used for chaining

ClientOptions &setClientCertChain(std::string clientCertChain)#

Sets a PEM-encoded certificate for the client and use mutual TLS. The empty string means don’t use mutual TLS.

Parameters:

pem – a PEM encoded certificate chain, or empty for no mutual TLS.

Returns:

*this, to be used for chaining

ClientOptions &setClientPrivateKey(std::string clientCertChain)#

Sets a PEM-encoded private key for the client certificate chain when using mutual TLS.

Parameters:

pem – a PEM encoded private key.

Returns:

*this, to be used for chaining

ClientOptions &addExtraHeader(std::string header_name, std::string header_value)#

Adds an extra header with a constant name and value to be sent with every outgoing server request.

Parameters:
  • header_name – The header name

  • header_value – The header value

Returns:

*this, to be used for chaining

inline const std::string &authorizationValue() const#

Returns the value for the authorization header that will be sent to the server on the first request; this value is a function of the authentication method selected.

Returns:

A string value for the authorization header

inline bool useTls() const#

Returns true if server connections should be configured for TLS/SSL.

Returns:

true if this connection should be TLS/SSL, false for insecure.

inline const std::string &tlsRootCerts() const#

The PEM-encoded certificate root for server connections, or the empty string if using system defaults.

Returns:

A PEM-encoded certificate chain, or empty.

inline const std::string &clientCertChain() const#

The PEM-encoded certificate chain to use for the client when using mutual TLS, or the empty string for no mutual TLS.

Returns:

A PEM-encoded certificate chain, or empty.

inline const std::string &clientPrivateKey() const#

The PEM-encoded client private key to use for mutual TLS.

Returns:

A PEM-encoded private key, or empty.

inline const int_options_t &intOptions() const#

Integer-valued channel options set for server connections.

Returns:

A vector of pairs of string option name and integer option value

inline const string_options_t &stringOptions() const#

String-valued channel options set for server connections.

Returns:

A vector of pairs of string option name and string option value

inline const extra_headers_t &extraHeaders() const#

Extra headers that should be sent with each outgoing server request.

Returns:

A vector of pairs of string header name and string header value