Kea 2.7.5
|
This class represents configuration element which is associated with database identifier, modification timestamp and servers. More...
#include <stamped_element.h>
Public Member Functions | |
StampedElement () | |
Constructor. | |
void | delServerTag (const std::string &server_tag) |
Deletes server tag. | |
isc::data::ElementPtr | getMetadata () const |
Returns an object representing metadata to be returned with objects from the configuration backend. | |
std::set< ServerTag > | getServerTags () const |
Returns server tags. | |
bool | hasAllServerTag () const |
Checks if the element has 'all' server tag. | |
bool | hasServerTag (const ServerTag &server_tag) const |
Checks if the element has the given server tag. | |
void | setServerTag (const std::string &server_tag) |
Adds new server tag. | |
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 ×tamp) |
Sets timestamp to the explicitly provided value. | |
void | updateModificationTime () |
Sets timestamp to the current time. | |
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. | |
This class represents configuration element which is associated with database identifier, modification timestamp and servers.
Classes storing Kea configuration should derive from this object to track ids and modification times of the configuration objects. This is specifically required by the Kea Configuration Backend feature which stores and fetches configuration from the database. The configuration elements must be accessible by their database identifiers and modification times.
Element
and should not be confused with the classes being derived from Element
class. Those classes are used to represent JSON structures, whereas this class represents data fetched from the database.StampedElement
. Definition at line 34 of file stamped_element.h.
isc::data::StampedElement::StampedElement | ( | ) |
void isc::data::StampedElement::delServerTag | ( | const std::string & | server_tag | ) |
Deletes server tag.
Remove the first occurrence of the given server tag.
server_tag | server tag to delete. |
NotFound | if the server tag cannot be found. |
Definition at line 24 of file stamped_element.cc.
References isc_throw.
ElementPtr isc::data::StampedElement::getMetadata | ( | ) | const |
Returns an object representing metadata to be returned with objects from the configuration backend.
Definition at line 37 of file stamped_element.cc.
References isc::data::Element::create(), isc::data::Element::createList(), and isc::data::Element::createMap().
|
inline |
bool isc::data::StampedElement::hasAllServerTag | ( | ) | const |
Checks if the element has 'all' server tag.
Definition at line 31 of file stamped_element.cc.
References isc::data::ServerTag::ALL, and hasServerTag().
bool isc::data::StampedElement::hasServerTag | ( | const ServerTag & | server_tag | ) | const |
Checks if the element has the given server tag.
server_tag | Server tag to be found. |
Definition at line 19 of file stamped_element.cc.
Referenced by hasAllServerTag().
|
inline |
Adds new server tag.
server_tag | new server tag. |
BadValue | if the server tag length exceeds 256 characters. |
Definition at line 46 of file stamped_element.h.