From d844293ea1a8d2f36d7ae5dbeda2c159e5d8e930 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 23 May 2018 15:51:26 +0300 Subject: [PATCH] MXS-1775 Document virtual functions in mxs::MonitorInstance --- include/maxscale/monitor.hh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/maxscale/monitor.hh b/include/maxscale/monitor.hh index 88bdf0e44..0f816a407 100644 --- a/include/maxscale/monitor.hh +++ b/include/maxscale/monitor.hh @@ -37,8 +37,40 @@ protected: const std::string& script() const { return m_script; } uint64_t events() const { return m_events; } + /** + * @brief Update server information + * + * The implementation should probe the server in question and update + * the server status bits. + */ + virtual void update_server_status(MXS_MONITORED_SERVER* pMonitored_server) = 0; + + /** + * @brief Check whether the monitor has sufficient rights + * + * The implementation should check whether the monitor user has sufficient + * rights to access the servers. The default implementation returns True. + * + * @return True, if the monitor user has sufficient rights, false otherwise. + */ virtual bool has_sufficient_permissions() const; + + /** + * @brief Configure the monitor. + * + * When the monitor is started, this function will be called in order + * to allow the concrete implementation to configure itself from + * configuration parameters. The default implementation does nothing. + */ virtual void configure(const MXS_CONFIG_PARAMETER* pParams); + + /** + * @brief Monitor the servers + * + * This function is called once per monitor round, and the concrete + * implementation should probe all servers, i.e. call @c update_server_status + * on each server. + */ virtual void tick() = 0; MXS_MONITOR* m_monitor; /**< The generic monitor structure. */