![]() |
Kea
1.5.0
|
Server selector for associating objects in a database with specific servers. More...
#include <server_selector.h>
Public Types | |
| enum | Type { Type::UNASSIGNED, Type::ALL, Type::SUBSET } |
| Type of the server selection. More... | |
Public Member Functions | |
| bool | amUnassigned () const |
| Convenience method checking if the server selector is "unassigned". More... | |
| std::set< std::string > | getTags () const |
| Returns tags associated with the selector. More... | |
| Type | getType () const |
| Returns type of the selector. More... | |
Static Public Member Functions | |
| static ServerSelector & | ALL () |
| Factory returning "all servers" selector. More... | |
| static ServerSelector & | MULTIPLE (const std::set< std::string > &server_tags) |
| Factory returning "multiple servers" selector. More... | |
| static ServerSelector & | ONE (const std::string &server_tag) |
| Factory returning selector of one server. More... | |
| static ServerSelector & | UNASSIGNED () |
| Factory returning "unassigned" server selector. More... | |
Server selector for associating objects in a database with specific servers.
Configuration information stored in the configuration backends can be associated with selected servers, all servers or no particular server. For example: a particular subnet definition in the database may be associated with one server or can be shared by multiple servers. In the latter case, a subnet may be associated with a subset of servers or all servers. An administrator may also add the configuration data into the database and do not associate this data with any patrticular server.
When fetching the configuration data from a databse or when storing data in the database there is a need to specify which servers this data is associated with. The ServerSelector class represents such associations.
It includes three modes of selection: UNASSIGNED, ALL and SUBSET and several factory functions making associations described above.
The ServerSelector class should be used in objects derived from BaseConfigBackendPool and in objects derived from BaseConfigBackend to indicate which servers the specific calls exposed by these objects refer to.
Definition at line 45 of file server_selector.h.
|
strong |
Type of the server selection.
| Enumerator | |
|---|---|
| UNASSIGNED | |
| ALL | |
| SUBSET | |
Definition at line 49 of file server_selector.h.
|
inlinestatic |
Factory returning "all servers" selector.
Definition at line 62 of file server_selector.h.
References ALL.
|
inline |
Convenience method checking if the server selector is "unassigned".
Definition at line 99 of file server_selector.h.
References getType(), and UNASSIGNED.
Here is the call graph for this function:
|
inline |
Returns tags associated with the selector.
Definition at line 92 of file server_selector.h.
|
inline |
Returns type of the selector.
Definition at line 84 of file server_selector.h.
Referenced by amUnassigned().
|
inlinestatic |
Factory returning "multiple servers" selector.
| server_tags | set of server tags to be selected. |
Definition at line 78 of file server_selector.h.
|
inlinestatic |
Factory returning selector of one server.
| server_tag | tag of the single server to be selected. |
Definition at line 70 of file server_selector.h.
|
inlinestatic |
Factory returning "unassigned" server selector.
Definition at line 56 of file server_selector.h.
References UNASSIGNED.