Package com.illumon.iris.console.events
Class IrisConsole
java.lang.Object
com.illumon.iris.console.events.IrisConsole
- All Implemented Interfaces:
IrisConsoleWidgetSupport
,IrisWidgetSupport
,Workspace
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
final CountDownLatch
This latch gets counted down when the initial controller connection is complete, including fetching the configuration and the persistent queries.static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addControllerConnectionListener
(Consumer<Boolean> listener) Listen for events when the controller client connection status changes.static void
checkedWorkspaceSave
(Window owner, com.fishlib.io.logger.Logger log) static void
checkedWorkspaceSave
(Window owner, com.fishlib.io.logger.Logger log, Path workspacePath) static void
checkedWorkspaceSave
(Window owner, com.fishlib.io.logger.Logger log, Path workspacePath, WorkspaceExporter exporter) Creates a 'derived' view for the specified parent view.Get the controller client for listening to / querying statuses.Get theuser context
for the currently authenticated user.getPersistentQueryClient
(long serial) Get thePersistentQueryClient
for the specified query serialgetQueryClient
(String queryType) Get a client for the specified query type.Get the current controller configuration.Get anExecutorService
to be used for doing long-running work.org.jdom2.Element
Serialize the class into an element to be stored in the workspacestatic void
loadWorkspaceImport
(Window owner, com.fishlib.io.logger.Logger log, SavedWorkspace savedWorkspace) static void
void
refreshUseControllerForSource
(boolean useControllerForSource) void
removeControllerConnectionListener
(Consumer<Boolean> listener) Removes a previously added controller connection listener.void
setWorkspaceInfo
(org.jdom2.Element workspaceInfo) Restore the class to the state defined by the data persisted in workspaceInfoboolean
waitForInitialSubscription
(long secondsToWait) Wait for the initial controller connection to be complete.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.gui.workspace.Workspace
isGlobalSetting
-
Field Details
-
PLOT_WIDGET_TYPE
- See Also:
-
CONSOLE_PLOT_WIDGET_TYPE
- See Also:
-
CONSOLE_ID_PARAM
- See Also:
-
QUERY_SERIAL_PARAM
- See Also:
-
CONSOLE_VALUE_NAME_PARAM
- See Also:
-
initialControllerSubscriptionLatch
This latch gets counted down when the initial controller connection is complete, including fetching the configuration and the persistent queries.
-
-
Method Details
-
getQueryClient
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 interfaceIrisWidgetSupport
- 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
Description copied from interface:IrisWidgetSupport
Get the controller client for listening to / querying statuses.- Specified by:
getControllerClient
in interfaceIrisWidgetSupport
- Returns:
- a
PersistentQueryControllerClient
-
getPersistentQueryClient
Description copied from interface:IrisWidgetSupport
Get thePersistentQueryClient
for the specified query serial- Specified by:
getPersistentQueryClient
in interfaceIrisWidgetSupport
- Parameters:
serial
- the query serial.- Returns:
- the
PersistentQueryControllerClient
or null if the query does not exist, or is not running.
-
getIrisUserContext
Description copied from interface:IrisWidgetSupport
Get theuser context
for the currently authenticated user.- Specified by:
getIrisUserContext
in interfaceIrisWidgetSupport
- Returns:
- the user context
-
getServerConfiguration
Description copied from interface:IrisWidgetSupport
Get the current controller configuration.- Specified by:
getServerConfiguration
in interfaceIrisWidgetSupport
- Returns:
- the current configuration
-
addControllerConnectionListener
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 interfaceIrisWidgetSupport
- Parameters:
listener
- a consumer that is called on connection status changes.
-
removeControllerConnectionListener
Description copied from interface:IrisWidgetSupport
Removes a previously added controller connection listener.- Specified by:
removeControllerConnectionListener
in interfaceIrisWidgetSupport
- Parameters:
listener
- the listener to remove
-
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 interfaceIrisConsoleWidgetSupport
- Parameters:
parent
- The parent view objectname
- The name of the viewaddToRootWindow
- True if the created view should be automatically placed into the root windowparams
- 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 interfaceWorkspace
- 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 interfaceWorkspace
- Parameters:
workspaceInfo
- AnElement
containing the persisted state.
-
waitForInitialSubscription
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
-
checkedWorkspaceSave
-
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
- Throws:
InterruptedException
-