Kea 2.7.5
user_data_source.h
Go to the documentation of this file.
1// Copyright (C) 2013-2024 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#ifndef _USER_DATA_SOURCE_H
7#define _USER_DATA_SOURCE_H
8
11#include <user.h>
12
13namespace user_chk {
14
17public:
18 UserDataSourceError(const char* file, size_t line,
19 const char* what) :
20 isc::Exception(file, line, what) { }
21};
22
27public:
30
32 virtual ~UserDataSource() {};
33
40 virtual void open() = 0;
41
48 virtual UserPtr readNextUser() = 0;
49
55 virtual void close() = 0;
56
63 virtual bool isOpen() const = 0;
64};
65
67typedef boost::shared_ptr<UserDataSource> UserDataSourcePtr;
68
69} // namespace user_chk
70
71#endif
This is a base class for exceptions thrown from the DNS library module.
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Thrown if UserDataSource encounters an error.
UserDataSourceError(const char *file, size_t line, const char *what)
Defines an interface for reading user data into a registry.
virtual bool isOpen() const =0
Returns true if the data source is open.
virtual ~UserDataSource()
Virtual Destructor.
virtual void close()=0
Closes that data source.
virtual void open()=0
Opens the data source.
virtual UserPtr readNextUser()=0
Fetches the next user from the data source.
Defines the logger used by the top-level component of kea-lfc.
Defines the logger used by the user check hooks library.
Definition user.cc:19
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
Definition user.h:241
boost::shared_ptr< UserDataSource > UserDataSourcePtr
Defines a smart pointer to a UserDataSource.
This file defines classes: UserId and User.