Kea 2.7.6
isc::netconf::CfgControlSocket Class Reference

Represents a Control Socket. More...

#include <netconf_config.h>

+ Inheritance diagram for isc::netconf::CfgControlSocket:

Public Types

enum  Type { UNIX , HTTP , STDOUT }
 Defines the list of possible control socket types. More...
 

Public Member Functions

 CfgControlSocket (Type type, const std::string &name, const isc::http::Url &url)
 Constructor.
 
virtual ~CfgControlSocket ()=default
 Destructor (doing nothing).
 
const std::string getName () const
 Getter which returns the Unix socket name.
 
Type getType () const
 Getter which returns the socket type.
 
const isc::http::Url getUrl () const
 Getter which returns the HTTP server URL.
 
isc::data::ElementPtr toElement () const override final
 Unparse a configuration object.
 
- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object.
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context.
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context.
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor.
 

Static Public Member Functions

static Type stringToType (const std::string &type)
 Converts socket type name to CfgControlSocket::Type.
 
static const std::string typeToString (CfgControlSocket::Type type)
 Converts CfgControlSocket::Type to string.
 
- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy an Element map.
 

Additional Inherited Members

- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL)
 

Detailed Description

Represents a Control Socket.

Acts as a storage class containing the basic attributes which describe a Control Socket.

Definition at line 69 of file netconf_config.h.

Member Enumeration Documentation

◆ Type

Defines the list of possible control socket types.

Enumerator
UNIX 
HTTP 
STDOUT 

Definition at line 73 of file netconf_config.h.

Constructor & Destructor Documentation

◆ CfgControlSocket()

isc::netconf::CfgControlSocket::CfgControlSocket ( Type type,
const std::string & name,
const isc::http::Url & url )

Constructor.

Parameters
typeThe socket type.
nameThe Unix socket name.
urlThe HTTP server URL.

Definition at line 27 of file netconf_config.cc.

◆ ~CfgControlSocket()

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

Destructor (doing nothing).

Member Function Documentation

◆ getName()

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

Getter which returns the Unix socket name.

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

Definition at line 100 of file netconf_config.h.

◆ getType()

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

Getter which returns the socket type.

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

Definition at line 93 of file netconf_config.h.

Referenced by isc::netconf::controlSocketFactory().

◆ getUrl()

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

Getter which returns the HTTP server URL.

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

Definition at line 107 of file netconf_config.h.

◆ stringToType()

CfgControlSocket::Type isc::netconf::CfgControlSocket::stringToType ( const std::string & type)
static

Converts socket type name to CfgControlSocket::Type.

Parameters
typeThe type name. Currently supported values are "unix", "http" and "stdout".
Returns
The CfgControlSocket::Type corresponding to the type name.
Exceptions
BadValueif the type name isn't recognized.

Definition at line 33 of file netconf_config.cc.

References HTTP, isc_throw, STDOUT, and UNIX.

Referenced by isc::netconf::ControlSocketConfigParser::parse().

◆ toElement()

ElementPtr isc::netconf::CfgControlSocket::toElement ( ) const
finaloverridevirtual

Unparse a configuration object.

Returns
a pointer to a configuration

Implements isc::data::CfgToElement.

Definition at line 60 of file netconf_config.cc.

References isc::data::UserContext::contextToElement(), isc::data::Element::create(), isc::data::Element::createMap(), isc::http::Url::toText(), and typeToString().

+ Here is the call graph for this function:

◆ typeToString()

const string isc::netconf::CfgControlSocket::typeToString ( CfgControlSocket::Type type)
static

Converts CfgControlSocket::Type to string.

Parameters
typeThe CfgControlSocket::Type type.
Returns
The type name corresponding to the enumeration element.

Definition at line 46 of file netconf_config.cc.

References HTTP, isc_throw, STDOUT, and UNIX.

Referenced by toElement().


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