Kea  1.5.0
isc::ha::CommandCreator Class Reference

Holds a collection of functions which generate commands used for High Availability. More...

#include <command_creator.h>

Static Public Member Functions

static data::ConstElementPtr createDHCPDisable (const unsigned int max_period, const HAServerType &server_type)
 Creates dhcp-disable command for DHCP server. More...
 
static data::ConstElementPtr createDHCPEnable (const HAServerType &server_type)
 Creates dhcp-enable command for DHCP server. More...
 
static data::ConstElementPtr createHeartbeat (const HAServerType &server_type)
 Creates ha-heartbeat command for DHCP server. More...
 
static data::ConstElementPtr createLease4Delete (const dhcp::Lease4 &lease4)
 Creates lease4-del command. More...
 
static data::ConstElementPtr createLease4GetAll ()
 Creates lease4-get-all command. More...
 
static data::ConstElementPtr createLease4GetPage (const dhcp::Lease4Ptr &lease4, const uint32_t limit)
 Creates lease4-get-page command. More...
 
static data::ConstElementPtr createLease4Update (const dhcp::Lease4 &lease4)
 Creates lease4-update command. More...
 
static data::ConstElementPtr createLease6Delete (const dhcp::Lease6 &lease6)
 Creates lease6-del command. More...
 
static data::ConstElementPtr createLease6GetAll ()
 Creates lease6-get-all command. More...
 
static data::ConstElementPtr createLease6GetPage (const dhcp::Lease6Ptr &lease6, const uint32_t limit)
 Creates lease6-get-page command. More...
 
static data::ConstElementPtr createLease6Update (const dhcp::Lease6 &lease6)
 Creates lease6-update command. More...
 

Detailed Description

Holds a collection of functions which generate commands used for High Availability.

Definition at line 20 of file command_creator.h.

Member Function Documentation

◆ createDHCPDisable()

ConstElementPtr isc::ha::CommandCreator::createDHCPDisable ( const unsigned int  max_period,
const HAServerType server_type 
)
static

Creates dhcp-disable command for DHCP server.

Returns
Pointer to the JSON representation of the command.

Definition at line 21 of file command_creator.cc.

References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().

+ Here is the call graph for this function:

◆ createDHCPEnable()

ConstElementPtr isc::ha::CommandCreator::createDHCPEnable ( const HAServerType server_type)
static

Creates dhcp-enable command for DHCP server.

Returns
Pointer to the JSON representation of the command.

Definition at line 35 of file command_creator.cc.

References isc::config::createCommand().

+ Here is the call graph for this function:

◆ createHeartbeat()

ConstElementPtr isc::ha::CommandCreator::createHeartbeat ( const HAServerType server_type)
static

Creates ha-heartbeat command for DHCP server.

Returns
Pointer to the JSON representation of the command.

Definition at line 42 of file command_creator.cc.

References isc::config::createCommand().

+ Here is the call graph for this function:

◆ createLease4Delete()

ConstElementPtr isc::ha::CommandCreator::createLease4Delete ( const dhcp::Lease4 lease4)
static

Creates lease4-del command.

Parameters
lease4Reference to a lease for which the command should be created.
Returns
Pointer to the JSON representation of the command.

Definition at line 59 of file command_creator.cc.

References isc::config::createCommand(), and isc::dhcp::Lease4::toElement().

Referenced by isc::ha::HAService::asyncSendLeaseUpdates().

+ Here is the call graph for this function:

◆ createLease4GetAll()

ConstElementPtr isc::ha::CommandCreator::createLease4GetAll ( )
static

Creates lease4-get-all command.

Returns
Pointer to the JSON representation of the command.

Definition at line 68 of file command_creator.cc.

References isc::config::createCommand().

+ Here is the call graph for this function:

◆ createLease4GetPage()

ConstElementPtr isc::ha::CommandCreator::createLease4GetPage ( const dhcp::Lease4Ptr lease4,
const uint32_t  limit 
)
static

Creates lease4-get-page command.

Parameters
lease4Pointer to the last lease returned on the previous page of leases. This lease is used to set the value of the "from" parameter in the lease4-get-page command. If this command is sent to fetch the first page, the lease4 parameter should be set to null.
limitLimit of leases on the page.
Returns
Pointer to the JSON representation of the command.

Definition at line 75 of file command_creator.cc.

References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createMap(), and isc_throw.

+ Here is the call graph for this function:

◆ createLease4Update()

ConstElementPtr isc::ha::CommandCreator::createLease4Update ( const dhcp::Lease4 lease4)
static

Creates lease4-update command.

It adds "force-create" parameter to the lease information to force the remote server to create the lease if it doesn't exist in its lease database.

Parameters
lease4Reference to a lease for which the command should be created.
Returns
Pointer to the JSON representation of the command.

Definition at line 49 of file command_creator.cc.

References isc::data::Element::create(), isc::config::createCommand(), and isc::dhcp::Lease4::toElement().

Referenced by isc::ha::HAService::asyncSendLeaseUpdates().

+ Here is the call graph for this function:

◆ createLease6Delete()

ConstElementPtr isc::ha::CommandCreator::createLease6Delete ( const dhcp::Lease6 lease6)
static

Creates lease6-del command.

Parameters
lease6Reference to a lease for which the command should be created.
Returns
Pointer to the JSON representation of the command.

Definition at line 110 of file command_creator.cc.

References isc::config::createCommand(), and isc::dhcp::Lease6::toElement().

Referenced by isc::ha::HAService::asyncSendLeaseUpdates().

+ Here is the call graph for this function:

◆ createLease6GetAll()

ConstElementPtr isc::ha::CommandCreator::createLease6GetAll ( )
static

Creates lease6-get-all command.

Returns
Pointer to the JSON representation of the command.

Definition at line 119 of file command_creator.cc.

References isc::config::createCommand().

+ Here is the call graph for this function:

◆ createLease6GetPage()

ConstElementPtr isc::ha::CommandCreator::createLease6GetPage ( const dhcp::Lease6Ptr lease6,
const uint32_t  limit 
)
static

Creates lease6-get-page command.

Parameters
lease6Pointer to the last lease returned on the previous page of leases. This lease is used to set the value of the "from" parameter in the lease6-get-page command. If this command is sent to fetch the first page, the lease6 parameter should be set to null.
limitLimit of leases on the page.
Returns
Pointer to the JSON representation of the command.

Definition at line 126 of file command_creator.cc.

References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createMap(), and isc_throw.

+ Here is the call graph for this function:

◆ createLease6Update()

ConstElementPtr isc::ha::CommandCreator::createLease6Update ( const dhcp::Lease6 lease6)
static

Creates lease6-update command.

It adds "force-create" parameter to the lease information to force the remote server to create the lease if it doesn't exist in its lease database.

Parameters
lease6Reference to a lease for which the command should be created.
Returns
Pointer to the JSON representation of the command.

Definition at line 100 of file command_creator.cc.

References isc::data::Element::create(), isc::config::createCommand(), and isc::dhcp::Lease6::toElement().

Referenced by isc::ha::HAService::asyncSendLeaseUpdates().

+ Here is the call graph for this function:

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