RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
24 #ifndef LAUNCHER_PLUGINS_LOCAL_JOB_SOURCE_HPP
25 #define LAUNCHER_PLUGINS_LOCAL_JOB_SOURCE_HPP
27 #include <api/IJobSource.hpp>
31 #include <api/Job.hpp>
32 #include <jobs/AbstractJobRepository.hpp>
33 #include <jobs/JobStatusNotifier.hpp>
35 #include "LocalJobRepository.hpp"
36 #include "LocalSecureCookie.hpp"
37 #include "LocalJobRunner.hpp"
40 namespace launcher_plugins {
58 std::string in_hostname,
59 jobs::JobStatusNotifierPtr in_jobStatusNotifier,
60 std::shared_ptr<LocalJobRepository> in_jobRepository);
84 bool cancelJob(api::JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage)
override;
121 bool killJob(api::JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage)
override;
136 bool resumeJob(api::JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage)
override;
151 bool stopJob(api::JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage)
override;
167 bool suspendJob(api::JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage)
override;
178 Error submitJob(api::JobPtr io_job,
bool& out_wasInvalidRequest)
const override;
193 api::OutputType in_outputType,
195 api::AbstractOutputStream::OnOutput in_onOutput,
197 api::AbstractOutputStream::OnError in_onError,
198 api::OutputStreamPtr& out_outputStream)
override;
210 api::ConstJobPtr in_job,
211 comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator,
212 api::AbstractResourceStreamPtr& out_resourceStream)
override;
216 const std::string m_hostname;
219 std::shared_ptr<LocalJobRunner> m_jobRunner;
Represents the network information for a job.
Definition: ResponseTypes.hpp:129
Error createResourceStream(api::ConstJobPtr in_job, comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator, api::AbstractResourceStreamPtr &out_resourceStream) override
Creates a resource utilization metric stream for the specified job.
Error getNetworkInfo(api::JobPtr in_job, api::NetworkInfo &out_networkInfo) const override
Gets the network information for the specified job.
bool stopJob(api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override
Stops a running job.
Class which represents a system user.
Definition: User.hpp:55
Error getConfiguration(const system::User &, api::JobSourceConfiguration &out_configuration) const override
Gets the configuration and capabilities of the Local Job Source.
std::function< void(uint64_t)> OnComplete
Definition: AbstractOutputStream.hpp:66
Error submitJob(api::JobPtr io_job, bool &out_wasInvalidRequest) const override
Runs a job on the local instance.
bool cancelJob(api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override
Cancels a pending job.
Class which represents an error.
Definition: Error.hpp:174
bool resumeJob(api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override
Resumes a suspended job.
Describes the capabilities and configuration of this Job Source.
Definition: IJobSource.hpp:77
Class which is responsible for running and retrieving information about jobs on the Local system.
Definition: LocalJobSource.hpp:46
Generic interface for communicating with a Job Source. Implementation is plugin specific.
Definition: IJobSource.hpp:99
Error initialize() override
Initializes the Local Job Source.
bool killJob(api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override
Forcibly kills a running job.
bool suspendJob(api::JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage) override
Suspends a running job.
LocalJobSource(std::string in_hostname, jobs::JobStatusNotifierPtr in_jobStatusNotifier, std::shared_ptr< LocalJobRepository > in_jobRepository)
Constructor.
Error createOutputStream(api::OutputType in_outputType, api::JobPtr in_job, api::AbstractOutputStream::OnOutput in_onOutput, api::AbstractOutputStream::OnComplete in_onComplete, api::AbstractOutputStream::OnError in_onError, api::OutputStreamPtr &out_outputStream) override
Creates a file output stream for the specified job.