Package com.illumon.integrations.common
Class IrisIntegrationGroovySession
java.lang.Object
com.illumon.integrations.common.IrisIntegrationGroovySession
Iris DB groovy session with helper methods which is callable from supported languages.
-
Constructor Summary
ConstructorsConstructorDescriptionIrisIntegrationGroovySession(String description) Create an IrisIntegrationGroovySession with no pushed classes and not using standalone client services.IrisIntegrationGroovySession(String description, boolean initializeStandaloneClientServices) Create an IrisIntegrationGroovySession with no pushed classesIrisIntegrationGroovySession(String description, boolean initializeStandaloneClientServices, Class<?>... additionalClasses) Create an IrisIntegrationGroovySession. -
Method Summary
Modifier and TypeMethodDescriptionvoidLocally execute the specified Groovy command.voidexecuteFile(String file) Locally execute the contents of the specified file as a Groovy script.getDb()Get the active database reference.getVariable(String variable) Retrieve the value of a variable from the active Groovy session.static voidinitializeStandaloneClientServices(@NotNull com.fishlib.configuration.Configuration configuration, @NotNull com.fishlib.io.logger.Logger log, @NotNull String description) Perform the standard initialization needed for standalone clients.booleanIndicate whether the current user is authenticated with the databasebooleanisRemote()publishTable(String name, Table t) Make a table remote, then add it as a Groovy variable.pushDataFrame(String name, int size, String[] columnNames, Object... dfCols) Utility method for pushing a data frame from R to the database.voidshutdown()Shut down all related objects cleanly.toString()Represent the current IrisIntegrationGroovySession as a string
-
Constructor Details
-
IrisIntegrationGroovySession
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 settingslog- The Logger to usedescription- The description for this environment
-
getDb
Get the active database reference.- Returns:
- the RemoteDatabase created during initialization
-
execute
Locally execute the specified Groovy command.- Parameters:
command- The text representation of the script to execute.
-
executeFile
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
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
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
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 specifiedname.- Parameters:
name- The name to usesize- The number of rows in the table. Each of thedfColsshould have this length.columnNames- An array of column namesdfCols- Java arrays containing data for each column- Returns:
- The newly created remote table
-
publishTable
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
Represent the current IrisIntegrationGroovySession as a string -
isRemote
public boolean isRemote()
-