FOSSredder 0.5.0
Loading...
Searching...
No Matches
StatementImportJobSystem.h
Go to the documentation of this file.
1
5
6#pragma once
7
10
11#include <cstddef>
12#include <cstdint>
13#include <map>
14#include <memory>
15#include <optional>
16#include <string>
17#include <vector>
18
19namespace core::domain {
20class Statement;
21}
22
26
27namespace core::jobs {
28class JobSystem;
29}
30
32
33class IImportStatement;
34
36 std::string sourcePath;
37 std::string runRoot;
38 std::string runIdPrefix;
39};
40
42public:
44 std::shared_ptr<IImportStatement> importService,
45 std::shared_ptr<core::ports::diagnostics::IErrorReporter> errorReporter,
46 std::size_t workers = 0);
48 std::shared_ptr<IImportStatement> importService,
49 std::shared_ptr<core::jobs::JobSystem> jobSystem);
51
56
57 [[nodiscard]] core::jobs::JobId startImportStatement(const ImportStatementJobSpec& spec);
58
59 [[nodiscard]] core::jobs::SubscriptionId subscribe(
60 const core::jobs::JobId& id,
61 core::jobs::JobEventCallback cb);
62 void unsubscribe(const core::jobs::JobId& id, core::jobs::SubscriptionId subId);
63
64 void cancel(const core::jobs::JobId& id);
65 void pause(const core::jobs::JobId& id);
66 void resume(const core::jobs::JobId& id);
67
68 [[nodiscard]] std::optional<core::jobs::JobSnapshot> snapshot(const core::jobs::JobId& id) const;
69 [[nodiscard]] std::shared_ptr<core::domain::Statement> statementResult(const core::jobs::JobId& id) const;
70 [[nodiscard]] std::vector<draft::TransactionDraft> statementTransactions(const core::jobs::JobId& id) const;
71 [[nodiscard]] std::map<std::string, std::vector<std::uint8_t>> takeStatementArtifacts(const core::jobs::JobId& id);
72
73 void shutdown();
74
75private:
76 class Impl;
77 std::unique_ptr<Impl> impl_;
78};
79
80} // namespace core::application::importing
Defines shared job identifiers, states, events, and snapshots.
Draft transaction model used by import finalization and core application flow.
void unsubscribe(const core::jobs::JobId &id, core::jobs::SubscriptionId subId)
std::map< std::string, std::vector< std::uint8_t > > takeStatementArtifacts(const core::jobs::JobId &id)
core::jobs::SubscriptionId subscribe(const core::jobs::JobId &id, core::jobs::JobEventCallback cb)
StatementImportJobSystem(const StatementImportJobSystem &)=delete
core::jobs::JobId startImportStatement(const ImportStatementJobSpec &spec)
std::optional< core::jobs::JobSnapshot > snapshot(const core::jobs::JobId &id) const
std::shared_ptr< core::domain::Statement > statementResult(const core::jobs::JobId &id) const
StatementImportJobSystem(StatementImportJobSystem &&) noexcept
StatementImportJobSystem & operator=(const StatementImportJobSystem &)=delete
StatementImportJobSystem(std::shared_ptr< IImportStatement > importService, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter, std::size_t workers=0)
std::vector< draft::TransactionDraft > statementTransactions(const core::jobs::JobId &id) const
Port for reporting structured diagnostic error events.