xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
resource
ResourceManager.h
1
#pragma once
2
3
#include <xrpl/beast/insight/Collector.h>
4
#include <xrpl/beast/net/IPEndpoint.h>
5
#include <xrpl/beast/utility/Journal.h>
6
#include <xrpl/beast/utility/PropertyStream.h>
7
#include <xrpl/json/json_value.h>
8
#include <xrpl/resource/Consumer.h>
9
#include <xrpl/resource/Gossip.h>
10
11
#include <boost/utility/string_view.hpp>
12
13
#include <
memory
>
14
#include <
string
>
15
#include <
string_view
>
16
17
namespace
xrpl::resource
{
18
22
class
Manager
:
public
beast::PropertyStream::Source
23
{
24
protected
:
25
Manager
();
26
27
public
:
28
~Manager
()
override
= 0;
29
34
virtual
Consumer
35
newInboundEndpoint
(
beast::ip::Endpoint
const
& address) = 0;
36
virtual
Consumer
37
newInboundEndpoint
(
38
beast::ip::Endpoint
const
& address,
39
bool
const
proxy,
40
std::string_view
forwardedFor
) = 0;
41
45
virtual
Consumer
46
newOutboundEndpoint
(
beast::ip::Endpoint
const
& address) = 0;
47
51
virtual
Consumer
52
newUnlimitedEndpoint
(
beast::ip::Endpoint
const
& address) = 0;
53
57
virtual
Gossip
58
exportConsumers
() = 0;
59
63
virtual
json::Value
64
getJson
() = 0;
65
virtual
json::Value
66
getJson
(
int
threshold) = 0;
67
72
virtual
void
73
importConsumers
(
std::string
const
& origin,
Gossip
const
& gossip) = 0;
74
};
75
76
//------------------------------------------------------------------------------
77
78
std::unique_ptr<Manager>
79
makeManager
(
beast::insight::Collector::Ptr
const
& collector,
beast::Journal
journal);
80
81
}
// namespace xrpl::resource
std::string
std::string_view
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
beast::PropertyStream::Source
Subclasses can be called to write to a stream and have children.
Definition
PropertyStream.h:315
beast::insight::Collector::Ptr
std::shared_ptr< Collector > Ptr
Definition
Collector.h:29
beast::ip::Endpoint
A version-independent IP address and port combination.
Definition
IPEndpoint.h:24
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::resource::Consumer
An endpoint that consumes resources.
Definition
Consumer.h:20
xrpl::resource::Manager::Manager
Manager()
Definition
ResourceManager.cpp:153
xrpl::resource::Manager::newOutboundEndpoint
virtual Consumer newOutboundEndpoint(beast::ip::Endpoint const &address)=0
Create a new endpoint keyed by outbound IP address and port.
xrpl::resource::Manager::importConsumers
virtual void importConsumers(std::string const &origin, Gossip const &gossip)=0
Import packaged consumer information.
xrpl::resource::Manager::newInboundEndpoint
virtual Consumer newInboundEndpoint(beast::ip::Endpoint const &address, bool const proxy, std::string_view forwardedFor)=0
xrpl::resource::Manager::newInboundEndpoint
virtual Consumer newInboundEndpoint(beast::ip::Endpoint const &address)=0
Create a new endpoint keyed by inbound IP address or the forwarded IP if proxied.
xrpl::resource::Manager::getJson
virtual json::Value getJson()=0
Extract consumer information for reporting.
xrpl::resource::Manager::newUnlimitedEndpoint
virtual Consumer newUnlimitedEndpoint(beast::ip::Endpoint const &address)=0
Create a new unlimited endpoint keyed by forwarded IP.
xrpl::resource::Manager::getJson
virtual json::Value getJson(int threshold)=0
xrpl::resource::Manager::exportConsumers
virtual Gossip exportConsumers()=0
Extract packaged consumer information for export.
xrpl::resource::Manager::~Manager
~Manager() override=0
memory
xrpl::resource
Definition
ServiceRegistry.h:21
xrpl::resource::makeManager
std::unique_ptr< Manager > makeManager(beast::insight::Collector::Ptr const &collector, beast::Journal journal)
Definition
ResourceManager.cpp:162
xrpl::forwardedFor
std::string_view forwardedFor(HttpRequestType const &request)
Definition
Role.cpp:251
string
string_view
xrpl::resource::Gossip
Data format for exchanging consumption information across peers.
Definition
Gossip.h:13
std::unique_ptr
Generated by
1.17.0