Kea: isc::netconf::ControlSocketBase Class Reference

| Kea 3.0.0

isc::netconf::ControlSocketBase Class Referenceabstract

Base class for control socket communication. More...

`#include <control_socket.h>`

Inheritance diagram for isc::netconf::ControlSocketBase:
[legend]

## 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_sock | The control socket configuration.

Exceptions

  ControlSocketError | if ctrl_sock is null.

Definition at line 39 of file control_socket.h.

References isc_throw, and socket_cfg_.

Referenced by isc::netconf::HttpControlSocket::HttpControlSocket(), isc::netconf::StdoutControlSocket::StdoutControlSocket(), isc::netconf::StdoutControlSocket::StdoutControlSocket(), and isc::netconf::UnixControlSocket::UnixControlSocket().

## ◆ ~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

  service | The target service (used by http).

Returns
  The JSON element answer of config-get.

Exceptions

  ControlSocketError | when a communication error occurs.

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

Referenced by isc::netconf::NetconfAgent::keaConfig().

## ◆ 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

  config | The configuration to set.
  service | The target service (used by http).

Returns
  The JSON element answer of config-set.

Exceptions

  ControlSocketError | when a communication error occurs.

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

Referenced by isc::netconf::NetconfAgent::done(), and isc::netconf::NetconfAgent::yangConfig().

## ◆ 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

  config | The configuration to test.
  service | The target service (used by http).

Returns
  The JSON element answer of config-test.

Exceptions

  ControlSocketError | when a communication error occurs.

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

Referenced by isc::netconf::NetconfAgent::change().

## ◆ 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 ControlSocketBase(), getName(), getType(), and getUrl().

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

- control_socket.h