Package com.illumon.iris.console.events
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
IrisConsole.IrisViewManager
-
Field Summary
Fields Modifier and Type Field Description static String
CONSOLE_ID_PARAM
static String
CONSOLE_PLOT_WIDGET_TYPE
static String
CONSOLE_VALUE_NAME_PARAM
CountDownLatch
initialControllerSubscriptionLatch
This latch gets counted down when the initial controller connection is complete, including fetching the configuration and the persistent queries.static String
PLOT_WIDGET_TYPE
static String
QUERY_SERIAL_PARAM
-
Method Summary
Modifier and Type Method Description void
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)
IrisView
createDerivedView(IrisView parent, String name, boolean addToRootWindow, Map<String,String> params)
Creates a 'derived' view for the specified parent view.PersistentQueryControllerClient
getControllerClient()
Get the controller client for listening to / querying statuses.IrisUserContext
getIrisUserContext()
Get theuser context
for the currently authenticated user.PersistentQueryClient
getPersistentQueryClient(long serial)
Get thePersistentQueryClient
for the specified query serialPersistentQueryClient
getQueryClient(String queryType)
Get a client for the specified query type.PersistentQueryControllerConfiguration
getServerConfiguration()
Get the current controller configuration.ExecutorService
getSharedExecutor()
Get anExecutorService
to be used for doing long-running work.org.jdom2.Element
getWorkspaceInfo()
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
main(String[] args)
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.
-
Field Details
-
PLOT_WIDGET_TYPE
- See Also:
- Constant Field Values
-
CONSOLE_PLOT_WIDGET_TYPE
- See Also:
- Constant Field Values
-
CONSOLE_ID_PARAM
- See Also:
- Constant Field Values
-
QUERY_SERIAL_PARAM
- See Also:
- Constant Field Values
-
CONSOLE_VALUE_NAME_PARAM
- See Also:
- Constant Field Values
-
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
-
getSharedExecutor
Description copied from interface:IrisConsoleWidgetSupport
Get anExecutorService
to be used for doing long-running work.- Specified by:
getSharedExecutor
in interfaceIrisConsoleWidgetSupport
- 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 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
-