Kea 2.7.6
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.
 
virtual ~ControlSocketBase ()=default
 Destructor (does nothing).
 
virtual data::ConstElementPtr configGet (const std::string &service)=0
 Get configuration.
 
virtual data::ConstElementPtr configSet (data::ElementPtr config, const std::string &service)=0
 Set configuration.
 
virtual data::ConstElementPtr configTest (data::ElementPtr config, const std::string &service)=0
 Test configuration.
 
const std::string getName () const
 Returns the Unix socket name.
 
CfgControlSocket::Type getType () const
 Getter which returns the socket type.
 
const isc::http::Url getUrl () const
 Returns the HTTP server URL.
 

Public Attributes

CfgControlSocketPtr socket_cfg_
 The control socket configuration.
 

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 33 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 ( )
virtualdefault

Destructor (does nothing).

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::HttpControlSocket, isc::netconf::StdoutControlSocket, and isc::netconf::UnixControlSocket.

◆ configSet()

virtual data::ConstElementPtr isc::netconf::ControlSocketBase::configSet ( data::ElementPtr 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::HttpControlSocket, isc::netconf::StdoutControlSocket, and isc::netconf::UnixControlSocket.

◆ configTest()

virtual data::ConstElementPtr isc::netconf::ControlSocketBase::configTest ( data::ElementPtr 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::HttpControlSocket, isc::netconf::StdoutControlSocket, 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 59 of file control_socket.h.

References socket_cfg_.

◆ 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 52 of file control_socket.h.

References socket_cfg_.

◆ 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 66 of file control_socket.h.

References socket_cfg_.

Member Data Documentation

◆ socket_cfg_

CfgControlSocketPtr isc::netconf::ControlSocketBase::socket_cfg_

The control socket configuration.

Definition at line 102 of file control_socket.h.

Referenced by getName(), getType(), and getUrl().


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