rippled
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ripple::ServerHandlerImp Class Reference
Collaboration diagram for ripple::ServerHandlerImp:
Collaboration graph
[legend]

Classes

struct  Setup
 

Public Types

using Output = Json::Output
 

Public Member Functions

 ServerHandlerImp (Application &app, boost::asio::io_service &io_service, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
 
 ~ServerHandlerImp ()
 
void setup (Setup const &setup, beast::Journal journal)
 
Setup const & setup () const
 
void stop ()
 
bool onAccept (Session &session, boost::asio::ip::tcp::endpoint endpoint)
 
Handoff onHandoff (Session &session, std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
 
Handoff onHandoff (Session &session, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
 
void onRequest (Session &session)
 
void onWSMessage (std::shared_ptr< WSSession > session, std::vector< boost::asio::const_buffer > const &buffers)
 
void onClose (Session &session, boost::system::error_code const &)
 
void onStopped (Server &)
 

Private Types

using socket_type = boost::beast::tcp_stream
 
using stream_type = boost::beast::ssl_stream< socket_type >
 

Private Member Functions

Json::Value processSession (std::shared_ptr< WSSession > const &session, std::shared_ptr< JobQueue::Coro > const &coro, Json::Value const &jv)
 
void processSession (std::shared_ptr< Session > const &, std::shared_ptr< JobQueue::Coro > coro)
 
void processRequest (Port const &port, std::string const &request, beast::IP::Endpoint const &remoteIPAddress, Output &&, std::shared_ptr< JobQueue::Coro > coro, boost::string_view forwardedFor, boost::string_view user)
 
Handoff statusResponse (http_request_type const &request) const
 

Private Attributes

Applicationapp_
 
Resource::Managerm_resourceManager
 
beast::Journal m_journal
 
NetworkOPsm_networkOPs
 
std::unique_ptr< Serverm_server
 
Setup setup_
 
JobQueuem_jobQueue
 
beast::insight::Counter rpc_requests_
 
beast::insight::Event rpc_size_
 
beast::insight::Event rpc_time_
 
std::mutex mutex_
 
std::condition_variable condition_
 
bool stopped_ {false}
 
std::map< std::reference_wrapper< Port const >, int > count_
 

Detailed Description

Definition at line 47 of file ServerHandlerImp.h.

Member Typedef Documentation

◆ socket_type

using ripple::ServerHandlerImp::socket_type = boost::beast::tcp_stream
private

Definition at line 89 of file ServerHandlerImp.h.

◆ stream_type

using ripple::ServerHandlerImp::stream_type = boost::beast::ssl_stream<socket_type>
private

Definition at line 90 of file ServerHandlerImp.h.

◆ Output

Definition at line 118 of file ServerHandlerImp.h.

Constructor & Destructor Documentation

◆ ServerHandlerImp()

ripple::ServerHandlerImp::ServerHandlerImp ( Application app,
boost::asio::io_service &  io_service,
JobQueue jobQueue,
NetworkOPs networkOPs,
Resource::Manager resourceManager,
CollectorManager cm 
)

Definition at line 104 of file ServerHandlerImp.cpp.

◆ ~ServerHandlerImp()

ripple::ServerHandlerImp::~ServerHandlerImp ( )

Definition at line 124 of file ServerHandlerImp.cpp.

Member Function Documentation

◆ setup() [1/2]

void ripple::ServerHandlerImp::setup ( Setup const &  setup,
beast::Journal  journal 
)

Definition at line 130 of file ServerHandlerImp.cpp.

◆ setup() [2/2]

Setup const& ripple::ServerHandlerImp::setup ( ) const

Definition at line 124 of file ServerHandlerImp.h.

◆ stop()

void ripple::ServerHandlerImp::stop ( )

Definition at line 139 of file ServerHandlerImp.cpp.

◆ onAccept()

bool ripple::ServerHandlerImp::onAccept ( Session session,
boost::asio::ip::tcp::endpoint  endpoint 
)

Definition at line 151 of file ServerHandlerImp.cpp.

◆ onHandoff() [1/2]

Handoff ripple::ServerHandlerImp::onHandoff ( Session session,
std::unique_ptr< stream_type > &&  bundle,
http_request_type &&  request,
boost::asio::ip::tcp::endpoint const &  remote_address 
)

Definition at line 173 of file ServerHandlerImp.cpp.

◆ onHandoff() [2/2]

Handoff ripple::ServerHandlerImp::onHandoff ( Session session,
http_request_type &&  request,
boost::asio::ip::tcp::endpoint const &  remote_address 
)

Definition at line 147 of file ServerHandlerImp.h.

◆ onRequest()

void ripple::ServerHandlerImp::onRequest ( Session session)

Definition at line 275 of file ServerHandlerImp.cpp.

◆ onWSMessage()

void ripple::ServerHandlerImp::onWSMessage ( std::shared_ptr< WSSession session,
std::vector< boost::asio::const_buffer > const &  buffers 
)

Definition at line 315 of file ServerHandlerImp.cpp.

◆ onClose()

void ripple::ServerHandlerImp::onClose ( Session session,
boost::system::error_code const &   
)

Definition at line 365 of file ServerHandlerImp.cpp.

◆ onStopped()

void ripple::ServerHandlerImp::onStopped ( Server )

Definition at line 372 of file ServerHandlerImp.cpp.

◆ processSession() [1/2]

Json::Value ripple::ServerHandlerImp::processSession ( std::shared_ptr< WSSession > const &  session,
std::shared_ptr< JobQueue::Coro > const &  coro,
Json::Value const &  jv 
)
private

Definition at line 401 of file ServerHandlerImp.cpp.

◆ processSession() [2/2]

void ripple::ServerHandlerImp::processSession ( std::shared_ptr< Session > const &  session,
std::shared_ptr< JobQueue::Coro coro 
)
private

Definition at line 548 of file ServerHandlerImp.cpp.

◆ processRequest()

void ripple::ServerHandlerImp::processRequest ( Port const &  port,
std::string const &  request,
beast::IP::Endpoint const &  remoteIPAddress,
Output &&  output,
std::shared_ptr< JobQueue::Coro coro,
boost::string_view  forwardedFor,
boost::string_view  user 
)
private

Clear header-assigned values if not positively identified from a secure_gateway.

Definition at line 589 of file ServerHandlerImp.cpp.

◆ statusResponse()

Handoff ripple::ServerHandlerImp::statusResponse ( http_request_type const &  request) const
private

Definition at line 1025 of file ServerHandlerImp.cpp.

Member Data Documentation

◆ app_

Application& ripple::ServerHandlerImp::app_
private

Definition at line 92 of file ServerHandlerImp.h.

◆ m_resourceManager

Resource::Manager& ripple::ServerHandlerImp::m_resourceManager
private

Definition at line 93 of file ServerHandlerImp.h.

◆ m_journal

beast::Journal ripple::ServerHandlerImp::m_journal
private

Definition at line 94 of file ServerHandlerImp.h.

◆ m_networkOPs

NetworkOPs& ripple::ServerHandlerImp::m_networkOPs
private

Definition at line 95 of file ServerHandlerImp.h.

◆ m_server

std::unique_ptr<Server> ripple::ServerHandlerImp::m_server
private

Definition at line 96 of file ServerHandlerImp.h.

◆ setup_

Setup ripple::ServerHandlerImp::setup_
private

Definition at line 97 of file ServerHandlerImp.h.

◆ m_jobQueue

JobQueue& ripple::ServerHandlerImp::m_jobQueue
private

Definition at line 98 of file ServerHandlerImp.h.

◆ rpc_requests_

beast::insight::Counter ripple::ServerHandlerImp::rpc_requests_
private

Definition at line 99 of file ServerHandlerImp.h.

◆ rpc_size_

beast::insight::Event ripple::ServerHandlerImp::rpc_size_
private

Definition at line 100 of file ServerHandlerImp.h.

◆ rpc_time_

beast::insight::Event ripple::ServerHandlerImp::rpc_time_
private

Definition at line 101 of file ServerHandlerImp.h.

◆ mutex_

std::mutex ripple::ServerHandlerImp::mutex_
private

Definition at line 102 of file ServerHandlerImp.h.

◆ condition_

std::condition_variable ripple::ServerHandlerImp::condition_
private

Definition at line 103 of file ServerHandlerImp.h.

◆ stopped_

bool ripple::ServerHandlerImp::stopped_ {false}
private

Definition at line 104 of file ServerHandlerImp.h.

◆ count_

std::map<std::reference_wrapper<Port const>, int> ripple::ServerHandlerImp::count_
private

Definition at line 105 of file ServerHandlerImp.h.