1#pragma once
2
3#include <IFetcher.h>
4#include <JenkinsJobInfo.h>
5
6#include <QMutex>
7
8namespace Jenkins
9{
10
11class JobDetailsFetcher : public IFetcher
12{
13 Q_OBJECT
14
15signals:
16 void signalJobDetailsRecieved(const JenkinsJobInfo &updatedInfo);
17
18public:
19 JobDetailsFetcher(const Config &config, const JenkinsJobInfo &info, QObject *parent = nullptr);
20
21 void triggerFetch() override;
22
23private:
24 JenkinsJobInfo mInfo;
25 QVector<JenkinsJobBuildInfo> mBuildsInfo;
26 QMap<int, JenkinsJobBuildInfo> mTmpBuilds;
27 QMutex mMutex;
28
29 void processData(const QJsonDocument &json) override;
30 void readHealthReportsPartFor(QJsonObject &jsonObject);
31 void readBuildsListFor(QJsonObject &jsonObject);
32 void retrieveBuildConfig(const QJsonArray &propertyArray);
33 void readBuildableFlagFor(QJsonObject &jsonObject);
34 void readIsQueuedFlagFor(QJsonObject &jsonObject);
35};
36
37}
38