-
Notifications
You must be signed in to change notification settings - Fork 341
/
httpstatus.h
93 lines (72 loc) · 3.29 KB
/
httpstatus.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//////////////////////////////////////////////////////////////////////////////
// Program Name: httpstatus.h
//
// Purpose - Html & XML status HttpServerExtension
//
// Created By : David Blain Created On : Oct. 24, 2005
// Modified By : Modified On:
//
//////////////////////////////////////////////////////////////////////////////
#ifndef HTTPSTATUS_H_
#define HTTPSTATUS_H_
#include <QDomDocument>
#include <QMutex>
#include <QMap>
#include "httpserver.h"
#include "programinfo.h"
typedef enum
{
HSM_Unknown = 0,
HSM_GetStatusHTML = 1,
HSM_GetStatusXML = 2
} HttpStatusMethod;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
//
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
class Scheduler;
class AutoExpire;
class EncoderLink;
class MainServer;
class HttpStatus : public HttpServerExtension
{
private:
Scheduler *m_pSched;
QMap<int, EncoderLink *> *m_pEncoders;
AutoExpire *m_pExpirer;
MainServer *m_pMainServer;
bool m_bIsMaster;
int m_nPreRollSeconds;
QMutex m_settingLock;
private:
HttpStatusMethod GetMethod( const QString &sURI );
void GetStatusXML ( HTTPRequest *pRequest );
void GetStatusHTML ( HTTPRequest *pRequest );
void FillStatusXML ( QDomDocument *pDoc);
void PrintStatus ( QTextStream &os, QDomDocument *pDoc );
int PrintEncoderStatus( QTextStream &os, QDomElement encoders );
int PrintScheduled ( QTextStream &os, QDomElement scheduled );
int PrintJobQueue ( QTextStream &os, QDomElement jobs );
int PrintMachineInfo ( QTextStream &os, QDomElement info );
int PrintMiscellaneousInfo ( QTextStream &os, QDomElement info );
void FillProgramInfo ( QDomDocument *pDoc,
QDomNode &node,
ProgramInfo *pInfo,
bool bIncChannel = true,
bool bDetails = true );
void FillChannelInfo ( QDomElement &channel,
ProgramInfo *pInfo,
bool bDetails = true );
public:
HttpStatus( QMap<int, EncoderLink *> *tvList, Scheduler *sched,
AutoExpire *expirer, bool bIsMaster );
virtual ~HttpStatus();
void SetMainServer(MainServer *mainServer)
{ m_pMainServer = mainServer; }
bool ProcessRequest( HttpWorkerThread *pThread,
HTTPRequest *pRequest );
};
#endif