Kea  1.9.9-git
user_data_source.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015 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 
17 public:
18  UserDataSourceError(const char* file, size_t line,
19  const char* what) :
20  isc::Exception(file, line, what) { };
21 };
22 
27 public:
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
UserDataSourceError(const char *file, size_t line, const char *what)
virtual bool isOpen() const =0
Returns true if the data source is open.
virtual UserPtr readNextUser()=0
Fetches the next user from the data source.
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
Definition: user.h:241
Thrown if UserDataSource encounters an error.
Defines the logger used by the user check hooks library.
Definition: user.cc:19
This file defines classes: UserId and User.
virtual ~UserDataSource()
Virtual Destructor.
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 void close()=0
Closes that data source.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< UserDataSource > UserDataSourcePtr
Defines a smart pointer to a UserDataSource.
UserDataSource()
Constructor.
Defines an interface for reading user data into a registry.
virtual void open()=0
Opens the data source.