Kea  1.9.9-git
server.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef DB_SERVER_H
8 #define DB_SERVER_H
9 
11 #include <cc/cfg_to_element.h>
12 #include <cc/server_tag.h>
13 #include <boost/shared_ptr.hpp>
14 #include <string>
15 
16 namespace isc {
17 namespace db {
18 
19 class Server;
20 
22 typedef boost::shared_ptr<Server> ServerPtr;
23 
33 public:
34 
39  Server(const data::ServerTag& tag, const std::string& description);
40 
50  static ServerPtr create(const data::ServerTag& tag,
51  const std::string& description = "");
52 
55  return (server_tag_);
56  }
57 
61  std::string getServerTagAsText() const {
62  return (server_tag_.get());
63  }
64 
69  std::string getDescription() const {
70  return (description_);
71  }
72 
76  virtual data::ElementPtr toElement() const;
77 
78 private:
79 
81  data::ServerTag server_tag_;
82 
84  std::string description_;
85 };
86 
87 } // end of namespace isc::db
88 } // end of namespace isc
89 
90 #endif // DB_SERVER_H
data::ServerTag getServerTag() const
Returns server tag.
Definition: server.h:54
std::string get() const
Returns server tag as string.
Definition: server_tag.h:51
std::string getServerTagAsText() const
Returns server tag as text.
Definition: server.h:61
boost::shared_ptr< Server > ServerPtr
Shared pointer to the Server class.
Definition: server.h:19
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
Server(const data::ServerTag &tag, const std::string &description)
Constructor.
Definition: server.cc:19
std::string getDescription() const
Returns the description of the server.
Definition: server.h:69
Represents a server tag.
Definition: server_tag.h:25
Abstract class for configuration Cfg_* classes.
Defines the logger used by the top-level component of kea-dhcp-ddns.
static ServerPtr create(const data::ServerTag &tag, const std::string &description="")
Factory function to be used to create an instance of the Server object.
Definition: server.cc:29
This class represents configuration element which is associated with database identifier and the modi...
virtual data::ElementPtr toElement() const
Unparses server object.
Definition: server.cc:34
Represents information about a Kea server in the database.
Definition: server.h:32