OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BFD::RESTClient Class Reference

#include <bfd_rest_client.h>

Collaboration diagram for BFD::RESTClient:

Public Types

typedef boost::function< void(boost::system::error_code)> AddBFDHostCb
 
typedef boost::function< void(boost::system::error_code)> DeleteBFDHostCb
 
typedef boost::function< void(const
REST::JsonState &state,
boost::system::error_code)> 
GetSessionCb
 
typedef boost::function< void(const
REST::JsonStateMap &new_states,
boost::system::error_code)> 
MonitorCb
 

Public Member Functions

 RESTClient (const boost::asio::ip::tcp::endpoint &ep, EventManager *evm)
 
virtual ~RESTClient ()
 
void Init ()
 
void Stop ()
 
bool AddBFDHost (const boost::asio::ip::address &remote_address, AddBFDHostCb cb)
 
bool DeleteBFDHost (const boost::asio::ip::address &remote_address, DeleteBFDHostCb cb)
 
bool GetSession (const boost::asio::ip::address &remote_address, GetSessionCb cb)
 
bool Monitor (MonitorCb cb)
 
bool is_initialized ()
 
bool IsStopped ()
 

Private Member Functions

void CreateRESTClientSessionCallback (const std::string &response, const boost::system::error_code &ec)
 
void SetError ()
 
bool is_initialized_non_locking ()
 

Static Private Member Functions

static void CreateSessionCallback (const std::string &response, const boost::system::error_code &ec, HttpConnection *connection, AddBFDHostCb cb)
 
static void DeleteSessionCallback (const std::string &response, const boost::system::error_code &ec, HttpConnection *connection, DeleteBFDHostCb cb)
 
static void GetBFDConnectionCallback (const std::string &response, const boost::system::error_code &ec, HttpConnection *connection, GetSessionCb cb)
 
static void MonitorCallback (const std::string &response, const boost::system::error_code &ec, HttpConnection *connection, MonitorCb cb)
 

Private Attributes

HttpClienthttp_client_
 
boost::asio::ip::tcp::endpoint ep_
 
HttpConnectionlong_poll_connection_
 
boost::optional< ClientIdclient_id_
 
bool error_
 
tbb::mutex mutex_
 
tbb::interface5::condition_variable cond_var_
 
bool stopped_
 

Static Private Attributes

static const REST::JsonConfig kDefaultConfig
 

Detailed Description

Definition at line 20 of file bfd_rest_client.h.

Member Typedef Documentation

typedef boost::function<void(boost::system::error_code)> BFD::RESTClient::AddBFDHostCb

Definition at line 22 of file bfd_rest_client.h.

typedef boost::function<void(boost::system::error_code)> BFD::RESTClient::DeleteBFDHostCb

Definition at line 23 of file bfd_rest_client.h.

typedef boost::function<void(const REST::JsonState &state, boost::system::error_code)> BFD::RESTClient::GetSessionCb

Definition at line 25 of file bfd_rest_client.h.

typedef boost::function<void(const REST::JsonStateMap &new_states, boost::system::error_code)> BFD::RESTClient::MonitorCb

Definition at line 27 of file bfd_rest_client.h.

Constructor & Destructor Documentation

BFD::RESTClient::RESTClient ( const boost::asio::ip::tcp::endpoint &  ep,
EventManager evm 
)

Definition at line 23 of file bfd_rest_client.cc.

BFD::RESTClient::~RESTClient ( )
virtual

Definition at line 29 of file bfd_rest_client.cc.

Here is the call graph for this function:

Member Function Documentation

bool BFD::RESTClient::AddBFDHost ( const boost::asio::ip::address &  remote_address,
AddBFDHostCb  cb 
)

Definition at line 76 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::CreateRESTClientSessionCallback ( const std::string &  response,
const boost::system::error_code &  ec 
)
private

Definition at line 192 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::CreateSessionCallback ( const std::string &  response,
const boost::system::error_code &  ec,
HttpConnection connection,
AddBFDHostCb  cb 
)
staticprivate

Definition at line 139 of file bfd_rest_client.cc.

Here is the call graph for this function:

bool BFD::RESTClient::DeleteBFDHost ( const boost::asio::ip::address &  remote_address,
DeleteBFDHostCb  cb 
)

Definition at line 94 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::DeleteSessionCallback ( const std::string &  response,
const boost::system::error_code &  ec,
HttpConnection connection,
DeleteBFDHostCb  cb 
)
staticprivate

Definition at line 154 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::GetBFDConnectionCallback ( const std::string &  response,
const boost::system::error_code &  ec,
HttpConnection connection,
GetSessionCb  cb 
)
staticprivate

Definition at line 169 of file bfd_rest_client.cc.

Here is the call graph for this function:

bool BFD::RESTClient::GetSession ( const boost::asio::ip::address &  remote_address,
GetSessionCb  cb 
)

Definition at line 110 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::Init ( )

Definition at line 44 of file bfd_rest_client.cc.

Here is the call graph for this function:

bool BFD::RESTClient::is_initialized ( )

Definition at line 39 of file bfd_rest_client.cc.

Here is the call graph for this function:

bool BFD::RESTClient::is_initialized_non_locking ( )
private

Definition at line 35 of file bfd_rest_client.cc.

bool BFD::RESTClient::IsStopped ( )
bool BFD::RESTClient::Monitor ( MonitorCb  cb)

Definition at line 125 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::MonitorCallback ( const std::string &  response,
const boost::system::error_code &  ec,
HttpConnection connection,
MonitorCb  cb 
)
staticprivate

Definition at line 220 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::SetError ( )
private

Definition at line 71 of file bfd_rest_client.cc.

Here is the call graph for this function:

void BFD::RESTClient::Stop ( )

Definition at line 61 of file bfd_rest_client.cc.

Here is the call graph for this function:

Member Data Documentation

boost::optional<ClientId> BFD::RESTClient::client_id_
private

Definition at line 72 of file bfd_rest_client.h.

tbb::interface5::condition_variable BFD::RESTClient::cond_var_
private

Definition at line 75 of file bfd_rest_client.h.

boost::asio::ip::tcp::endpoint BFD::RESTClient::ep_
private

Definition at line 70 of file bfd_rest_client.h.

bool BFD::RESTClient::error_
private

Definition at line 73 of file bfd_rest_client.h.

HttpClient* BFD::RESTClient::http_client_
private

Definition at line 69 of file bfd_rest_client.h.

const REST::JsonConfig BFD::RESTClient::kDefaultConfig
staticprivate

Definition at line 61 of file bfd_rest_client.h.

HttpConnection* BFD::RESTClient::long_poll_connection_
private

Definition at line 71 of file bfd_rest_client.h.

tbb::mutex BFD::RESTClient::mutex_
private

Definition at line 74 of file bfd_rest_client.h.

bool BFD::RESTClient::stopped_
private

Definition at line 76 of file bfd_rest_client.h.


The documentation for this class was generated from the following files: