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");
const std::vector< uint8_t > & getDuid() const
Returns a const reference to the actual DUID value.
void setSource(UserDataSourcePtr &source)
Sets the data source to the given value.
void refresh()
Updates the registry from its data source.
const UserDataSourcePtr & getSource()
Returns a reference to the data source.
Encapsulates a unique identifier for a DHCP client.
const UserPtr & findUser(const UserId &id) const
Finds a user in the registry by user id.
std::vector< uint8_t > hwaddr_
void addUser(UserPtr &user)
Adds a given user to the registry.
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
Holds DUID (DHCPv6 Unique Identifier)
Defines the logger used by the user check hooks library.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
This file defines classes: UserId and User.
UserRegistry()
Constructor.
void clearall()
Removes all entries from the registry.
std::map< UserId, UserPtr > UserMap
Defines a map of unique Users keyed by UserId.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
~UserRegistry()
Destructor.
void removeUser(const UserId &id)
Removes a user from the registry by user id.
boost::shared_ptr< UserDataSource > UserDataSourcePtr
Defines a smart pointer to a UserDataSource.
Hardware addresses (MAC) are used for IPv4 clients.
Hardware type that represents information from DHCPv4 packet.
Defines the class, UserRegistry.
Thrown UserRegistry encounters an error.
DUIDs are used for IPv6 clients.