7 #ifndef HOOKS_MANAGER_H
8 #define HOOKS_MANAGER_H
13 #include <boost/noncopyable.hpp>
14 #include <boost/shared_ptr.hpp>
38 class LibraryManagerCollection;
254 const std::vector<std::string>& libraries);
291 static void park(
const std::string& hook_name, T parked_object,
292 std::function<
void()> unpark_callback) {
294 getParkingLotPtr(hook_name)->park(parked_object, unpark_callback);
308 static bool unpark(
const std::string& hook_name, T parked_object) {
310 getParkingLotPtr(hook_name)->
unpark(parked_object,
true));
320 static bool drop(
const std::string& hook_name, T parked_object) {
322 getParkingLotPtr(hook_name)->
drop(parked_object));
335 static void reference(
const std::string& hook_name, T parked_object) {
337 getParkingLotPtr(hook_name)->reference(parked_object);
390 std::string validateLibrariesInternal(
391 const std::vector<std::string>& libraries)
const;
408 bool unloadLibrariesInternal();
411 void prepareUnloadLibrariesInternal();
419 bool calloutsPresentInternal(
int index);
430 bool commandHandlersPresentInternal(
const std::string& command_name);
447 void callCommandHandlersInternal(
const std::string& command_name,
453 boost::shared_ptr<CalloutHandle> createCalloutHandleInternal();
470 std::vector<std::string> getLibraryNamesInternal()
const;
482 boost::shared_ptr<LibraryManagerCollection> lm_collection_;
487 boost::shared_ptr<CalloutManager> callout_manager_;
499 #endif // HOOKS_MANAGER_H
LibrariesStillOpened(const char *file, size_t line, const char *what)
static LibraryHandle & preCalloutsLibraryHandle()
Return pre-callouts library handle.
static const int CONTEXT_CREATE
Index numbers for pre-defined hooks.
static ServerHooks & getServerHooks()
Return ServerHooks object.
static void prepareUnloadLibraries()
Prepare the unloading of libraries.
static void callCallouts(int index, CalloutHandle &handle)
Calls the callouts for a given hook.
static int registerHook(const std::string &name)
Register Hook.
static void clearParkingLots()
Clears any parking packets.
static HookLibsCollection getLibraryInfo()
Return list of loaded libraries with its parameters.
static bool calloutsPresent(int index)
Are callouts present?
static void setTestMode(bool mode)
Set test mode.
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
static bool unloadLibraries()
Unload libraries.
static void reference(const std::string &hook_name, T parked_object)
Increases reference counter for the parked object.
static const int CONTEXT_DESTROY
Per-packet callout handle.
static bool getTestMode()
Get test mode.
static bool loadLibraries(const HookLibsCollection &libraries)
Load and reload libraries.
static void park(const std::string &hook_name, T parked_object, std::function< void()> unpark_callback)
Park an object (packet).
static bool unpark(const std::string &hook_name, T parked_object)
Forces unparking the object (packet).
static void callCommandHandlers(const std::string &command_name, CalloutHandle &handle)
Calls the callouts/command handlers for a given command name.
static const int CONTEXT_DESTROY
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.
static const int CONTEXT_CREATE
Index numbers for pre-defined hooks.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries)
Validate library list.
static boost::shared_ptr< CalloutHandle > createCalloutHandle()
Return callout handle.
ParkingLotsPtr getParkingLotsPtr() const
Returns pointer to all parking lots.
static std::vector< std::string > getLibraryNames()
Return list of loaded libraries.
static bool drop(const std::string &hook_name, T parked_object)
Removes parked object without calling a callback.
static LibraryHandle & postCalloutsLibraryHandle()
Return post-callouts library handle.
static bool commandHandlersPresent(const std::string &command_name)
Checks if control command handlers are present for the specified command.