Kea  2.3.2-git
isc::netconf::ControlSocketBase Class Referenceabstract

Base class for control socket communication. More...

#include <control_socket.h>

+ Inheritance diagram for isc::netconf::ControlSocketBase:

Public Member Functions

 ControlSocketBase (CfgControlSocketPtr ctrl_sock)
 Constructor. More...
 
virtual ~ControlSocketBase ()
 Destructor (does nothing). More...
 
virtual data::ConstElementPtr configGet (const std::string &service)=0
 Get configuration. More...
 
virtual data::ConstElementPtr configSet (data::ConstElementPtr config, const std::string &service)=0
 Set configuration. More...
 
virtual data::ConstElementPtr configTest (data::ConstElementPtr config, const std::string &service)=0
 Test configuration. More...
 
const std::string getName () const
 Returns the Unix socket name. More...
 
CfgControlSocket::Type getType () const
 Getter which returns the socket type. More...
 
const isc::http::Url getUrl () const
 Returns the HTTP server URL. More...
 

Public Attributes

CfgControlSocketPtr socket_cfg_
 The control socket configuration. More...
 

Detailed Description

Base class for control socket communication.

This class is the base class for control socket communication. Derived classes implement config-get, config-test and config-set using control sockets of different types. Those classes are used to communicate with other Kea daemons.

Definition at line 32 of file control_socket.h.

Constructor & Destructor Documentation

◆ ControlSocketBase()

isc::netconf::ControlSocketBase::ControlSocketBase ( CfgControlSocketPtr  ctrl_sock)
inline

Constructor.

Parameters
ctrl_sockThe control socket configuration.
Exceptions
ControlSocketErrorif ctrl_sock is null.

Definition at line 39 of file control_socket.h.

References isc_throw.

◆ ~ControlSocketBase()

virtual isc::netconf::ControlSocketBase::~ControlSocketBase ( )
inlinevirtual

Destructor (does nothing).

Definition at line 47 of file control_socket.h.

Member Function Documentation

◆ configGet()

virtual data::ConstElementPtr isc::netconf::ControlSocketBase::configGet ( const std::string &  service)
pure virtual

Get configuration.

Call config-get over the control socket.

Parameters
serviceThe target service (used by http).
Returns
The JSON element answer of config-get.
Exceptions
ControlSocketErrorwhen a communication error occurs.

Implemented in isc::netconf::StdoutControlSocket, isc::netconf::HttpControlSocket, and isc::netconf::UnixControlSocket.

◆ configSet()

virtual data::ConstElementPtr isc::netconf::ControlSocketBase::configSet ( data::ConstElementPtr  config,
const std::string &  service 
)
pure virtual

Set configuration.

Call config-set over the control socket.

Parameters
configThe configuration to set.
serviceThe target service (used by http).
Returns
The JSON element answer of config-set.
Exceptions
ControlSocketErrorwhen a communication error occurs.

Implemented in isc::netconf::StdoutControlSocket, isc::netconf::HttpControlSocket, and isc::netconf::UnixControlSocket.

◆ configTest()

virtual data::ConstElementPtr isc::netconf::ControlSocketBase::configTest ( data::ConstElementPtr  config,
const std::string &  service 
)
pure virtual

Test configuration.

Call config-test over the control socket.

Parameters
configThe configuration to test.
serviceThe target service (used by http).
Returns
The JSON element answer of config-test.
Exceptions
ControlSocketErrorwhen a communication error occurs.

Implemented in isc::netconf::StdoutControlSocket, isc::netconf::HttpControlSocket, and isc::netconf::UnixControlSocket.

◆ getName()

const std::string isc::netconf::ControlSocketBase::getName ( ) const
inline

Returns the Unix socket name.

Returns
returns the Unix socket name as a std::string.

Definition at line 60 of file control_socket.h.

Referenced by isc::netconf::UnixControlSocket::configSet().

◆ getType()

CfgControlSocket::Type isc::netconf::ControlSocketBase::getType ( ) const
inline

Getter which returns the socket type.

Returns
returns the socket type as a CfgControlSocket::Type.

Definition at line 53 of file control_socket.h.

◆ getUrl()

const isc::http::Url isc::netconf::ControlSocketBase::getUrl ( ) const
inline

Returns the HTTP server URL.

Returns
returns the HTTP server URL as an isc::http::Url.

Definition at line 67 of file control_socket.h.

Referenced by isc::netconf::HttpControlSocket::configSet().

Member Data Documentation

◆ socket_cfg_

CfgControlSocketPtr isc::netconf::ControlSocketBase::socket_cfg_

The control socket configuration.

Definition at line 103 of file control_socket.h.


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