Class ScriptSourceUtils
java.lang.Object
com.illumon.iris.controller.utils.ScriptSourceUtils
public class ScriptSourceUtils extends Object
Utilities for creating the ControllerScriptPathLoader for use in script session sourcing.
-
Constructor Summary
Constructors Constructor Description ScriptSourceUtils()
-
Method Summary
Modifier and Type Method Description static com.fishlib.base.Pair<AuditEventLogFormat2Logger,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, AuditEventLogFormat2Logger auditEventLogLogger, 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(com.fishlib.io.logger.Logger log, ScriptPathLoaderState scriptLoaderState, @Nullable AuditEventLogFormat2Logger auditEventLogLogger, @Nullable AuditEventBuilder auditEventBuilder)Wrap a controller client in a ControllerScriptPathLoader and return it.- 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
-
getAuditObjects
@NotNull public static com.fishlib.base.Pair<AuditEventLogFormat2Logger,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
-