Class IdeConnection


@JsType(namespace="dh") public class IdeConnection extends QueryConnectable<IdeConnection>
Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and some options, JS applications can run code on the server, and interact with available exportable objects.
  • Field Details

  • Constructor Details

    • IdeConnection

      @JsIgnore public IdeConnection(String serverUrl, Object connectOptions)
      Creates a new instance, from which console sessions can be made.
      Parameters:
      serverUrl - The url used when connecting to the server. Read-only.
      connectOptions - Optional Object
  • Method Details

    • logPrefix

      protected String logPrefix()
      Overrides:
      logPrefix in class HasEventHandling
    • getToken

      @JsIgnore public ConnectToken getToken()
      Specified by:
      getToken in class QueryConnectable<IdeConnection>
    • getOptions

      @JsIgnore public ConnectOptions getOptions()
      Specified by:
      getOptions in class QueryConnectable<IdeConnection>
    • close

      public void close()
      Closes the current connection, releasing any resources on the server or client.
      Overrides:
      close in class QueryConnectable<IdeConnection>
    • getServerUrl

      @JsIgnore public String getServerUrl()
      The url used when connecting to the server.
      Overrides:
      getServerUrl in class QueryConnectable<IdeConnection>
      Returns:
      String.
    • running

      public elemental2.promise.Promise<IdeConnection> running()
      Description copied from class: QueryConnectable
      Promise that resolves when this worker instance can be connected to, or rejects if it can't be used.
      Specified by:
      running in class QueryConnectable<IdeConnection>
      Returns:
      A promise that resolves with this instance.
    • getObject

      public elemental2.promise.Promise<?> getObject(@TsTypeRef(JsVariableDescriptor.class) @TsTypeRef(JsVariableDescriptor.class) jsinterop.base.JsPropertyMap<Object> definitionObject)
    • subscribeToFieldUpdates

      public JsRunnable subscribeToFieldUpdates(JsConsumer<JsVariableChanges> callback)
    • shareObject

      public elemental2.promise.Promise<SharedExportBytesUnion> shareObject(ServerObject.Union object, SharedExportBytesUnion sharedTicketBytes)
      Makes an object available to another user or another client on this same server which knows the value of the sharedTicketBytes. Use that sharedTicketBytes value like a one-time use password - any other client which knows this value can read the same object.

      Shared objects will remain available using the sharedTicketBytes until the client that first shared them releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until the remote end has signaled that it has successfully fetched the object before releasing it from this client.

      Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to prevent access by unauthorized clients.

      Parameters:
      object - the object to share with another client/user
      sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode string (will be encoded as utf8 bytes), or a Uint8Array value.
      Returns:
      A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read by another client, or will reject if an error occurs.
    • getSharedObject

      public elemental2.promise.Promise<?> getSharedObject(SharedExportBytesUnion sharedTicketBytes, String type)
      Reads an object shared by another client to this server with the sharedTicketBytes. Until the other client releases this object (or their session ends), the object will be available on the server.

      The type of the object must be passed so that the object can be read from the server correct - the other client should provide this information.

      Parameters:
      sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode string (will be encoded as utf8 bytes), or a Uint8Array value.
      type - The type of the object, so it can be correctly read from the server
      Returns:
      A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
    • notifyServerShutdown

      @JsIgnore public void notifyServerShutdown(TerminationNotificationResponse success)
      Specified by:
      notifyServerShutdown in class QueryConnectable<IdeConnection>