Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
HandlerProvider.hpp
1
#pragma once
2
3
#include "data/AmendmentCenterInterface.hpp"
4
#include "data/BackendInterface.hpp"
5
#include "etl/ETLServiceInterface.hpp"
6
#include "
etl/LoadBalancerInterface.hpp
"
7
#include "feed/SubscriptionManagerInterface.hpp"
8
#include "rpc/common/AnyHandler.hpp"
9
#include "rpc/common/HandlerProvider.hpp"
10
#include "rpc/common/Types.hpp"
11
#include "util/log/Logger.hpp"
12
13
#include <memory>
14
#include <optional>
15
#include <string>
16
#include <unordered_map>
17
#include <unordered_set>
18
19
namespace
rpc
{
20
class
Counters
;
21
}
// namespace rpc
22
23
namespace
rpc::impl {
24
25
class
ProductionHandlerProvider final :
public
HandlerProvider
{
26
struct
Handler {
27
AnyHandler
handler;
28
bool
isClioOnly
=
false
;
29
};
30
31
std::unordered_map<std::string, Handler> handlerMap_;
32
33
public
:
34
ProductionHandlerProvider(
35
util::config::ClioConfigDefinition
const
& config,
36
std::shared_ptr<BackendInterface>
const
& backend,
37
std::shared_ptr<feed::SubscriptionManagerInterface>
const
& subscriptionManager,
38
std::shared_ptr<etl::LoadBalancerInterface>
const
& balancer,
39
std::shared_ptr<etl::ETLServiceInterface const>
const
& etl,
40
std::shared_ptr<data::AmendmentCenterInterface const>
const
& amendmentCenter,
41
Counters
const
& counters
42
);
43
44
[[nodiscard]]
bool
45
contains
(std::string
const
& command)
const override
;
46
47
[[nodiscard]] std::optional<AnyHandler>
48
getHandler
(std::string
const
& command)
const override
;
49
50
[[nodiscard]]
bool
51
isClioOnly
(std::string
const
& command)
const override
;
52
53
[[nodiscard]] std::unordered_set<std::string>
54
handlerNames()
const
;
55
};
56
57
}
// namespace rpc::impl
LoadBalancerInterface.hpp
rpc::AnyHandler
A type-erased Handler that can contain any (NextGen) RPC handler class.
Definition
AnyHandler.hpp:20
rpc::Counters
Holds information about successful, failed, forwarded, etc. RPC handler calls.
Definition
Counters.hpp:22
rpc::HandlerProvider
Interface for the provider of RPC handlers.
Definition
HandlerProvider.hpp:13
rpc::impl::ProductionHandlerProvider::getHandler
std::optional< AnyHandler > getHandler(std::string const &command) const override
Get the handler for a given method.
Definition
HandlerProvider.cpp:60
rpc::impl::ProductionHandlerProvider::contains
bool contains(std::string const &command) const override
Check if the provider contains a handler for a given method.
Definition
HandlerProvider.cpp:54
rpc::impl::ProductionHandlerProvider::isClioOnly
bool isClioOnly(std::string const &command) const override
Check if a given method is Clio-only.
Definition
HandlerProvider.cpp:69
util::config::ClioConfigDefinition
All the config data will be stored and extracted from this class.
Definition
ConfigDefinition.hpp:31
rpc
This namespace contains all the RPC logic and handlers.
Definition
AMMHelpers.cpp:17
src
rpc
common
impl
HandlerProvider.hpp
Generated by
1.17.0