Beispiel #1
0
 /// <summary>
 /// Utility function for creating a BackgroundTask Instance of RTask
 /// </summary>
 /// <param name="taskName">Name of the background task</param>
 /// <param name="taskDescription">Description of the background task</param>
 /// <param name="codeBlock">R code to be executed on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <returns>BackgroundTask instance</returns>
 /// <remarks></remarks>
 public static RTask backgroundTask(String taskName,
                                    String taskDescription,
                                    String codeBlock,
                                    BackgroundTaskOptions options)
 {
     return(new BackgroundTask(taskName, taskDescription, codeBlock, options));
 }
Beispiel #2
0
 /// <summary>
 /// Utility function for creating a BackgroundTask Instance of RTask
 /// </summary>
 /// <param name="taskName">Name of the background task</param>
 /// <param name="taskDescription">Description of the background task</param>
 /// <param name="externalURL">URL that represents an R Script executed on the background task</param>
 /// <param name="hasURL">Boolean specifying that a URL will be use to execute on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <returns>BackgroundTask instance</returns>
 /// <remarks></remarks>
 public static RTask backgroundTask(String taskName,
                                    String taskDescription,
                                    String externalURL,
                                    Boolean hasURL,
                                    BackgroundTaskOptions options)
 {
     return(new BackgroundTask(taskName, taskDescription, externalURL, hasURL, options));
 }
Beispiel #3
0
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="code">R code to be executed on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                       String description,
                       String code,
                       BackgroundTaskOptions options)
 {
     m_name        = name;
     m_description = description;
     m_code        = code;
     m_options     = options;
 }
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="code">R code to be executed on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                    String description,
                    String code,
                    BackgroundTaskOptions options)
 {
     m_name = name;
     m_description = description;
     m_code = code;
     m_options = options;
 }
Beispiel #5
0
 /// <summary>
 /// Utility function for creating a BackgroundTask Instance of RTask
 /// </summary>
 /// <param name="taskName">Name of the background task</param>
 /// <param name="taskDescription">Description of the background task</param>
 /// <param name="filename">Name of repository R Script executed on the background task</param>
 /// <param name="directory">Directory in the repository where the R Script is located</param>
 /// <param name="author">Author of the repository R Script</param>
 /// <param name="version">Optional version of the R Script</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <returns>BackgroundTask instance</returns>
 /// <remarks></remarks>
 public static RTask backgroundTask(String taskName,
                                    String taskDescription,
                                    String filename,
                                    String directory,
                                    String author,
                                    String version,
                                    BackgroundTaskOptions options)
 {
     return(new BackgroundTask(taskName, taskDescription, filename, directory, author, version, options));
 }
Beispiel #6
0
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="externalURL">URL that represents an R Script executed on the background task</param>
 /// <param name="hasURL">Boolean specifying that a URL will be use to execute on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                       String description,
                       String externalURL,
                       Boolean hasURL,
                       BackgroundTaskOptions options)
 {
     m_name        = name;
     m_description = description;
     m_external    = externalURL;
     m_options     = options;
 }
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="externalURL">URL that represents an R Script executed on the background task</param>
 /// <param name="hasURL">Boolean specifying that a URL will be use to execute on the background task</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                    String description,
                    String externalURL,
                    Boolean hasURL, 
                    BackgroundTaskOptions options)
 {
     m_name = name;
     m_description = description;
     m_external = externalURL;
     m_options = options;
 }
