| Kea 3.0.2-git

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
10#include <exceptions/exceptions.h>
11#include <user.h>
12
13 namespace user_chk {
14
16 class UserDataSourceError : public isc::Exception {
17 public:
18 UserDataSourceError(const char* file, size_t line,
19 const char* what) :
20 isc::Exception(file, line, what) { }
21};
22
26 class UserDataSource {
27 public:
29 UserDataSource() {};
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
67 typedef boost::shared_ptr<UserDataSource> UserDataSourcePtr;
68
69} // namespace user_chk
70
71#endif
isc::Exception
This is a base class for exceptions thrown from the DNS library module.
Definition exceptions/exceptions.h:23
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
user_chk::UserDataSourceError::UserDataSourceError
UserDataSourceError(const char *file, size_t line, const char *what)
Definition user_data_source.h:18
user_chk::UserDataSource::isOpen
virtual bool isOpen() const =0
Returns true if the data source is open.
user_chk::UserDataSource::~UserDataSource
virtual ~UserDataSource()
Virtual Destructor.
Definition user_data_source.h:32
user_chk::UserDataSource::close
virtual void close()=0
Closes that data source.
user_chk::UserDataSource::UserDataSource
UserDataSource()
Constructor.
Definition user_data_source.h:29
user_chk::UserDataSource::open
virtual void open()=0
Opens the data source.
user_chk::UserDataSource::readNextUser
virtual UserPtr readNextUser()=0
Fetches the next user from the data source.
exceptions.h
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
user_chk
Defines the logger used by the user check hooks library.
Definition user.cc:19
user_chk::UserPtr
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
Definition user.h:241
user_chk::UserDataSourcePtr
boost::shared_ptr< UserDataSource > UserDataSourcePtr
Defines a smart pointer to a UserDataSource.
Definition user_data_source.h:67
user.h
This file defines classes: UserId and User.