public = list(
- initialize = function(authToken = NULL, hostName = NULL)
+ initialize = function(authToken = NULL, hostName = NULL, numRetries = 0)
{
if(!is.null(hostName))
Sys.setenv(ARVADOS_API_HOST = hostName)
Sys.setenv(ARVADOS_API_TOKEN = authToken)
hostName <- Sys.getenv("ARVADOS_API_HOST");
- token <- Sys.getenv("ARVADOS_API_TOKEN");
+ token <- Sys.getenv("ARVADOS_API_TOKEN");
if(hostName == "" | token == "")
- stop(paste0("Please provide host name and authentification token",
- " or set ARVADOS_API_HOST and ARVADOS_API_TOKEN",
- " environment variables."))
+ stop(paste("Please provide host name and authentification token",
+ "or set ARVADOS_API_HOST and ARVADOS_API_TOKEN",
+ "environment variables."))
+
+ private$numRetries <- numRetries
+ private$REST <- RESTService$new(token, hostName,
+ HttpRequest$new(), HttpParser$new(),
+ numRetries)
- private$REST <- RESTService$new(token, hostName, NULL,
- HttpRequest$new(), HttpParser$new())
private$token <- private$REST$token
private$host <- private$REST$hostName
},
getRESTService = function() private$REST,
setRESTService = function(newRESTService) private$REST <- newRESTService,
+ getNumRetries = function() private$REST$numRetries,
+ setNumRetries = function(newNumOfRetries)
+ {
+ private$REST$setNumRetries(newNumOfRetries)
+ },
+
getCollection = function(uuid)
{
collection <- private$REST$getResource("collections", uuid)
names(body) <- c("group")
body$group <- newContent
- updatedProject <- private$REST$updateResource("groups",
- uuid, body)
+ updatedProject <- private$REST$updateResource("groups", uuid, body)
updatedProject
},
filters[[length(filters) + 1]] <- list("group_class", "=", "project")
- projects <- private$REST$listResources("groups", filters,
- limit, offset)
+ projects <- private$REST$listResources("groups", filters, limit, offset)
projects
},
private = list(
- token = NULL,
- host = NULL,
- REST = NULL
+ token = NULL,
+ host = NULL,
+ REST = NULL,
+ numRetries = NULL
),
cloneable = FALSE
)
+
+#' @export print.Arvados
+print.Arvados = function(arvados)
+{
+ cat(paste0("Type: ", "\"", "Arvados", "\""), sep = "\n")
+ cat(paste0("Host: ", "\"", arvados$getHostName(), "\""), sep = "\n")
+ cat(paste0("Token: ", "\"", arvados$getToken(), "\""), sep = "\n")
+}