diff options
Diffstat (limited to 'src/smtp_service.hpp')
-rw-r--r-- | src/smtp_service.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/smtp_service.hpp b/src/smtp_service.hpp new file mode 100644 index 0000000..7149e3a --- /dev/null +++ b/src/smtp_service.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include <boost/asio/io_service.hpp> + +#include <sdbusplus/asio/connection.hpp> +#include <sdbusplus/asio/object_server.hpp> + +#include "settings_storage.hpp" + +namespace smtp +{ + using ConnectionPtr = std::shared_ptr<sdbusplus::asio::connection>; + using InterfacePtr = std::shared_ptr<sdbusplus::asio::dbus_interface>; + using ObjectServerPtr = std::shared_ptr<sdbusplus::asio::object_server>; + + class SmtpService + { + public: + SmtpService( ConnectionPtr connection ); + ~SmtpService() = default; + private: + void FillStorageByDefault(); + void CreateService( ConnectionPtr bus ); + void CreateInterface( ConnectionPtr connection ); + void AddProperties(); + void AddMethods(); + bool RefreshSettings(std::string const& user, + std::string const& password, + std::string const& host, + std::string const& port); + + InterfacePtr mInterface; + ObjectServerPtr mObjectServer; + SettingsStorage mStorage; + }; +} |