Class ScriptSourceUtils
java.lang.Object
com.illumon.iris.controller.utils.ScriptSourceUtils
Utilities for creating the ControllerScriptPathLoader for use in script session sourcing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fishlib.base.Pair<AuditEventLogFormat3Logger,
io.deephaven.enterprise.auth.audit.AuditEventBuilder> getAuditObjects
(Database database, ExportedObjectClient client) Get the audit event logger and audit event builder objects that can be used to log audit events.static ControllerScriptPathLoader
getControllerScriptPathLoader
(com.fishlib.io.logger.Logger log, ScriptPathLoaderState scriptLoaderState, AuditEventLogFormat3Logger auditEventLogLogger, io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.static ControllerScriptPathLoader
getControllerScriptPathLoader
(com.fishlib.io.logger.Logger log, String scriptLoaderStateJson, AuditEventLogFormat3Logger auditEventLogLogger, io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.static ControllerScriptPathLoader
getControllerScriptPathLoader
(String who, com.fishlib.io.logger.Logger log, ScriptPathLoaderState scriptLoaderState, AuditEventLogFormat3Logger auditEventLogLogger, io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.static ControllerScriptPathLoader
getControllerScriptPathLoader
(String who, com.fishlib.io.logger.Logger log, String scriptLoaderStateJson, AuditEventLogFormat3Logger auditEventLogLogger, io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.
-
Constructor Details
-
ScriptSourceUtils
public ScriptSourceUtils()
-
-
Method Details
-
getControllerScriptPathLoader
@NotNull public static ControllerScriptPathLoader getControllerScriptPathLoader(@NotNull String who, @NotNull com.fishlib.io.logger.Logger log, @Nullable ScriptPathLoaderState scriptLoaderState, @Nullable AuditEventLogFormat3Logger auditEventLogLogger, @Nullable io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.- Parameters:
who
- the name of the script, for logging purposeslog
- the log to use for the ControllerScriptPathLoader.scriptLoaderState
- the loader stateauditEventLogLogger
- an optional audit event loggerauditEventBuilder
- if an audit event logger is supplied, an audit event builder containing the basic information to be logged (required if auditEventLogLogger is provided, unused otherwise)- Returns:
- a scriptPathLoader ready to provide script display paths and bodies
-
getControllerScriptPathLoader
@NotNull public static ControllerScriptPathLoader getControllerScriptPathLoader(@NotNull com.fishlib.io.logger.Logger log, @Nullable ScriptPathLoaderState scriptLoaderState, @Nullable AuditEventLogFormat3Logger auditEventLogLogger, @Nullable io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it. Legacy method; prefer the version that takes a string identifiying the caller which facilitates logging.- Parameters:
log
- the log to use for the ControllerScriptPathLoader.scriptLoaderState
- the loader stateauditEventLogLogger
- an optional audit event loggerauditEventBuilder
- if an audit event logger is supplied, an audit event builder containing the basic information to be logged (required if auditEventLogLogger is provided, unused otherwise)- Returns:
- a scriptPathLoader ready to provide script display paths and bodies
-
getControllerScriptPathLoader
@NotNull public static ControllerScriptPathLoader getControllerScriptPathLoader(@NotNull String who, @NotNull com.fishlib.io.logger.Logger log, @Nullable String scriptLoaderStateJson, @Nullable AuditEventLogFormat3Logger auditEventLogLogger, @Nullable io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it.- Parameters:
who
- the name of the script, for logging purposeslog
- the log to use for the ControllerScriptPathLoader.scriptLoaderStateJson
- the loader state as a JSON stringauditEventLogLogger
- an optional audit event loggerauditEventBuilder
- if an audit event logger is supplied, an audit event builder containing the basic information to be logged (required if auditEventLogLogger is provided, unused otherwise)- Returns:
- a scriptPathLoader ready to provide script display paths and bodies
-
getControllerScriptPathLoader
@NotNull public static ControllerScriptPathLoader getControllerScriptPathLoader(@NotNull com.fishlib.io.logger.Logger log, @Nullable String scriptLoaderStateJson, @Nullable AuditEventLogFormat3Logger auditEventLogLogger, @Nullable io.deephaven.enterprise.auth.audit.AuditEventBuilder auditEventBuilder) Wrap a controller client in a ControllerScriptPathLoader and return it. Legacy method; prefer the version that takes a string identifiying the caller which facilitates logging.- Parameters:
log
- the log to use for the ControllerScriptPathLoader.scriptLoaderStateJson
- the loader state as a JSON stringauditEventLogLogger
- an optional audit event loggerauditEventBuilder
- if an audit event logger is supplied, an audit event builder containing the basic information to be logged (required if auditEventLogLogger is provided, unused otherwise)- Returns:
- a scriptPathLoader ready to provide script display paths and bodies
-
getAuditObjects
@NotNull public static com.fishlib.base.Pair<AuditEventLogFormat3Logger,io.deephaven.enterprise.auth.audit.AuditEventBuilder> getAuditObjects(@NotNull Database database, @Nullable ExportedObjectClient client) Get the audit event logger and audit event builder objects that can be used to log audit events. The audit event logger will be from the database if available, and otherwise will be null. If an audit event logger is available, then the user context will be retrieved from the client if provided, otherwise from the database. An AuditEventBuilder will be created that contains the common information to be logged (client and server hosts, process name [worker name], and user context). These will be returned in a Pair. To log an event, make a copy of the AuditEventBuilder and add the event and details.- Parameters:
database
- the databaseclient
- the client if it should be used to find the user context- Returns:
- a Pair with an audit event logger and an audit event builder, or a Pair with null values
-