Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
MigrationApplication.hpp
1#pragma once
2
3#include "data/LedgerCache.hpp"
4#include "migration/MigrationManagerInterface.hpp"
5#include "util/config/ConfigDefinition.hpp"
6
7#include <memory>
8#include <string>
9#include <variant>
10
11namespace app {
12
20 struct Status {};
24 struct Migration {
25 std::string migratorName;
26 };
27
28 std::variant<Status, Migration> state;
29
35 static MigrateSubCmd
37 {
38 return MigrateSubCmd{Status{}};
39 }
40
47 static MigrateSubCmd
48 migration(std::string const& name)
49 {
50 return MigrateSubCmd{Migration{name}};
51 }
52};
53
58 std::string option_;
59 std::shared_ptr<migration::MigrationManagerInterface> migrationManager_;
60 MigrateSubCmd cmd_;
61 data::LedgerCache cache_;
62
63public:
71
77 int
78 run();
79
80private:
81 int
82 printStatus();
83
84 int
85 migrate(std::string const& name);
86};
87} // namespace app
MigratorApplication(util::config::ClioConfigDefinition const &config, MigrateSubCmd command)
Construct a new MigratorApplication object.
Definition MigrationApplication.cpp:20
int run()
Run the application.
Definition MigrationApplication.cpp:40
Cache for an entire ledger.
Definition LedgerCache.hpp:30
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:31
Run a migration.
Definition MigrationApplication.hpp:24
Check the status of the migrations.
Definition MigrationApplication.hpp:20
The command to run for migration framework.
Definition MigrationApplication.hpp:16
static MigrateSubCmd migration(std::string const &name)
Helper function to create a migration command.
Definition MigrationApplication.hpp:48
static MigrateSubCmd status()
Helper function to create a status command.
Definition MigrationApplication.hpp:36