Class IrisIntegrationGroovySession

java.lang.Object
com.illumon.integrations.common.IrisIntegrationGroovySession

public class IrisIntegrationGroovySession extends Object
Iris DB groovy session with helper methods which is callable from supported languages.
  • Constructor Details

    • IrisIntegrationGroovySession

      @ScriptApi public IrisIntegrationGroovySession(String description) throws IOException
      Create an IrisIntegrationGroovySession with no pushed classes and not using standalone client services.
      Parameters:
      description - The description for this session.
      Throws:
      IOException - If there is an error communicating with the server.
    • IrisIntegrationGroovySession

      @ScriptApi public IrisIntegrationGroovySession(String description, boolean initializeStandaloneClientServices) throws IOException
      Create an IrisIntegrationGroovySession with no pushed classes
      Parameters:
      description - The description for this session.
      initializeStandaloneClientServices - True if this should be initialized with standalone client services.
      Throws:
      IOException - If there is an error communicating with the server.
    • IrisIntegrationGroovySession

      @ScriptApi public IrisIntegrationGroovySession(String description, boolean initializeStandaloneClientServices, Class<?>... additionalClasses) throws IOException
      Create an IrisIntegrationGroovySession.
      Parameters:
      description - The description for this session.
      initializeStandaloneClientServices - True if this should be initialized with standalone client services.
      additionalClasses - A set of classes that should be pushed to the server at initialization time. When using an IrisIntegrationGroovySession, classes cannot be pushed after the Session has been created.
      Throws:
      IOException - If there is an error communicating with the server.
  • Method Details

    • initializeStandaloneClientServices

      @ScriptApi public static void initializeStandaloneClientServices(@NotNull @NotNull com.fishlib.configuration.Configuration configuration, @NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String description)
      Perform the standard initialization needed for standalone clients.
      Parameters:
      configuration - The Configuration object that defines the settings
      log - The Logger to use
      description - The description for this environment
    • getDb

      public RemoteDatabase getDb()
      Get the active database reference.
      Returns:
      the RemoteDatabase created during initialization
    • execute

      @ScriptApi public void execute(String command)
      Locally execute the specified Groovy command.
      Parameters:
      command - The text representation of the script to execute.
    • executeFile

      @ScriptApi public void executeFile(String file) throws IOException
      Locally execute the contents of the specified file as a Groovy script.
      Parameters:
      file - The path to the file to be read
      Throws:
      IOException - If the file cannot be read
    • getVariable

      @ScriptApi public Object getVariable(String variable)
      Retrieve the value of a variable from the active Groovy session.
      Parameters:
      variable - The name of the variable to retrieve the value of
      Returns:
      The value of the specified variable
    • isAuthenticated

      @ScriptApi public boolean isAuthenticated()
      Indicate whether the current user is authenticated with the database
      Returns:
      True if the user is authenticated, false if the user is not or if the database does not exist.
    • shutdown

      @ScriptApi public void shutdown()
      Shut down all related objects cleanly.
    • pushDataFrame

      @ScriptApi public Table pushDataFrame(String name, int size, String[] columnNames, Object... dfCols)
      Utility method for pushing a data frame from R to the database. It will create a table, make it remote, and add it to the groovy session's binding with the specified name.
      Parameters:
      name - The name to use
      size - The number of rows in the table. Each of the dfCols should have this length.
      columnNames - An array of column names
      dfCols - Java arrays containing data for each column
      Returns:
      The newly created remote table
    • publishTable

      @ScriptApi public Table publishTable(String name, Table t)
      Make a table remote, then add it as a Groovy variable.
      Parameters:
      name - The name to assign to the table within Groovy.
      t - The Table object to bring into the Groovy session.
      Returns:
      The resultant Table
    • toString

      public String toString()
      Represent the current IrisIntegrationGroovySession as a string
      Overrides:
      toString in class Object
      Returns:
      A String defining this IrisIntegrationGroovySession.
    • isRemote

      public boolean isRemote()