MythTV  master
httpstatus.h
Go to the documentation of this file.
1 // Program Name: httpstatus.h
3 //
4 // Purpose - Html & XML status HttpServerExtension
5 //
6 // Created By : David Blain Created On : Oct. 24, 2005
7 // Modified By : Modified On:
8 //
10 
11 #ifndef HTTPSTATUS_H_
12 #define HTTPSTATUS_H_
13 
14 #include <QDomDocument>
15 #include <QMutex>
16 #include <QMap>
17 
18 #include "httpserver.h"
19 #include "programinfo.h"
20 
21 typedef enum
22 {
26 
28 
31 //
32 //
33 //
36 
37 class Scheduler;
38 class AutoExpire;
39 class EncoderLink;
40 class MainServer;
41 
43 {
44  private:
45 
47  QMap<int, EncoderLink *> *m_pEncoders;
52  QMutex m_settingLock;
53 
54  private:
55 
56  HttpStatusMethod GetMethod( const QString &sURI );
57 
58  void GetStatusXML ( HTTPRequest *pRequest );
59  void GetStatusHTML ( HTTPRequest *pRequest );
60 
61  void FillStatusXML ( QDomDocument *pDoc);
62 
63  void PrintStatus ( QTextStream &os, QDomDocument *pDoc );
64  int PrintEncoderStatus( QTextStream &os, const QDomElement& encoders );
65  int PrintScheduled ( QTextStream &os, const QDomElement& scheduled );
66  int PrintFrontends ( QTextStream &os, const QDomElement& frontends );
67  int PrintBackends ( QTextStream &os, const QDomElement& backends );
68  int PrintJobQueue ( QTextStream &os, const QDomElement& jobs );
69  int PrintMachineInfo ( QTextStream &os, const QDomElement& info );
70  int PrintMiscellaneousInfo ( QTextStream &os, const QDomElement& info );
71 
72  void FillProgramInfo ( QDomDocument *pDoc,
73  QDomNode &node,
74  ProgramInfo *pInfo,
75  bool bIncChannel = true,
76  bool bDetails = true );
77 
78  void FillChannelInfo ( QDomElement &channel,
79  ProgramInfo *pInfo,
80  bool bDetails = true );
81 
82 
83  public:
84  HttpStatus( QMap<int, EncoderLink *> *tvList, Scheduler *sched,
85  AutoExpire *expirer, bool bIsMaster );
86  virtual ~HttpStatus() = default;
87 
90 
91  QStringList GetBasePaths() override; // HttpServerExtension
92 
93  bool ProcessRequest( HTTPRequest *pRequest ) override; // HttpServerExtension
94 };
95 
96 #endif
QStringList GetBasePaths() override
Definition: httpstatus.cpp:80
void FillProgramInfo(QDomDocument *pDoc, QDomNode &node, ProgramInfo *pInfo, bool bIncChannel=true, bool bDetails=true)
int PrintMachineInfo(QTextStream &os, const QDomElement &info)
bool ProcessRequest(HTTPRequest *pRequest) override
Definition: httpstatus.cpp:89
AutoExpire * m_pExpirer
Definition: httpstatus.h:48
void FillStatusXML(QDomDocument *pDoc)
Definition: httpstatus.cpp:173
void GetStatusXML(HTTPRequest *pRequest)
Definition: httpstatus.cpp:129
int PrintMiscellaneousInfo(QTextStream &os, const QDomElement &info)
int PrintFrontends(QTextStream &os, const QDomElement &frontends)
Definition: httpstatus.cpp:980
void FillChannelInfo(QDomElement &channel, ProgramInfo *pInfo, bool bDetails=true)
Holds information on recordings and videos.
Definition: programinfo.h:66
int PrintEncoderStatus(QTextStream &os, const QDomElement &encoders)
Definition: httpstatus.cpp:705
void SetMainServer(MainServer *mainServer)
Definition: httpstatus.h:88
HttpStatus(QMap< int, EncoderLink * > *tvList, Scheduler *sched, AutoExpire *expirer, bool bIsMaster)
Definition: httpstatus.cpp:48
QMutex m_settingLock
Definition: httpstatus.h:52
int m_nPreRollSeconds
Definition: httpstatus.h:51
QMap< int, EncoderLink * > * m_pEncoders
Definition: httpstatus.h:47
int PrintBackends(QTextStream &os, const QDomElement &backends)
void GetStatusHTML(HTTPRequest *pRequest)
Definition: httpstatus.cpp:153
MainServer * m_pMainServer
Definition: httpstatus.h:49
void PrintStatus(QTextStream &os, QDomDocument *pDoc)
Definition: httpstatus.cpp:622
int PrintJobQueue(QTextStream &os, const QDomElement &jobs)
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:61
virtual ~HttpStatus()=default
AutoExpire * expirer
HttpStatusMethod
Definition: httpstatus.h:21
static MainServer * mainServer
Scheduler * sched
HttpStatusMethod GetMethod(const QString &sURI)
Definition: httpstatus.cpp:66
Scheduler * m_pSched
Definition: httpstatus.h:46
int PrintScheduled(QTextStream &os, const QDomElement &scheduled)
Definition: httpstatus.cpp:849
QMap< int, EncoderLink * > tvList
bool m_bIsMaster
Definition: httpstatus.h:50