Beispiel #8
0
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="filename">Name of repository R Script executed on the background task</param>
 /// <param name="directory">Directory in the repository where the R Script is located</param>
 /// <param name="author">Author of the repository R Script</param>
 /// <param name="version">Optional version of the R Script</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                       String description,
                       String filename,
                       String directory,
                       String author,
                       String version,
                       BackgroundTaskOptions options)
 {
     m_name        = name;
     m_description = description;
     m_filename    = filename;
     m_directory   = directory;
     m_author      = author;
     m_version     = version;
     m_options     = options;
 }
        public static JobExecutionOptions translate(BackgroundTaskOptions taskOptions, Boolean isPriorityTask)
        {
            JobExecutionOptions options = null;

            if (taskOptions != null)
            {
                options = new JobExecutionOptions();

                /*
                 * BackgroundTaskOptions to JobExecutionOptions.
                 */

                if (isPriorityTask)
                {
                    options.priority = "HIGH_PRIORITY";
                }

                options.noProject = taskOptions.noProject;

                if (taskOptions.repeatCount > 0)
                {
                    options.schedulingOptions                = new JobSchedulingOptions();
                    options.schedulingOptions.repeatCount    = taskOptions.repeatCount;
                    options.schedulingOptions.repeatInterval = taskOptions.repeatInterval;
                    options.schedulingOptions.startTime      = taskOptions.startTime;
                }

                /*
                 * BackgroundTaskOptions to ProjectExecutionOptions.
                 */

                options.rinputs    = taskOptions.rinputs;
                options.csvrinputs = taskOptions.csvrinputs;

                if (taskOptions.preloadWorkspace != null)
                {
                    options.preloadWorkspace           = new ProjectPreloadOptions();
                    options.preloadWorkspace.filename  = taskOptions.preloadWorkspace.filename;
                    options.preloadWorkspace.directory = taskOptions.preloadWorkspace.directory;
                    options.preloadWorkspace.author    = taskOptions.preloadWorkspace.author;
                    options.preloadWorkspace.version   = taskOptions.preloadWorkspace.version;
                }

                if (taskOptions.preloadDirectory != null)
                {
                    options.preloadDirectory           = new ProjectPreloadOptions();
                    options.preloadDirectory.filename  = taskOptions.preloadDirectory.filename;
                    options.preloadDirectory.directory = taskOptions.preloadDirectory.directory;
                    options.preloadDirectory.author    = taskOptions.preloadDirectory.author;
                    options.preloadDirectory.version   = taskOptions.preloadDirectory.version;
                }

                options.preloadByDirectory = taskOptions.preloadByDirectory;

                options.graphicsDevice = taskOptions.graphicsDevice;
                options.graphicsWidth  = taskOptions.graphicsWidth;
                options.graphicsHeight = taskOptions.graphicsHeight;
                options.echooff        = taskOptions.echooff;
                options.consoleoff     = taskOptions.consoleoff;
                options.routputs       = taskOptions.routputs;
                options.encodeDataFramePrimitiveAsVector = taskOptions.encodeDataFramePrimitiveAsVector;
                options.nan      = taskOptions.nan;
                options.infinity = taskOptions.infinity;

                if (taskOptions.storageOptions != null)
                {
                    options.storageOptions            = new ProjectStorageOptions();
                    options.storageOptions.directory  = taskOptions.storageOptions.directory;
                    options.storageOptions.files      = taskOptions.storageOptions.files;
                    options.storageOptions.newVersion = taskOptions.storageOptions.newVersion;
                    options.storageOptions.objects    = taskOptions.storageOptions.objects;
                    options.storageOptions.published  = taskOptions.storageOptions.published;
                    options.storageOptions.workspace  = taskOptions.storageOptions.workspace;
                }
            }

            return(options);
        }
        public static JobExecutionOptions translate(BackgroundTaskOptions taskOptions, Boolean isPriorityTask)
        {
            JobExecutionOptions options = null;

            if (taskOptions != null)
            {

                options = new JobExecutionOptions();

                /*
                 * BackgroundTaskOptions to JobExecutionOptions.
                 */

                if (isPriorityTask)
                    options.priority = "HIGH_PRIORITY";

                options.noProject = taskOptions.noProject;

                if (taskOptions.repeatCount > 0)
                {
                    options.schedulingOptions = new JobSchedulingOptions();
                    options.schedulingOptions.repeatCount = taskOptions.repeatCount;
                    options.schedulingOptions.repeatInterval = taskOptions.repeatInterval;
                    options.schedulingOptions.startTime = taskOptions.startTime;
                }

                /*
                 * BackgroundTaskOptions to ProjectExecutionOptions.
                 */

                options.rinputs = taskOptions.rinputs;
                options.csvrinputs = taskOptions.csvrinputs;

                if (taskOptions.preloadWorkspace != null)
                {

                    options.preloadWorkspace = new ProjectPreloadOptions();
                    options.preloadWorkspace.filename = taskOptions.preloadWorkspace.filename;
                    options.preloadWorkspace.directory =  taskOptions.preloadWorkspace.directory;
                    options.preloadWorkspace.author = taskOptions.preloadWorkspace.author;
                    options.preloadWorkspace.version = taskOptions.preloadWorkspace.version;
                }

                if (taskOptions.preloadDirectory != null)
                {

                    options.preloadDirectory = new ProjectPreloadOptions();
                    options.preloadDirectory.filename = taskOptions.preloadDirectory.filename;
                    options.preloadDirectory.directory = taskOptions.preloadDirectory.directory;
                    options.preloadDirectory.author = taskOptions.preloadDirectory.author;
                    options.preloadDirectory.version = taskOptions.preloadDirectory.version;
                }

                options.preloadByDirectory = taskOptions.preloadByDirectory;

                options.graphicsDevice = taskOptions.graphicsDevice;
                options.graphicsWidth = taskOptions.graphicsWidth;
                options.graphicsHeight = taskOptions.graphicsHeight;
                options.echooff = taskOptions.echooff;
                options.consoleoff = taskOptions.consoleoff;
                options.routputs = taskOptions.routputs;
                options.encodeDataFramePrimitiveAsVector = taskOptions.encodeDataFramePrimitiveAsVector;
                options.nan = taskOptions.nan;
                options.infinity = taskOptions.infinity;

                if (taskOptions.storageOptions != null)
                {

                    options.storageOptions = new ProjectStorageOptions();
                    options.storageOptions.directory = taskOptions.storageOptions.directory;
                    options.storageOptions.files = taskOptions.storageOptions.files;
                    options.storageOptions.newVersion = taskOptions.storageOptions.newVersion;
                    options.storageOptions.objects = taskOptions.storageOptions.objects;
                    options.storageOptions.published = taskOptions.storageOptions.published;
                    options.storageOptions.workspace = taskOptions.storageOptions.workspace;
                }

            }

            return options;
        }
 /// <summary>
 /// Constructor for specifying a a Background Task
 /// </summary>
 /// <param name="name">Name of the background task</param>
 /// <param name="description">Description of the background task</param>
 /// <param name="filename">Name of repository R Script executed on the background task</param>
 /// <param name="directory">Directory in the repository where the R Script is located</param>
 /// <param name="author">Author of the repository R Script</param>
 /// <param name="version">Optional version of the R Script</param>
 /// <param name="options">Specification of options for the background task</param>
 /// <remarks></remarks>
 public BackgroundTask(String name,
                    String description,
                    String filename,
                    String directory,
                    String author,
                    String version,
                    BackgroundTaskOptions options)
 {
     m_name = name;
     m_description = description;
     m_filename = filename;
     m_directory = directory;
     m_author = author;
     m_version = version;
     m_options = options;
 }