2017-07-03 09:30:10 +02:00
|
|
|
/*!
|
|
|
|
* \brief Sends a status request to given url:port and tries to detect details and server header.
|
|
|
|
*
|
2017-12-20 14:54:05 +01:00
|
|
|
* \copyright Copyright (c) 2014-2017 Governikus GmbH & Co. KG, Germany
|
2017-07-03 09:30:10 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "EnumHelper.h"
|
|
|
|
#include "HttpServerRequestor.h"
|
|
|
|
#include "VersionInfo.h"
|
|
|
|
#include <QHostAddress>
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
namespace governikus
|
|
|
|
{
|
|
|
|
|
|
|
|
class HttpServerStatusParser
|
|
|
|
: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
QUrl mUrl;
|
|
|
|
QString mServerHeader;
|
|
|
|
VersionInfo mVersionInfo;
|
|
|
|
HttpServerRequestor mRequestor;
|
|
|
|
|
|
|
|
bool parseReply(const QPointer<QNetworkReply>& pReply);
|
|
|
|
|
|
|
|
public:
|
|
|
|
HttpServerStatusParser(int pPort, const QHostAddress& pHost = QHostAddress::LocalHost);
|
|
|
|
virtual ~HttpServerStatusParser();
|
|
|
|
|
|
|
|
bool request();
|
|
|
|
const QString& getServerHeader() const;
|
|
|
|
const VersionInfo& getVersionInfo() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace governikus */
|