@@ -29,7 +29,6 @@ setClass("DSConnection", representation(name = "character"), contains = c("DSObj
2929# ' accessible through this connection.
3030# '
3131# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
32- # '
3332# ' @return A character vector of table names.
3433# '
3534# ' @family DSConnection generics
@@ -53,6 +52,7 @@ setGeneric("dsListTables",
5352# '
5453# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
5554# ' @param table the table fully qualified name
55+ # ' @return A logical indicating if the table exists.
5656# '
5757# ' @family DSConnection generics
5858# ' @examples
@@ -73,6 +73,7 @@ setGeneric("dsHasTable",
7373# ' accessible through this connection.
7474# '
7575# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
76+ # ' @return A character vector of resource names.
7677# '
7778# ' @family DSConnection generics
7879# ' @examples
@@ -94,6 +95,7 @@ setGeneric("dsListResources",
9495# '
9596# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
9697# ' @param resource the resource fully qualified name
98+ # ' @return A logical indicating if the resource exists.
9799# '
98100# ' @family DSConnection generics
99101# ' @examples
@@ -108,6 +110,52 @@ setGeneric("dsHasResource",
108110 def = function (conn , resource ) standardGeneric(" dsHasResource" ),
109111 valueClass = " logical" )
110112
113+ # ' Check remote R session exists
114+ # '
115+ # ' Check if a remote R session exists (not necessarily running and ready to accept
116+ # ' R commands submissions).
117+ # '
118+ # ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
119+ # ' @return A logical indicating if a remote R session exists accessible through this connection.
120+ # '
121+ # ' @family DSConnection generics
122+ # ' @examples
123+ # ' \dontrun{
124+ # ' con <- dsConnect(DSOpal::Opal(), "server1",
125+ # ' username = "dsuser", password = "password", url = "https://opal-demo.obiba.org")
126+ # ' dsHasSession(con)
127+ # ' dsDisconnect(con)
128+ # ' }
129+ # ' @export
130+ setGeneric ("dsHasSession ",
131+ def = function (conn ) standardGeneric(" dsHasSession" ),
132+ valueClass = " logical" )
133+
134+ # ' Create a remote R session
135+ # '
136+ # ' Create a remote R session if none exists. If a remote R session already exists,
137+ # ' it will be reused. Returns a logical indicating if a remote R session exists
138+ # ' accessible through this connection.
139+ # '
140+ # ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
141+ # ' @param async Whether the result of the call should be retrieved asynchronously. When TRUE (default)
142+ # ' the calls are parallelized over the connections, when the connection supports
143+ # ' that feature, with an extra overhead of requests.
144+ # ' @return An object of class \code{\link{DSSession-class}} representing the remote R session.
145+ # '
146+ # ' @family DSConnection generics
147+ # ' @examples
148+ # ' \dontrun{
149+ # ' con <- dsConnect(DSOpal::Opal(), "server1",
150+ # ' username = "dsuser", password = "password", url = "https://opal-demo.obiba.org")
151+ # ' dsSession(con, async=TRUE)
152+ # ' dsDisconnect(con)
153+ # ' }
154+ # ' @export
155+ setGeneric ("dsSession ",
156+ def = function (conn , async = TRUE ) standardGeneric(" dsSession" ),
157+ valueClass = " DSSession" )
158+
111159# ' Assign a data table
112160# '
113161# ' Assign a data table from the data repository to a symbol in the DataSHIELD R session.
@@ -126,7 +174,8 @@ setGeneric("dsHasResource",
126174# ' will be the data frame row names. When specified this column can be used to perform joins between data frames.
127175# ' @param async Whether the result of the call should be retrieved asynchronously. When TRUE (default) the calls are parallelized over
128176# ' the connections, when the connection supports that feature, with an extra overhead of requests.
129- # '
177+ # ' @return An object of class \code{\link{DSResult-class}} representing the result of the assignment operation.
178+ # '
130179# ' @family DSConnection generics
131180# ' @examples
132181# ' \dontrun{
@@ -150,7 +199,8 @@ setGeneric("dsAssignTable",
150199# ' @param resource Fully qualified name of a resource reference in the data repository.
151200# ' @param async Whether the result of the call should be retrieved asynchronously. When TRUE (default) the calls are parallelized over
152201# ' the connections, when the connection supports that feature, with an extra overhead of requests.
153- # '
202+ # ' @return An object of class \code{\link{DSResult-class}} representing the result of the assignment operation.
203+ # '
154204# ' @family DSConnection generics
155205# ' @examples
156206# ' \dontrun{
@@ -174,7 +224,8 @@ setGeneric("dsAssignResource",
174224# ' @param expr A R expression with allowed assign functions calls.
175225# ' @param async Whether the result of the call should be retrieved asynchronously. When TRUE (default) the calls are parallelized over
176226# ' the connections, when the connection supports that feature, with an extra overhead of requests.
177- # '
227+ # ' @return An object of class \code{\link{DSResult-class}} representing the result of the assignment operation.
228+ # '
178229# ' @family DSConnection generics
179230# ' @examples
180231# ' \dontrun{
@@ -197,7 +248,8 @@ setGeneric("dsAssignExpr",
197248# ' @param expr Expression to evaluate.
198249# ' @param async Whether the result of the call should be retrieved asynchronously. When TRUE (default) the calls are parallelized over
199250# ' the connections, when the connection supports that feature, with an extra overhead of requests.
200- # '
251+ # ' @return An object of class \code{\link{DSResult-class}} representing the result of the aggregation operation.
252+ # '
201253# ' @family DSConnection generics
202254# ' @examples
203255# ' \dontrun{
@@ -217,6 +269,7 @@ setGeneric("dsAggregate",
217269# ' After assignments have been performed, some symbols live in the DataSHIELD R session on the server side.
218270# '
219271# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
272+ # ' @return A character vector of symbol names.
220273# '
221274# ' @family DSConnection generics
222275# ' @examples
@@ -257,8 +310,8 @@ setGeneric("dsRmSymbol",
257310# ' Get the list of DataSHIELD profiles that have been configured on the remote data repository.
258311# '
259312# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
260- # '
261- # ' @return A list containing the "available" character vector of profile names and the "current" profile (in case a default one was assigned).
313+ # ' @return A list containing the "available" character vector of profile names and
314+ # ' the "current" profile (in case a default one was assigned).
262315# '
263316# ' @family DSConnection generics
264317# ' @examples
@@ -279,7 +332,6 @@ setGeneric("dsListProfiles",
279332# '
280333# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
281334# ' @param type Type of the method: "aggregate" (default) or "assign".
282- # '
283335# ' @return A data.frame with columns: name, type ('aggregate' or 'assign'), class ('function' or 'script'), value, package, version.
284336# '
285337# ' @family DSConnection generics
@@ -300,7 +352,6 @@ setGeneric("dsListMethods",
300352# ' Get the list of DataSHIELD packages with their version, that have been configured on the remote data repository.
301353# '
302354# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
303- # '
304355# ' @return A data.frame with columns: name, version.
305356# '
306357# ' @family DSConnection generics
@@ -322,7 +373,6 @@ setGeneric("dsListPackages",
322373# ' Get the list of DataSHIELD workspaces, that have been saved on the remote data repository.
323374# '
324375# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
325- # '
326376# ' @return A data.frame with columns: name, lastAccessDate, size.
327377# '
328378# ' @family DSConnection generics
@@ -407,10 +457,11 @@ setGeneric("dsRmWorkspace",
407457# ' When a \code{\link{DSResult-class}} object is returned on aggregation or assignment operation,
408458# ' the raw result can be accessed asynchronously, allowing parallelization of DataSHIELD calls
409459# ' over multpile servers. The returned named list of logicals will specify if asynchronicity is supported for:
410- # ' aggregation operation ('aggregate'), table assignment operation ('assignTable'),
460+ # ' session operation ('session'), aggregation operation ('aggregate'), table assignment operation ('assignTable'),
411461# ' resource assignment operation ('assignResource') and expression assignment operation ('assignExpr').
412462# '
413463# ' @param conn An object that inherits from \code{\link{DSConnection-class}}.
464+ # ' @return A named list of logicals indicating if asynchronicity is supported for session, aggregation and assignment operations.
414465# '
415466# ' @family DSConnection generics
416467# ' @examples
0 commit comments