DSLiteServer mimics a DataSHIELD server by holding datasets and exposing DataSHIELD-like functions: aggregate and assign. A DataSHIELD session is a R environment where the assignment and the operations happen.
new()Create new DSLiteServer instance. See defaultDSConfiguration function for including or excluding packages when discovering the DataSHIELD configuration from the DataSHIELD server-side packages (meta-data from the DESCRIPTION files).
DSLiteServer$new(
tables = list(),
resources = list(),
config = DSLite::defaultDSConfiguration(),
strict = TRUE,
home = file.path(tempdir(), ".dslite"),
profile = "default"
)tablesA named list of data.frames representing the harmonized tables.
resourcesA named list of resourcer::Resource objects representing accessible data or computation resources.
configThe DataSHIELD configuration. Default is to discover it from the DataSHIELD server-side R packages.
strictLogical to specify whether the DataSHIELD configuration must be strictly applied. Default is TRUE.
homeFolder location where are located the session work directory and where to read and dump workspace images.
profileThe DataSHIELD profile name, used to give a name to the DS configuration. Default is "default". Default is in a hidden folder of the R session's temporary directory.
A DSLiteServer object
config()Get or set the DataSHIELD configuration.
DSLiteServer$config(value)valueThe DataSHIELD configuration: aggregate/assign methods in data frames and a named list of options.
The DataSHIELD configuration, if no parameter is provided.
valueThe DataSHIELD profile name.
The DataSHIELD profile, if no parameter is provided.
strict()Get or set the level of strictness (stop when function call is not configured)
DSLiteServer$strict(value)valueThe strict logical field.
The strict field if no parameter is provided.
home()Get or set the home folder location where are located the session work directories and where to read and dump workspace images.
DSLiteServer$home(value)valueThe path to the home folder.
The home folder path if no parameter is provided.
workspaces()List the saved workspaces in the home folder.
DSLiteServer$workspaces(prefix = NULL)prefixFilter workspaces starting with provided prefix (optional).
workspace_save()Save the session's workspace image identified by the sid identifier
with the provided name in the home folder.
DSLiteServer$workspace_save(sid, name)sid, Session ID
nameThe name to be given to the workspace's image.
workspace_restore()Restore a saved session's workspace image into the session identified by the sid identifier
with the provided name in the home folder.
DSLiteServer$workspace_restore(sid, name)sid, Session ID
nameThe name of the workspace's image to restore.
workspace_rm()Remove the workspace image with the provided name from the home folder.
DSLiteServer$workspace_rm(name)nameThe name of the workspace.
aggregateMethods()Get or set the aggregate methods.
DSLiteServer$aggregateMethods(value)valueA data.frame with columns: name (the client function call),
value (the translated server call), package (relevant when extracted from a DataSHIELD server-side package),
version (relevant when extracted from a DataSHIELD server-side package), type ("aggregate"),
class ("function" for package functions or "script" for custom scripts).
The aggregate methods when no parameter is provided.
aggregateMethod()Get or set an aggregate method.
DSLiteServer$aggregateMethod(name, value)nameThe client function call.
valueThe translated server call: either a package function reference or function expression. Remove the method when NULL.
The aggregate method when no value parameter is provided.
assignMethods()Get or set the assign methods.
DSLiteServer$assignMethods(value)valueA data.frame with columns: name (the client function call), value (the translated server call),
package (relevant when extracted from a DataSHIELD server-side package), version (relevant when extracted from a DataSHIELD server-side package),
type ("assign"), class ("function" for package functions or "script" for custom scripts).
The assign methods when no parameter is provided.
assignMethod()Get or set an assign method.
DSLiteServer$assignMethod(name, value)nameThe client function call
valueThe translated server call: either a package function reference or function expression. Remove the method when NULL.
The assign method when no value parameter is provided.
options()Get or set the DataSHIELD R options that are applied when a new DataSHIELD session is started.
DSLiteServer$options(value)valueA named list of options.
The R options when no parameter is provided.
option()Get or set a R option.
DSLiteServer$option(key, value)keyThe R option's name.
valueThe R option's value. Remove the option when NULL.
The R option's value when only key parameter is provided.
newSession()Create a new DataSHIELD session (contained execution environment), apply options that are defined
in the DataSHIELD configuration and restore workspace image if restore workspace name argument is provided.
DSLiteServer$newSession(restore = NULL, profile = NULL)restoreThe workspace image to be restored (optional).
profileThe requested profile name (optional). If provided, new session creation will fail in case it does not match the server's profile name.
hasSession()Check a DataSHIELD session is alive.
DSLiteServer$hasSession(sid)sidThe session ID.
getSession()Get the DataSHIELD session's environment.
DSLiteServer$getSession(sid)sidThe session ID.
getSessionIds()Get the DataSHIELD session IDs.
DSLiteServer$getSessionIds()
getSessionData()Get the symbol value from the DataSHIELD session's environment.
DSLiteServer$getSessionData(sid, symbol)sidThe session ID.
symbolThe symbol name.
closeSession()Destroy DataSHIELD session and save workspace image if save workspace name argument is provided.
DSLiteServer$closeSession(sid, save = NULL)sidThe session ID.
saveThe name of the workspace image to be saved (optional).
tableNames()List the names of the tables that can be assigned.
DSLiteServer$tableNames()
hasTable()Check a table exists.
DSLiteServer$hasTable(name)nameThe table name to be looked for.
resourceNames()List the names of the resources (resourcer::Resource objects) that can be assigned.
DSLiteServer$resourceNames()
hasResource()Check a resource (resourcer::Resource object) exists.
DSLiteServer$hasResource(name)nameThe resource name to be looked for.
sidThe session ID.
symbol_rm()Remove a symbol from a DataSHIELD session.
DSLiteServer$symbol_rm(sid, name)sidThe session ID.
nameThe symbol name.
assignTable()Assign a table to a symbol in a DataSHIELD session. Filter table columns with the variables names provided.
DSLiteServer$assignTable(sid, symbol, name, variables = NULL, id.name = NULL)sidThe session ID.
symbolThe symbol to be assigned.
nameThe table's name.
variablesThe variable names to be filtered in (optional).
id.nameThe column name to be used for the entity's identifier (optional).
assignResource()Assign a resource as a resourcer::ResourceClient object to a symbol in a DataSHIELD session.
DSLiteServer$assignResource(sid, symbol, name)sidThe session ID.
symbolThe symbol name.
nameThe name of the resource.
assignExpr()Evaluate an assignment expression in a DataSHIELD session.
DSLiteServer$assignExpr(sid, symbol, expr)sidThe session ID.
symbolThe symbol name.
exprThe R expression to evaluate.
aggregate()Evaluate an aggregate expression in a DataSHIELD session.
DSLiteServer$aggregate(sid, expr)sidThe session ID.
exprThe R expression to evaluate.
clone()The objects of this class are cloneable with this method.
DSLiteServer$clone(deep = FALSE)deepWhether to make a deep clone.
Other server-side items:
newDSLiteServer()