Package io.deephaven.web.client.api
Class CoreClient
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.CoreClient
A client for connecting to a Deephaven server from the Deephaven JS API.
This type manages connection lifecycle and authentication state, and provides helpers to fetch server and authentication-related configuration.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final @JsNullable FeaturesA collection of feature flags that the JS API advertises.static final StringPassword login type.static final StringPassword login type.Fields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED -
Constructor Summary
ConstructorsConstructorDescriptionCoreClient(String serverUrl, @TsTypeRef(ConnectOptions.class) @JsNullable Object connectOptions) -
Method Summary
Modifier and TypeMethodDescriptionvoidDisconnects and releases resources associated with this client.elemental2.promise.Promise<IdeConnection> Returns a promise that resolves to the underlyingIdeConnection.elemental2.promise.Promise<String[][]> Fetches authentication configuration values.elemental2.promise.Promise<String[][]> Fetches server configuration values for the current connection.Returns the server URL associated with this client.Returns a storage service associated with this client's connection.elemental2.promise.Promise<Void> login(@TsTypeRef(LoginCredentials.class) jsinterop.base.JsPropertyMap<Object> credentials) Logs in using the provided credentials.elemental2.promise.Promise<Void> onConnected(@JsNullable Double timeoutInMillis) Resolves when the client is connected.elemental2.promise.Promise<Void> relogin(@TsTypeRef(JsRefreshToken.class) Object token) Logs in using a refresh token.elemental2.promise.Promise<CoreClient> running()Indicates whether this client instance is still usable.Methods inherited from class io.deephaven.web.client.api.event.HasEventHandling
addEventListener, addEventListenerOneShot, addEventListenerOneShot, failureHandled, fireCriticalEvent, fireCriticalEvent, fireEvent, fireEvent, fireEvent, hasListener, hasListeners, isSuppress, logPrefix, nextEvent, removeEventListener, suppressEvents, unsuppressEvents
-
Field Details
-
FEATURES
A collection of feature flags that the JS API advertises. All must be nullable booleans, and if listed, the value is true.Marked as nullable as past releases will not have this property, be sure to test for null if an older release might be in use.
-
EVENT_CONNECT
- See Also:
-
EVENT_DISCONNECT
- See Also:
-
EVENT_RECONNECT
- See Also:
-
EVENT_RECONNECT_AUTH_FAILED
- See Also:
-
EVENT_REQUEST_FAILED
- See Also:
-
EVENT_REQUEST_STARTED
- See Also:
-
EVENT_REQUEST_SUCCEEDED
- See Also:
-
EVENT_REFRESH_TOKEN_UPDATED
Deprecated.- See Also:
-
LOGIN_TYPE_PASSWORD
Password login type.When used as
credentials.typeforlogin(jsinterop.base.JsPropertyMap<java.lang.Object>), the credentials must include a username and a password.- See Also:
-
LOGIN_TYPE_ANONYMOUS
Password login type.When used as
credentials.typeforlogin(jsinterop.base.JsPropertyMap<java.lang.Object>), the credentials must include a username and a password.- See Also:
-
-
Constructor Details
-
CoreClient
public CoreClient(String serverUrl, @TsTypeRef(ConnectOptions.class) @JsOptional @TsTypeRef(ConnectOptions.class) @JsNullable Object connectOptions)
-
-
Method Details
-
running
Indicates whether this client instance is still usable.- Returns:
- a promise which resolves to
thiswhen the client is usable
-
getServerUrl
Returns the server URL associated with this client. -
getAuthConfigValues
Fetches authentication configuration values.This method is intended to be used before a session is established.
- Returns:
- a promise of key/value pairs, returned as a two-element string array per entry
-
login
public elemental2.promise.Promise<Void> login(@TsTypeRef(LoginCredentials.class) @TsTypeRef(LoginCredentials.class) jsinterop.base.JsPropertyMap<Object> credentials) Logs in using the provided credentials.- Parameters:
credentials- the login credentials- Returns:
- a promise which resolves once the client has connected using the provided credentials
-
relogin
public elemental2.promise.Promise<Void> relogin(@TsTypeRef(JsRefreshToken.class) @TsTypeRef(JsRefreshToken.class) Object token) Logs in using a refresh token.- Parameters:
token- the refresh token- Returns:
- a promise which resolves once the client has connected using the updated credentials
-
onConnected
Resolves when the client is connected.- Parameters:
timeoutInMillis- ignored, only exists for legacy callers- Returns:
- a promise that resolves when connection is established, or rejects if connection fails
-
getServerConfigValues
Fetches server configuration values for the current connection.- Returns:
- a promise of configuration entries as an array of
[key, value]string pairs
-
getStorageService
Returns a storage service associated with this client's connection. -
getAsIdeConnection
Returns a promise that resolves to the underlyingIdeConnection. -
disconnect
public void disconnect()Disconnects and releases resources associated with this client.
-