RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Classes | Public Member Functions | Static Public Member Functions | List of all members
rstudio::launcher_plugins::options::Options Class Reference

Options for the plugin. More...

#include <Options.hpp>

Inheritance diagram for rstudio::launcher_plugins::options::Options:

Classes

class  Init
 Class for initializing Options. More...
 

Public Member Functions

Init registerOptions ()
 Allows the caller to register their options using the Init helper object. More...
 
Error readOptions (int in_argc, const char *const in_argv[], const system::FilePath &in_location)
 Reads the option file, loading all registered options. More...
 
system::TimeDuration getJobExpiryHours () const
 Gets the number of hours after which finished jobs expire and should be pruned from the plugin. More...
 
system::TimeDuration getHeartbeatIntervalSeconds () const
 Gets the number of seconds between heartbeats. More...
 
logging::LogLevel getLogLevel () const
 Gets the maximum level of log messages to write. More...
 
const system::FilePathgetLauncherConfigFile () const
 Gets the location of the configuration file for the RStudio Job Launcher. More...
 
size_t getMaxMessageSize () const
 Gets the maximum allowable size of messages which can be used in communications with the RStudio Launcher. More...
 
const std::string & getPluginName () const
 Gets the name the administrator gave to this instance of the Plugin in the launcher.conf file. More...
 
const system::FilePathgetRSandboxPath () const
 Gets the path to the rsandbox executable provided by the RStudio Workbench installation. More...
 
const system::FilePathgetScratchPath () const
 Gets the scratch path to which log files and other plugin data may be written. More...
 
const system::FilePathgetLoggingDir () const
 Gets path where debug logs should be written. More...
 
Error getServerUser (system::User &out_serverUser) const
 Gets the user to run as when root privileges are dropped. More...
 
size_t getThreadPoolSize () const
 Gets the size of the thread pool. More...
 
bool useUnprivilegedMode () const
 Gets whether the plugin should run in single-user unprivileged mode. More...
 
bool enableDebugLogging () const
 Gets whether debug logging is activated. More...
 

Static Public Member Functions

static OptionsgetInstance ()
 Gets the single instance of Options for the plugin. More...
 

Detailed Description

Options for the plugin.

Member Function Documentation

◆ enableDebugLogging()

bool rstudio::launcher_plugins::options::Options::enableDebugLogging ( ) const

Gets whether debug logging is activated.

Returns
True if the enableDebugLogging is true; false otherwise.

◆ getHeartbeatIntervalSeconds()

system::TimeDuration rstudio::launcher_plugins::options::Options::getHeartbeatIntervalSeconds ( ) const

Gets the number of seconds between heartbeats.

Returns
The number of seconds between heartbeats.

◆ getInstance()

static Options& rstudio::launcher_plugins::options::Options::getInstance ( )
static

Gets the single instance of Options for the plugin.

Returns
The single instance of Options for the plugin.

◆ getJobExpiryHours()

system::TimeDuration rstudio::launcher_plugins::options::Options::getJobExpiryHours ( ) const

Gets the number of hours after which finished jobs expire and should be pruned from the plugin.

Returns
The number of hours after which finished jobs expire and should be pruned from the plugin.

◆ getLauncherConfigFile()

const system::FilePath& rstudio::launcher_plugins::options::Options::getLauncherConfigFile ( ) const

Gets the location of the configuration file for the RStudio Job Launcher.

This is useful if the plugin implementation requires knowledge of the Job Launcher's configuration. Most plugin implementations will not need this value.

Returns
The location of the configuration file for the RStudio Job Launcher.

◆ getLoggingDir()

const system::FilePath& rstudio::launcher_plugins::options::Options::getLoggingDir ( ) const

Gets path where debug logs should be written.

Returns
The path where debug logs should be written.

◆ getLogLevel()

logging::LogLevel rstudio::launcher_plugins::options::Options::getLogLevel ( ) const

Gets the maximum level of log messages to write.

Returns
The maximum level of log messages to write.

◆ getMaxMessageSize()

size_t rstudio::launcher_plugins::options::Options::getMaxMessageSize ( ) const

Gets the maximum allowable size of messages which can be used in communications with the RStudio Launcher.

It is not recommended to change this value directly in the Plugin's configuration file. Changes to this value will be propagated from the RStudio Launcher to all Plugins.

Returns
The maximum allowable size of messages which can be used in communications with the RStudio Launcher.

◆ getPluginName()

const std::string& rstudio::launcher_plugins::options::Options::getPluginName ( ) const

Gets the name the administrator gave to this instance of the Plugin in the launcher.conf file.

This value may be useful if a plugin implementation needs to be aware of other instances of the same Plugin in a load balanced scenario.

Returns
The name the administrator gave to this instance of the Plugin in the launcher.conf file.

◆ getRSandboxPath()

const system::FilePath& rstudio::launcher_plugins::options::Options::getRSandboxPath ( ) const

Gets the path to the rsandbox executable provided by the RStudio Workbench installation.

If RStudio Workbench is installed to the default location, this value does not need to be set.

Returns
The path to the rsandbox executable.

◆ getScratchPath()

const system::FilePath& rstudio::launcher_plugins::options::Options::getScratchPath ( ) const

Gets the scratch path to which log files and other plugin data may be written.

Note that this does not include job output. Job output should be written in the location specified by the user when the job is run.

Returns
The scratch path to which log files and other plugin data may be written.

◆ getServerUser()

Error rstudio::launcher_plugins::options::Options::getServerUser ( system::User out_serverUser) const

Gets the user to run as when root privileges are dropped.

Parameters
out_serverUserThe server user, if it exists.
Returns
Success if the server user exists; error otherwise.

◆ getThreadPoolSize()

size_t rstudio::launcher_plugins::options::Options::getThreadPoolSize ( ) const

Gets the size of the thread pool.

Returns
The size of the thread pool.

◆ readOptions()

Error rstudio::launcher_plugins::options::Options::readOptions ( int  in_argc,
const char *const  in_argv[],
const system::FilePath in_location 
)

Reads the option file, loading all registered options.

registerOptions() must be called before this is called in order to include additional options.

Parameters
in_argcThe count of command line arguments.
in_argvThe command line arguments.
in_locationThe location of the configuration file. Must exist.
Returns
Success if all required options were read and no parsing errors occurred; Error otherwise.

◆ registerOptions()

Init rstudio::launcher_plugins::options::Options::registerOptions ( )

Allows the caller to register their options using the Init helper object.

Returns
The Init helper object with which options can be registered.

◆ useUnprivilegedMode()

bool rstudio::launcher_plugins::options::Options::useUnprivilegedMode ( ) const

Gets whether the plugin should run in single-user unprivileged mode.

Returns
True if the plugin should run in uprivileged mode; false otherwise.

The documentation for this class was generated from the following file: