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 
22 {
26 
27 };
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  static HttpStatusMethod GetMethod( const QString &sURI );
57 
58  void GetStatusXML ( HTTPRequest *pRequest );
59  void GetStatusHTML ( HTTPRequest *pRequest );
60 
61  void FillStatusXML ( QDomDocument *pDoc);
62 
63  static void PrintStatus ( QTextStream &os, QDomDocument *pDoc );
64  static int PrintEncoderStatus( QTextStream &os, const QDomElement& encoders );
65  static int PrintScheduled ( QTextStream &os, const QDomElement& scheduled );
66  static int PrintFrontends ( QTextStream &os, const QDomElement& frontends );
67  static int PrintBackends ( QTextStream &os, const QDomElement& backends );
68  static int PrintJobQueue ( QTextStream &os, const QDomElement& jobs );
69  static int PrintMachineInfo ( QTextStream &os, const QDomElement& info );
70  static int PrintMiscellaneousInfo ( QTextStream &os, const QDomElement& info );
71 
72  static void FillProgramInfo ( QDomDocument *pDoc,
73  QDomNode &node,
74  ProgramInfo *pInfo,
75  bool bIncChannel = true,
76  bool bDetails = true );
77 
78  static 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  ~HttpStatus() override = default;
87 
90 
91  QStringList GetBasePaths() override; // HttpServerExtension
92 
93  bool ProcessRequest( HTTPRequest *pRequest ) override; // HttpServerExtension
94 };
95 
96 #endif
HttpStatus::PrintStatus
static void PrintStatus(QTextStream &os, QDomDocument *pDoc)
Definition: httpstatus.cpp:625
HttpStatus::GetMethod
static HttpStatusMethod GetMethod(const QString &sURI)
Definition: httpstatus.cpp:67
Scheduler
Definition: scheduler.h:47
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:504
HTTPRequest
Definition: httprequest.h:108
HttpStatus::m_pEncoders
QMap< int, EncoderLink * > * m_pEncoders
Definition: httpstatus.h:47
HSM_GetStatusXML
@ HSM_GetStatusXML
Definition: httpstatus.h:25
HttpStatusMethod
HttpStatusMethod
Definition: httpstatus.h:22
HttpStatus::GetStatusHTML
void GetStatusHTML(HTTPRequest *pRequest)
Definition: httpstatus.cpp:154
HttpStatus::PrintScheduled
static int PrintScheduled(QTextStream &os, const QDomElement &scheduled)
Definition: httpstatus.cpp:852
HttpStatus
Definition: httpstatus.h:43
HttpStatus::m_pSched
Scheduler * m_pSched
Definition: httpstatus.h:46
HttpStatus::m_bIsMaster
bool m_bIsMaster
Definition: httpstatus.h:50
tvList
QMap< int, EncoderLink * > tvList
Definition: backendcontext.cpp:7
HttpStatus::~HttpStatus
~HttpStatus() override=default
MainServer
Definition: mainserver.h:115
AutoExpire
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:62
HttpStatus::FillProgramInfo
static void FillProgramInfo(QDomDocument *pDoc, QDomNode &node, ProgramInfo *pInfo, bool bIncChannel=true, bool bDetails=true)
Definition: httpstatus.cpp:1501
HttpStatus::SetMainServer
void SetMainServer(MainServer *mainServer)
Definition: httpstatus.h:88
HttpStatus::ProcessRequest
bool ProcessRequest(HTTPRequest *pRequest) override
Definition: httpstatus.cpp:90
HttpStatus::GetBasePaths
QStringList GetBasePaths() override
Definition: httpstatus.cpp:81
HttpStatus::PrintBackends
static int PrintBackends(QTextStream &os, const QDomElement &backends)
Definition: httpstatus.cpp:1023
expirer
AutoExpire * expirer
Definition: backendcontext.cpp:8
programinfo.h
HttpStatus::m_pMainServer
MainServer * m_pMainServer
Definition: httpstatus.h:49
HSM_Unknown
@ HSM_Unknown
Definition: httpstatus.h:23
HttpStatus::PrintMachineInfo
static int PrintMachineInfo(QTextStream &os, const QDomElement &info)
Definition: httpstatus.cpp:1205
HttpStatus::FillStatusXML
void FillStatusXML(QDomDocument *pDoc)
Definition: httpstatus.cpp:174
HttpStatus::PrintJobQueue
static int PrintJobQueue(QTextStream &os, const QDomElement &jobs)
Definition: httpstatus.cpp:1062
HSM_GetStatusHTML
@ HSM_GetStatusHTML
Definition: httpstatus.h:24
sched
Scheduler * sched
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
HttpStatus::PrintMiscellaneousInfo
static int PrintMiscellaneousInfo(QTextStream &os, const QDomElement &info)
Definition: httpstatus.cpp:1449
HttpStatus::m_pExpirer
AutoExpire * m_pExpirer
Definition: httpstatus.h:48
HttpStatus::PrintEncoderStatus
static int PrintEncoderStatus(QTextStream &os, const QDomElement &encoders)
Definition: httpstatus.cpp:708
HttpStatus::m_nPreRollSeconds
int m_nPreRollSeconds
Definition: httpstatus.h:51
httpserver.h
mainServer
static MainServer * mainServer
Definition: main_helpers.cpp:68
HttpStatus::PrintFrontends
static int PrintFrontends(QTextStream &os, const QDomElement &frontends)
Definition: httpstatus.cpp:985
HttpServerExtension
Definition: httpserver.h:72
HttpStatus::FillChannelInfo
static void FillChannelInfo(QDomElement &channel, ProgramInfo *pInfo, bool bDetails=true)
Definition: httpstatus.cpp:1600
HttpStatus::m_settingLock
QMutex m_settingLock
Definition: httpstatus.h:52
HttpStatus::HttpStatus
HttpStatus(QMap< int, EncoderLink * > *tvList, Scheduler *sched, AutoExpire *expirer, bool bIsMaster)
Definition: httpstatus.cpp:49
HttpStatus::GetStatusXML
void GetStatusXML(HTTPRequest *pRequest)
Definition: httpstatus.cpp:130