27 if ((found_user =
findUser(user->getUserId()))) {
29 << user->getUserId());
32 users_[user->getUserId()] = user;
38 UserMap::const_iterator it = users_.find(
id);
39 if (it != users_.end()) {
40 const UserPtr tmp = (*it).second;
41 return ((*it).second);
50 UserMap::iterator it = users_.find(
id);
51 if (it != users_.end()) {
71 "UserRegistry: cannot refresh, no data source");
75 if (!source_->isOpen()) {
86 while ((user = source_->readNextUser())) {
89 }
catch (
const std::exception& ex) {
109 "UserRegistry: data source cannot be set to null");
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Holds DUID (DHCPv6 Unique Identifier)
const std::vector< uint8_t > & getDuid() const
Returns a const reference to the actual DUID value.
Encapsulates a unique identifier for a DHCP client.
@ HW_ADDRESS
Hardware addresses (MAC) are used for IPv4 clients.
@ DUID
DUIDs are used for IPv6 clients.
Thrown UserRegistry encounters an error.
~UserRegistry()
Destructor.
const UserPtr & findUser(const UserId &id) const
Finds a user in the registry by user id.
void clearall()
Removes all entries from the registry.
void setSource(UserDataSourcePtr &source)
Sets the data source to the given value.
UserRegistry()
Constructor.
void refresh()
Updates the registry from its data source.
void removeUser(const UserId &id)
Removes a user from the registry by user id.
void addUser(UserPtr &user)
Adds a given user to the registry.
const UserDataSourcePtr & getSource()
Returns a reference to the data source.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Defines the logger used by the user check hooks library.
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
boost::shared_ptr< UserDataSource > UserDataSourcePtr
Defines a smart pointer to a UserDataSource.
std::map< UserId, UserPtr > UserMap
Defines a map of unique Users keyed by UserId.
Hardware type that represents information from DHCPv4 packet.
std::vector< uint8_t > hwaddr_
This file defines classes: UserId and User.
Defines the class, UserRegistry.