Kea 2.7.4
isc::db::Server Class Reference

Represents information about a Kea server in the database. More...

#include <server.h>

+ Inheritance diagram for isc::db::Server:

Public Member Functions

 Server (const data::ServerTag &tag, const std::string &description)
 Constructor.
 
std::string getDescription () const
 Returns the description of the server.
 
data::ServerTag getServerTag () const
 Returns server tag.
 
std::string getServerTagAsText () const
 Returns server tag as text.
 
virtual data::ElementPtr toElement () const
 Unparses server object.
 
- Public Member Functions inherited from isc::data::BaseStampedElement
 BaseStampedElement ()
 Constructor.
 
uint64_t getId () const
 Returns element's database identifier.
 
boost::posix_time::ptime getModificationTime () const
 Returns timestamp.
 
void setId (const uint64_t id)
 Sets element's database identifier.
 
void setModificationTime (const boost::posix_time::ptime &timestamp)
 Sets timestamp to the explicitly provided value.
 
void updateModificationTime ()
 Sets timestamp to the current time.
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor.
 

Static Public Member Functions

static ServerPtr create (const data::ServerTag &tag, const std::string &description="")
 Factory function to be used to create an instance of the Server object.
 

Additional Inherited Members

- Protected Attributes inherited from isc::data::BaseStampedElement
uint64_t id_
 Database identifier of the configuration element.
 
boost::posix_time::ptime timestamp_
 Holds timestamp value.
 

Detailed Description

Represents information about a Kea server in the database.

The configuration backend holds the information about the servers for which the backend holds the configuration information. The information includes the server tag (unique name), server description provided by the administrator and the metadata.

This class extends the base class with the server description field.

Definition at line 32 of file server.h.

Constructor & Destructor Documentation

◆ Server()

isc::db::Server::Server ( const data::ServerTag & tag,
const std::string & description )

Constructor.

Parameters
tagserver tag.
descriptionserver description.

Definition at line 19 of file server.cc.

References isc_throw.

Member Function Documentation

◆ create()

ServerPtr isc::db::Server::create ( const data::ServerTag & tag,
const std::string & description = "" )
static

Factory function to be used to create an instance of the Server object.

Parameters
tagserver tag.
descriptionserver description.
Returns
Pointer to the server instance.
Exceptions
BadValueif the server tag exceeds 256 characters or the description exceeds 65536 characters.

Definition at line 29 of file server.cc.

◆ getDescription()

std::string isc::db::Server::getDescription ( ) const
inline

Returns the description of the server.

Returns
Description of the server or an empty string if no description was specified.

Definition at line 69 of file server.h.

Referenced by toElement().

◆ getServerTag()

data::ServerTag isc::db::Server::getServerTag ( ) const
inline

Returns server tag.

Definition at line 54 of file server.h.

◆ getServerTagAsText()

std::string isc::db::Server::getServerTagAsText ( ) const
inline

Returns server tag as text.

Returns
Server tag as text.

Definition at line 61 of file server.h.

References isc::data::ServerTag::get().

Referenced by toElement().

+ Here is the call graph for this function:

◆ toElement()

ElementPtr isc::db::Server::toElement ( ) const
virtual

Unparses server object.

Returns
A pointer to unparsed server configuration.

Implements isc::data::CfgToElement.

Definition at line 34 of file server.cc.

References isc::data::Element::create(), isc::data::Element::createMap(), getDescription(), and getServerTagAsText().

+ Here is the call graph for this function:

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