| Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 1 | /** | 
|  | 2 | * @brief Server side implementation of the D-Bus interface | 
|  | 3 | * | 
|  | 4 | * This file is part of HostLogger project. | 
|  | 5 | * | 
|  | 6 | * Copyright (c) 2018 YADRO | 
|  | 7 | * | 
|  | 8 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 9 | * you may not use this file except in compliance with the License. | 
|  | 10 | * You may obtain a copy of the License at | 
|  | 11 | * | 
|  | 12 | *     http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | * | 
|  | 14 | * Unless required by applicable law or agreed to in writing, software | 
|  | 15 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 17 | * See the License for the specific language governing permissions and | 
|  | 18 | * limitations under the License. | 
|  | 19 | */ | 
|  | 20 |  | 
|  | 21 | #include "dbus_server.hpp" | 
| Patrick Venture | 4d5a5dc | 2018-11-14 08:51:13 -0800 | [diff] [blame^] | 22 |  | 
| Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 23 | #include <xyz/openbmc_project/Common/File/error.hpp> | 
|  | 24 |  | 
| Patrick Venture | 4d5a5dc | 2018-11-14 08:51:13 -0800 | [diff] [blame^] | 25 | DbusServer::DbusServer(LogManager& logManager, sdbusplus::bus::bus& bus, | 
|  | 26 | const char* path /*= HOSTLOGGER_DBUS_PATH*/) : | 
|  | 27 | server_inherit(bus, path), | 
|  | 28 | logManager_(logManager) | 
| Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 29 | { | 
|  | 30 | } | 
|  | 31 |  | 
| Artem Senichev | efd5d74 | 2018-10-24 16:14:04 +0300 | [diff] [blame] | 32 | void DbusServer::flush() | 
|  | 33 | { | 
|  | 34 | const int rc = logManager_.flush(); | 
|  | 35 | if (rc != 0) | 
|  | 36 | throw sdbusplus::xyz::openbmc_project::Common::File::Error::Write(); | 
|  | 37 | } |