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

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. More...
 

Additional Inherited Members

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

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.

References toElement().

Referenced by toElement().

+ Here is the call graph for this function:

◆ 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 getDescription(), and getServerTagAsText().

Referenced by getDescription().

+ Here is the call graph for this function:

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