MXS-2271 Cleanup internal monitor header and its functions

Some functions still accessed the servers-array. Most functions are now
inside class. Removed unused defines.
This commit is contained in:
Esa Korhonen
2019-03-07 18:51:54 +02:00
parent e7abc53b70
commit ac5ee1278c
11 changed files with 139 additions and 211 deletions

View File

@ -435,7 +435,20 @@ protected:
private:
friend class MonitorManager;
/**
* @brief Add a server to a monitor.
*
* Add a server to a monitor, provided the server is not currently
* being monitored by any monitor. Before adding the server to the
* monitor, the monitor is stopped if it is running and after the
* addition it is restarted if it was running.
*
* @param server A server.
*
* @return True, if the monitor was added, false otherwise.
*/
void add_server(SERVER* server);
void remove_server(SERVER* server);
/**
@ -466,20 +479,6 @@ private:
*/
int launch_command(MXS_MONITORED_SERVER* ptr, EXTERNCMD* cmd);
/**
* @brief Add a server to a monitor.
*
* Add a server to a monitor, provided the server is not currently
* being monitored by any monitor. Before adding the server to the
* monitor, the monitor is stopped if it is running and after the
* addition it is restarted if it was running.
*
* @param monitor A monitor.
* @param server A server.
*
* @return True, if the monitor was added, false otherwise.
*/
static bool add_server(Monitor* mon, SERVER* server);
/**
* @brief Remove a server from a monitor.