Class IrisConsole

java.lang.Object
com.illumon.iris.console.events.IrisConsole
All Implemented Interfaces:
IrisConsoleWidgetSupport, IrisWidgetSupport, Workspace

public class IrisConsole extends Object implements IrisConsoleWidgetSupport, Workspace
  • Field Details

    • PLOT_WIDGET_TYPE

      public static final String PLOT_WIDGET_TYPE
      See Also:
    • CONSOLE_PLOT_WIDGET_TYPE

      public static final String CONSOLE_PLOT_WIDGET_TYPE
      See Also:
    • CONSOLE_ID_PARAM

      public static final String CONSOLE_ID_PARAM
      See Also:
    • QUERY_SERIAL_PARAM

      public static final String QUERY_SERIAL_PARAM
      See Also:
    • CONSOLE_VALUE_NAME_PARAM

      public static final String CONSOLE_VALUE_NAME_PARAM
      See Also:
    • initialControllerSubscriptionLatch

      public final CountDownLatch initialControllerSubscriptionLatch
      This latch gets counted down when the initial controller connection is complete, including fetching the configuration and the persistent queries.
  • Method Details

    • getQueryClient

      @NotNull public PersistentQueryClient getQueryClient(@NotNull String queryType) throws IOException
      Description copied from interface: IrisWidgetSupport
      Get a client for the specified query type. If more than one query of this type is defined, it will use the first one that is Running. It is intended to be used to connect to helper queries.
      Specified by:
      getQueryClient in interface IrisWidgetSupport
      Parameters:
      queryType - the query type
      Returns:
      the query client
      Throws:
      IOException - if a connection can't be established to a query of the specified type
    • getControllerClient

      @NotNull public PersistentQueryControllerClient getControllerClient()
      Description copied from interface: IrisWidgetSupport
      Get the controller client for listening to / querying statuses.
      Specified by:
      getControllerClient in interface IrisWidgetSupport
      Returns:
      a PersistentQueryControllerClient
    • getPersistentQueryClient

      public PersistentQueryClient getPersistentQueryClient(long serial)
      Description copied from interface: IrisWidgetSupport
      Get the PersistentQueryClient for the specified query serial
      Specified by:
      getPersistentQueryClient in interface IrisWidgetSupport
      Parameters:
      serial - the query serial.
      Returns:
      the PersistentQueryControllerClient or null if the query does not exist, or is not running.
    • getIrisUserContext

      @NotNull public IrisUserContext getIrisUserContext()
      Description copied from interface: IrisWidgetSupport
      Get the user context for the currently authenticated user.
      Specified by:
      getIrisUserContext in interface IrisWidgetSupport
      Returns:
      the user context
    • getServerConfiguration

      public PersistentQueryControllerConfiguration getServerConfiguration()
      Description copied from interface: IrisWidgetSupport
      Get the current controller configuration.
      Specified by:
      getServerConfiguration in interface IrisWidgetSupport
      Returns:
      the current configuration
    • addControllerConnectionListener

      public void addControllerConnectionListener(@NotNull Consumer<Boolean> listener)
      Description copied from interface: IrisWidgetSupport
      Listen for events when the controller client connection status changes. If the controller client is connected your Consumer is called with true. If it is disconnected, your Consumer is called with false.
      Specified by:
      addControllerConnectionListener in interface IrisWidgetSupport
      Parameters:
      listener - a consumer that is called on connection status changes.
    • removeControllerConnectionListener

      public void removeControllerConnectionListener(@NotNull Consumer<Boolean> listener)
      Description copied from interface: IrisWidgetSupport
      Removes a previously added controller connection listener.
      Specified by:
      removeControllerConnectionListener in interface IrisWidgetSupport
      Parameters:
      listener - the listener to remove
    • getSharedExecutor

      @NotNull public ExecutorService getSharedExecutor()
      Description copied from interface: IrisConsoleWidgetSupport
      Get an ExecutorService to be used for doing long-running work.
      Specified by:
      getSharedExecutor in interface IrisConsoleWidgetSupport
      Returns:
      a valid ExecutorService.
    • createDerivedView

      public IrisView createDerivedView(@NotNull IrisView parent, @NotNull String name, boolean addToRootWindow, @NotNull Map<String,String> params)
      Description copied from interface: IrisConsoleWidgetSupport
      Creates a 'derived' view for the specified parent view. A Derived view will be tied to it's parent view in lifecycle. When the parent view is closed, all of the derived views are closed with it. Likewise, when the workspace is loaded, The view manager will wait for the parent view to load before delegating creation of derived views. Callers may indicate that they will place the created view (potentially reused) into the workspace themselves by passing 'addToRootPanel" false.
      Specified by:
      createDerivedView in interface IrisConsoleWidgetSupport
      Parameters:
      parent - The parent view object
      name - The name of the view
      addToRootWindow - True if the created view should be automatically placed into the root window
      params - The map of params to be passed to the derived view provider.
      Returns:
      the view that was created (or reused)
    • getWorkspaceInfo

      public org.jdom2.Element getWorkspaceInfo()
      Description copied from interface: Workspace
      Serialize the class into an element to be stored in the workspace
      Specified by:
      getWorkspaceInfo in interface Workspace
      Returns:
      An Element containing the data to persist.
    • setWorkspaceInfo

      public void setWorkspaceInfo(org.jdom2.Element workspaceInfo)
      Description copied from interface: Workspace
      Restore the class to the state defined by the data persisted in workspaceInfo
      Specified by:
      setWorkspaceInfo in interface Workspace
      Parameters:
      workspaceInfo - An Element containing the persisted state.
    • waitForInitialSubscription

      public boolean waitForInitialSubscription(long secondsToWait) throws InterruptedException
      Wait for the initial controller connection to be complete. This will return after the initial connection is complete and the controller configuration and persistent queries have been retrieved, or after the specified number of seconds have elapsed. It makes no guarantees as to subsequent disconnections and connections.
      Parameters:
      secondsToWait - the number of seconds to wait for the subscription to complete
      Returns:
      true if the subscription completed, false otherwise
      Throws:
      InterruptedException - if the current thread is interrupted while waiting
    • refreshUseControllerForSource

      public void refreshUseControllerForSource(boolean useControllerForSource)
    • checkedWorkspaceSave

      public static void checkedWorkspaceSave(Window owner, com.fishlib.io.logger.Logger log)
    • checkedWorkspaceSave

      public static void checkedWorkspaceSave(Window owner, com.fishlib.io.logger.Logger log, Path workspacePath)
    • checkedWorkspaceSave

      public static void checkedWorkspaceSave(Window owner, com.fishlib.io.logger.Logger log, Path workspacePath, WorkspaceExporter exporter)
    • loadWorkspaceImport

      public static void loadWorkspaceImport(Window owner, com.fishlib.io.logger.Logger log, SavedWorkspace savedWorkspace)
    • main

      public static void main(String[] args) throws InterruptedException
      Throws:
      InterruptedException