Kea 2.5.9
isc::netconf::StdoutControlSocket Class Reference

Class for control socket communication over stdout. More...

#include <stdout_control_socket.h>

+ Inheritance diagram for isc::netconf::StdoutControlSocket:

Public Member Functions

 StdoutControlSocket (CfgControlSocketPtr ctrl_sock)
 Constructor.
 
virtual ~StdoutControlSocket ()=default
 Destructor (does nothing).
 
data::ConstElementPtr configGet (const std::string &service) override final
 Get configuration.
 
data::ConstElementPtr configSet (data::ElementPtr config, const std::string &service) override final
 Set configuration.
 
data::ConstElementPtr configTest (data::ElementPtr config, const std::string &service) override final
 Test configuration.
 
- Public Member Functions inherited from isc::netconf::ControlSocketBase
 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.
 

Protected Member Functions

 StdoutControlSocket (CfgControlSocketPtr ctrl_sock, std::ostream &output)
 Alternative constructor for tests.
 

Protected Attributes

std::ostream & output_
 The output stream (std::cout outside tests).
 

Additional Inherited Members

- Public Attributes inherited from isc::netconf::ControlSocketBase
CfgControlSocketPtr socket_cfg_
 The control socket configuration.
 

Detailed Description

Class for control socket communication over stdout.

This class is the derived class for control socket communication over stdout. This class implements config-test (always OK) and config-set.

Definition at line 24 of file stdout_control_socket.h.

Constructor & Destructor Documentation

◆ StdoutControlSocket() [1/2]

isc::netconf::StdoutControlSocket::StdoutControlSocket ( CfgControlSocketPtr  ctrl_sock)

Constructor.

Use std::cout.

Parameters
ctrl_sockThe control socket configuration.

Definition at line 29 of file stdout_control_socket.cc.

◆ ~StdoutControlSocket()

virtual isc::netconf::StdoutControlSocket::~StdoutControlSocket ( )
virtualdefault

Destructor (does nothing).

◆ StdoutControlSocket() [2/2]

isc::netconf::StdoutControlSocket::StdoutControlSocket ( CfgControlSocketPtr  ctrl_sock,
std::ostream &  output 
)
protected

Alternative constructor for tests.

Parameters
ctrl_sockThe control socket configuration.
outputThe output stream.

Definition at line 33 of file stdout_control_socket.cc.

Member Function Documentation

◆ configGet()

ConstElementPtr isc::netconf::StdoutControlSocket::configGet ( const std::string &  service)
finaloverridevirtual

Get configuration.

Call config-get over the control socket.

Parameters
serviceThe target service (ignored).
Returns
The JSON element answer of config-get.
Exceptions
NotImplemented

Implements isc::netconf::ControlSocketBase.

Definition at line 39 of file stdout_control_socket.cc.

References isc_throw.

◆ configSet()

ConstElementPtr isc::netconf::StdoutControlSocket::configSet ( data::ElementPtr  config,
const std::string &  service 
)
finaloverridevirtual

Set configuration.

Call config-set over the control socket.

Parameters
configThe configuration to set.
serviceThe target service.
Returns
The JSON element answer of config-set (fixed answer).

Implements isc::netconf::ControlSocketBase.

Definition at line 50 of file stdout_control_socket.cc.

References isc::config::createAnswer(), output_, and isc::data::prettyPrint().

+ Here is the call graph for this function:

◆ configTest()

ConstElementPtr isc::netconf::StdoutControlSocket::configTest ( data::ElementPtr  config,
const std::string &  service 
)
finaloverridevirtual

Test configuration.

Call config-test over the control socket.

Parameters
configThe configuration to test (ignored).
serviceThe target service (ignored).
Returns
The JSON element answer of config-test (fixed answer).

Implements isc::netconf::ControlSocketBase.

Definition at line 44 of file stdout_control_socket.cc.

References isc::config::createAnswer().

+ Here is the call graph for this function:

Member Data Documentation

◆ output_

std::ostream& isc::netconf::StdoutControlSocket::output_
protected

The output stream (std::cout outside tests).

Definition at line 73 of file stdout_control_socket.h.

Referenced by configSet().


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