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 Stringstatic final Stringstatic final Stringfinal CountDownLatchThis latch gets counted down when the initial controller connection is complete, including fetching the configuration and the persistent queries.static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaddControllerConnectionListener(Consumer<Boolean> listener) Listen for events when the controller client connection status changes.static voidcheckedWorkspaceSave(Window owner, com.fishlib.io.logger.Logger log) static voidcheckedWorkspaceSave(Window owner, com.fishlib.io.logger.Logger log, Path workspacePath) static voidcheckedWorkspaceSave(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 contextfor the currently authenticated user.getPersistentQueryClient(long serial) Get thePersistentQueryClientfor the specified query serialgetQueryClient(String queryType) Get a client for the specified query type.Get the current controller configuration.Get anExecutorServiceto be used for doing long-running work.org.jdom2.ElementSerialize the class into an element to be stored in the workspacestatic voidloadWorkspaceImport(Window owner, com.fishlib.io.logger.Logger log, SavedWorkspace savedWorkspace) static voidvoidrefreshUseControllerForSource(boolean useControllerForSource) voidremoveControllerConnectionListener(Consumer<Boolean> listener) Removes a previously added controller connection listener.voidsetWorkspaceInfo(org.jdom2.Element workspaceInfo) Restore the class to the state defined by the data persisted in workspaceInfobooleanwaitForInitialSubscription(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, waitMethods 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:IrisWidgetSupportGet 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:
getQueryClientin 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:IrisWidgetSupportGet the controller client for listening to / querying statuses.- Specified by:
getControllerClientin interfaceIrisWidgetSupport- Returns:
- a
PersistentQueryControllerClient
-
getPersistentQueryClient
Description copied from interface:IrisWidgetSupportGet thePersistentQueryClientfor the specified query serial- Specified by:
getPersistentQueryClientin interfaceIrisWidgetSupport- Parameters:
serial- the query serial.- Returns:
- the
PersistentQueryControllerClientor null if the query does not exist, or is not running.
-
getIrisUserContext
Description copied from interface:IrisWidgetSupportGet theuser contextfor the currently authenticated user.- Specified by:
getIrisUserContextin interfaceIrisWidgetSupport- Returns:
- the user context
-
getServerConfiguration
Description copied from interface:IrisWidgetSupportGet the current controller configuration.- Specified by:
getServerConfigurationin interfaceIrisWidgetSupport- Returns:
- the current configuration
-
addControllerConnectionListener
Description copied from interface:IrisWidgetSupportListen 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:
addControllerConnectionListenerin interfaceIrisWidgetSupport- Parameters:
listener- a consumer that is called on connection status changes.
-
removeControllerConnectionListener
Description copied from interface:IrisWidgetSupportRemoves a previously added controller connection listener.- Specified by:
removeControllerConnectionListenerin 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:IrisConsoleWidgetSupportCreates 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:
createDerivedViewin 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:WorkspaceSerialize the class into an element to be stored in the workspace- Specified by:
getWorkspaceInfoin interfaceWorkspace- Returns:
- An
Elementcontaining the data to persist.
-
setWorkspaceInfo
public void setWorkspaceInfo(org.jdom2.Element workspaceInfo) Description copied from interface:WorkspaceRestore the class to the state defined by the data persisted in workspaceInfo- Specified by:
setWorkspaceInfoin interfaceWorkspace- Parameters:
workspaceInfo- AnElementcontaining 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
-