Parcourir la source

[5330] Renamed registerCommandHandler to registerCommandCallout.

This was a result of the review.
Marcin Siodelski il y a 7 ans
Parent
commit
3b62c5558a

+ 1 - 1
src/lib/config/hooked_command_mgr.h

@@ -21,7 +21,7 @@ namespace config {
 /// command handlers for the control API.
 ///
 /// The command handlers are registered by a hook library by calling
-/// @ref isc::hooks::LibraryHandle::registerCommandHandler. This call
+/// @ref isc::hooks::LibraryHandle::registerCommandCallout. This call
 /// creates a hook point for this command (if one doesn't exist) and then
 /// registeres the specified handler(s). When the @ref HookedCommandMgr
 /// receives a command for processing it calls the

+ 2 - 2
src/lib/config/tests/command_mgr_unittests.cc

@@ -316,7 +316,7 @@ TEST_F(CommandMgrTest, processCommand) {
 TEST_F(CommandMgrTest, delegateProcessCommand) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
-    HooksManager::preCalloutsLibraryHandle().registerCommandHandler(
+    HooksManager::preCalloutsLibraryHandle().registerCommandCallout(
         "my-command", control_command_receive_handle_callout);
 
     // Install local handler
@@ -357,7 +357,7 @@ TEST_F(CommandMgrTest, delegateProcessCommand) {
 TEST_F(CommandMgrTest, delegateListCommands) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
-    HooksManager::preCalloutsLibraryHandle().registerCommandHandler(
+    HooksManager::preCalloutsLibraryHandle().registerCommandCallout(
         "my-command", control_command_receive_handle_callout);
 
     // Create my-command-bis which is unique for the local Command Manager,

+ 2 - 2
src/lib/hooks/callout_manager.h

@@ -119,11 +119,11 @@ public:
 ///
 /// The @ref CalloutManager::registerCommandHook has been added to allow for
 /// dynamically creating hook points for which command handlers are registered.
-/// This method is called from the @ref LibraryHandle::registerCommandHandler
+/// This method is called from the @ref LibraryHandle::registerCommandCallout
 /// as a result of registering the command handlers by the hook library in
 /// its @c load() function. If the hook point for the given command already
 /// exists, this function doesn't do anything. The
-/// @ref LibraryHandle::registerCommandHandler can install callouts on this
+/// @ref LibraryHandle::registerCommandCallout can install callouts on this
 /// hook point.
 ///
 /// Note that the callout functions do not access the CalloutManager: instead,

+ 1 - 1
src/lib/hooks/library_handle.cc

@@ -36,7 +36,7 @@ LibraryHandle::registerCallout(const std::string& name, CalloutPtr callout) {
 }
 
 void
-LibraryHandle::registerCommandHandler(const std::string& command_name,
+LibraryHandle::registerCommandCallout(const std::string& command_name,
                                       CalloutPtr callout) {
     // Register hook point for this command, if one doesn't exist.
     callout_manager_->registerCommandHook(command_name);

+ 2 - 2
src/lib/hooks/library_handle.h

@@ -48,7 +48,7 @@ extern "C" {
 /// handler similarly to this:
 /// @code
 /// int load(LibraryHandle& libhandle) {
-///     libhandle.registerCommandHandler("foo-bar", foo_bar_handler);
+///     libhandle.registerCommandCallout("foo-bar", foo_bar_handler);
 ///     return (0);
 /// }
 /// @endcode
@@ -104,7 +104,7 @@ public:
     ///
     /// @param command_name Command name for which handler should be installed.
     /// @param callout Pointer to the command handler implemented as a callout.
-    void registerCommandHandler(const std::string& command_name, CalloutPtr callout);
+    void registerCommandCallout(const std::string& command_name, CalloutPtr callout);
 
     /// @brief De-Register a callout on a hook
     ///

+ 4 - 4
src/lib/hooks/tests/callout_manager_unittest.cc

@@ -880,14 +880,14 @@ TEST_F(CalloutManagerTest, LibraryHandleRegisterCommandHandler) {
     // 'command-two' should also be called.
 
     getCalloutManager()->setLibraryIndex(0);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_one);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_four);
     getCalloutManager()->setLibraryIndex(1);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_two);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-two",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-two",
                                                                    callout_three);
 
     // Command handlers are installed for commands: 'command-one' and 'command-two'.

+ 2 - 2
src/lib/hooks/tests/full_callout_library.cc

@@ -151,8 +151,8 @@ load(LibraryHandle& handle) {
     handle.registerCallout("hookpt_three", hook_nonstandard_three);
 
     // Register command_handler_one as control command handler.
-    handle.registerCommandHandler("command-one", command_handler_one);
-    handle.registerCommandHandler("command-two", command_handler_two);
+    handle.registerCommandCallout("command-one", command_handler_one);
+    handle.registerCommandCallout("command-two", command_handler_two);
 
     return (0);
 }

+ 2 - 2
src/lib/hooks/tests/load_callout_library.cc

@@ -142,8 +142,8 @@ int load(LibraryHandle& handle) {
     handle.registerCallout("hookpt_three", hook_nonstandard_three);
 
     // Register command_handler_one as control command handler.
-    handle.registerCommandHandler("command-one", command_handler_one);
-    handle.registerCommandHandler("command-two", command_handler_two);
+    handle.registerCommandCallout("command-one", command_handler_one);
+    handle.registerCommandCallout("command-two", command_handler_two);
 
     return (0);
 }