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

Protected Member Functions

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

Protected Attributes

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

Additional Inherited Members

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

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

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

Constructor.

Use std::cout.

Parameters
ctrl_sockThe control socket configuration.

Definition at line 27 of file stdout_control_socket.cc.

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

Destructor (does nothing).

Definition at line 36 of file stdout_control_socket.cc.

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 31 of file stdout_control_socket.cc.

Member Function Documentation

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

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 40 of file stdout_control_socket.cc.

References isc_throw.

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

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 51 of file stdout_control_socket.cc.

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

+ Here is the call graph for this function:

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

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 45 of file stdout_control_socket.cc.

References isc::config::createAnswer().

+ Here is the call graph for this function:

Member Data Documentation

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

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

Definition at line 74 of file stdout_control_socket.h.

Referenced by configSet().


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