RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
LocalOptions.hpp
1 /*
2  * LocalOptions.hpp
3  *
4  * Copyright (C) 2019-20 by RStudio, PBC
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7  * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
8  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
12  * Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
15  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18  *
19  */
20 
21 #ifndef LAUNCHER_PLUGINS_LOCAL_OPTIONS_HPP
22 #define LAUNCHER_PLUGINS_LOCAL_OPTIONS_HPP
23 
24 #include <Noncopyable.hpp>
25 
26 #include <system/FilePath.hpp>
27 
28 namespace rstudio {
29 namespace launcher_plugins {
30 namespace local {
31 
35 class LocalOptions : public Noncopyable
36 {
37 public:
43  static LocalOptions& getInstance();
44 
51  size_t getNodeConnectionTimeoutSeconds() const;
52 
59 
66  void initialize();
67 
73  bool shouldSaveUnspecifiedOutput() const;
74 
75 private:
79  LocalOptions() = default;
80 
84  size_t m_nodeConnectionTimeoutSeconds;
85 
89  bool m_saveUnspecifiedOutput;
90 
94  system::FilePath m_secureCookieKeyFile;
95 };
96 
97 } // namespace local
98 } // namespace launcher_plugins
99 } // namespace rstudio
100 
101 #endif
rstudio::launcher_plugins::system::FilePath
Class which represents a path on the system. May be any type of file (e.g. directory,...
Definition: FilePath.hpp:77
rstudio::launcher_plugins::local::LocalOptions::shouldSaveUnspecifiedOutput
bool shouldSaveUnspecifiedOutput() const
Gets whether to save output for a job when the output path has not been specified.
rstudio::launcher_plugins::local::LocalOptions
Class which stores options specific to the Local Container system.
Definition: LocalOptions.hpp:35
rstudio::launcher_plugins::local::LocalOptions::getSecureCookieKeyFile
const system::FilePath & getSecureCookieKeyFile() const
Gets the secure cookie key file to use for decrypting PAM passwords.
rstudio::launcher_plugins::Noncopyable
Class which can be inherited from to disallow copying of its child classes.
Definition: Noncopyable.hpp:34
rstudio::launcher_plugins::local::LocalOptions::initialize
void initialize()
Method which initializes LocalOptions. This method should be called exactly once, before the options ...
rstudio::launcher_plugins::local::LocalOptions::getInstance
static LocalOptions & getInstance()
Gets the single instance of LocalOptions for the plugin.
rstudio::launcher_plugins::local::LocalOptions::getNodeConnectionTimeoutSeconds
size_t getNodeConnectionTimeoutSeconds() const
Gets the number of seconds that can elapse before an attempted connection to another local node will ...