MXS-2271 Move Monitor inside maxscale-namespace

Rearranged monitor.cc by namespace.
This commit is contained in:
Esa Korhonen
2019-03-13 10:38:13 +02:00
parent 5e3f837b42
commit 14b4fa632a
33 changed files with 538 additions and 504 deletions

View File

@ -143,7 +143,7 @@ bool runtime_enable_server_ssl(Server* server,
* @param value New value
* @return True if @c key was one of the supported parameters
*/
bool runtime_alter_monitor(Monitor* monitor, const char* key, const char* value);
bool runtime_alter_monitor(mxs::Monitor* monitor, const char* key, const char* value);
/**
* @brief Alter service parameters
@ -254,7 +254,7 @@ bool runtime_destroy_filter(const SFilterDef& filter);
* @param monitor Monitor to destroy
* @return True if monitor was destroyed
*/
bool runtime_destroy_monitor(Monitor* monitor);
bool runtime_destroy_monitor(mxs::Monitor* monitor);
/**
* Destroy a service
@ -304,7 +304,7 @@ bool runtime_alter_server_relationships_from_json(Server* server, const char* ty
*
* @return Created monitor or NULL on error
*/
Monitor* runtime_create_monitor_from_json(json_t* json);
mxs::Monitor* runtime_create_monitor_from_json(json_t* json);
/**
* @brief Create a new filter from JSON
@ -332,7 +332,7 @@ Service* runtime_create_service_from_json(json_t* json);
*
* @return True if the monitor was successfully modified to represent @c new_json
*/
bool runtime_alter_monitor_from_json(Monitor* monitor, json_t* new_json);
bool runtime_alter_monitor_from_json(mxs::Monitor* monitor, json_t* new_json);
/**
* @brief Alter monitor relationships
@ -342,7 +342,7 @@ bool runtime_alter_monitor_from_json(Monitor* monitor, json_t* new_json);
*
* @return True if the relationships were successfully modified
*/
bool runtime_alter_monitor_relationships_from_json(Monitor* monitor, json_t* json);
bool runtime_alter_monitor_relationships_from_json(mxs::Monitor* monitor, json_t* json);
/**
* @brief Alter a service using JSON

View File

@ -69,8 +69,8 @@ public:
* @param module The module name to load
* @return The newly created monitor, or NULL on error
*/
static Monitor* create_monitor(const std::string& name, const std::string& module,
MXS_CONFIG_PARAMETER* params);
static mxs::Monitor* create_monitor(const std::string& name, const std::string& module,
MXS_CONFIG_PARAMETER* params);
/**
* Mark monitor as deactivated. A deactivated monitor appears not to exist, as if it had been
@ -79,7 +79,7 @@ public:
*
* @param monitor Monitor to deactivate
*/
static void deactivate_monitor(Monitor* monitor);
static void deactivate_monitor(mxs::Monitor* monitor);
/**
* @brief Destroys all monitors. At this point all monitors should
@ -89,19 +89,19 @@ public:
*/
static void destroy_all_monitors();
static void start_monitor(Monitor* monitor);
static void start_monitor(mxs::Monitor* monitor);
/**
* Stop a given monitor
*
* @param monitor The monitor to stop
*/
static void stop_monitor(Monitor* monitor);
static void stop_monitor(mxs::Monitor* monitor);
static void stop_all_monitors();
static void start_all_monitors();
static Monitor* find_monitor(const char* name);
static mxs::Monitor* find_monitor(const char* name);
/**
* @brief Populate services with the servers of the monitors.
@ -130,12 +130,12 @@ public:
* @param server Server that is queried
* @return The monitor watching this server, or NULL if not monitored
*/
static Monitor* server_is_monitored(const SERVER* server);
static mxs::Monitor* server_is_monitored(const SERVER* server);
static Monitor* reactivate_monitor(const char* name, const char* module);
static mxs::Monitor* reactivate_monitor(const char* name, const char* module);
static void show_all_monitors(DCB* dcb);
static void monitor_show(DCB* dcb, Monitor* monitor);
static void monitor_show(DCB* dcb, mxs::Monitor* monitor);
static void monitor_list(DCB*);
@ -149,7 +149,7 @@ public:
* @param monitor Monitor to serialize
* @return True if serialization was successful
*/
static bool monitor_serialize(const Monitor* monitor);
static bool monitor_serialize(const mxs::Monitor* monitor);
/**
* @brief Convert monitor to JSON
@ -159,9 +159,9 @@ public:
*
* @return JSON representation of the monitor
*/
static json_t* monitor_to_json(const Monitor* monitor, const char* host);
static json_t* monitor_to_json(const mxs::Monitor* monitor, const char* host);
static bool create_monitor_config(const Monitor* monitor, const char* filename);
static bool create_monitor_config(const mxs::Monitor* monitor, const char* filename);
/**
* Waits until all running monitors have advanced one tick.

View File

@ -21,7 +21,10 @@
#include "filter.hh"
namespace maxscale
{
class Monitor;
}
/**
* @file service.h - MaxScale internal service functions
@ -106,7 +109,7 @@ public:
mutable std::mutex lock;
// TODO: Make this private.
Monitor* m_monitor { nullptr }; /**< A possibly associated monitor */
mxs::Monitor* m_monitor { nullptr }; /**< A possibly associated monitor */
bool uses_cluster() const
{
@ -413,7 +416,7 @@ json_t* service_relations_to_filter(const SFilterDef& filter, const char* host);
* @param monitor A monitor.
* @param server A server.
*/
void service_add_server(Monitor* pMonitor, SERVER* pServer);
void service_add_server(mxs::Monitor* pMonitor, SERVER* pServer);
/**
* @brief Remove server from all services associated with a monitor
@ -421,7 +424,7 @@ void service_add_server(Monitor* pMonitor, SERVER* pServer);
* @param monitor A monitor.
* @param server A server.
*/
void service_remove_server(Monitor* pMonitor, SERVER* pServer);
void service_remove_server(mxs::Monitor* pMonitor, SERVER* pServer);
std::unique_ptr<ResultSet> serviceGetList(void);
std::unique_ptr<ResultSet> serviceGetListenerList(void);