SearchSECODatabaseAPI
JobTypes.h
1/*
2This program has been developed by students from the bachelor Computer Science at
3Utrecht University within the Software Project course.
4© Copyright Utrecht University (Department of Information and Computing Sciences)
5*/
6
7#pragma once
8#include <string>
9
10namespace jobTypes
11{
15 struct Job
16 {
17 public:
18 std::string jobid;
19 long long time;
20 long long timeout;
21 long long priority;
22 std::string url;
23 int retries;
24
25 Job(std::string jobid, long long timeout, long long priority, std::string url, int retries)
26 : jobid(jobid), timeout(timeout), priority(priority), url(url), retries(retries)
27 {
28 }
29
30 Job()
31 {
32 }
33 };
34
40 struct FailedJob
41 {
42 public:
43 std::string jobid;
44 long long time;
45 long long timeout;
46 long long priority;
47 std::string url;
48 int retries;
49 int reasonID;
50 std::string reasonData;
51
58 FailedJob(Job job, int reasonID, std::string reasonData)
59 : jobid(job.jobid), time(job.time), timeout(job.timeout), priority(job.priority), url(job.url),
60 retries(job.retries), reasonID(reasonID), reasonData(reasonData)
61 {
62 }
63 };
64} // namespace jobTypes
Mirrors an entry of the failedjobs table in the database. Difference with Job is the addition of a re...
Definition: JobTypes.h:41
FailedJob(Job job, int reasonID, std::string reasonData)
Constructs a failed job given a normal job and the reason.
Definition: JobTypes.h:58
Mirrors an entry of the currentjobs table in the database.
Definition: JobTypes.h:16