libreoffice-online/loolwsd/Admin.hpp
Pranav Kant ada6a74dc0 loolwsd: Basic layout and interaction with AdminModel
Admin web sessions are added as subscribers to AdminModel. Live
notification fill up the AdminModel, and notifies to
subscribers, if present any. AdminModel can also be queried to
fetch any previous data since the start of the server including
expired documents/views with timestamps for analysis.

There is lot of stuff that can be added in future. This commit
just lays the foundation of appropriate classes.

Change-Id: Ifcf6c2896ef46b33935802e79cd28240fd4f980e
Reviewed-on: https://gerrit.libreoffice.org/22869
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-03 18:30:33 +00:00

48 lines
1.1 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_ADMIN_HPP
#define INCLUDED_ADMIN_HPP
#include <Poco/Net/HTTPServer.h>
#include <Poco/Runnable.h>
#include <Poco/Types.h>
#include "AdminModel.hpp"
const std::string FIFO_NOTIFY = "loolnotify.fifo";
/// An admin command processor.
class Admin : public Poco::Runnable
{
public:
Admin(const int brokerPipe, const int notifyPipe);
~Admin();
static int getBrokerPid() { return Admin::BrokerPipe; }
void run() override;
AdminModel& getModel();
private:
void handleInput(std::string& message);
private:
Poco::Net::HTTPServer _srv;
AdminModel _model;
static int BrokerPipe;
static int NotifyPipe;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */