Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
ETLServiceInterface.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2025, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "etl/ETLState.hpp"
23
24#include <boost/json/object.hpp>
25
26#include <cstdint>
27#include <optional>
28
29namespace etlng {
30
37 virtual ~ETLServiceInterface() = default;
38
42 virtual void
43 run() = 0;
44
49 virtual void
50 stop() = 0;
51
57 [[nodiscard]] virtual boost::json::object
58 getInfo() const = 0;
59
65 [[nodiscard]] virtual bool
66 isAmendmentBlocked() const = 0;
67
73 [[nodiscard]] virtual bool
75
80 [[nodiscard]] virtual std::optional<etl::ETLState>
81 getETLState() const = 0;
82
88 [[nodiscard]] virtual std::uint32_t
90};
91
92} // namespace etlng
This is a base class for any ETL service implementations.
Definition ETLServiceInterface.hpp:36
virtual boost::json::object getInfo() const =0
Get state of ETL as a JSON object.
virtual bool isAmendmentBlocked() const =0
Check for the amendment blocked state.
virtual void run()=0
Start all components to run ETL service.
virtual bool isCorruptionDetected() const =0
Check whether Clio detected DB corruptions.
virtual std::uint32_t lastCloseAgeSeconds() const =0
Get time passed since last ledger close, in seconds.
virtual std::optional< etl::ETLState > getETLState() const =0
Get the etl nodes' state.
virtual void stop()=0
Stop the ETL service.