FOSSology
4.4.0
Open Source License Compliance by Open Source Software
JobQueue.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2022 Krishna Mahato <krishhtrishh9304@gmail.com>
4
5
SPDX-License-Identifier: GPL-2.0-only
6
*/
11
namespace
Fossology\UI\Api\Models;
12
17
class
JobQueue
18
{
23
private
$jobQueueId
;
28
private
$jobQueueType
;
33
private
$startTime
;
38
private
$endTime
;
43
private
$status
;
48
private
$itemsProcessed
;
53
private
$log
;
58
private
$dependencies
;
63
private
$itemsPerSec
;
67
private
$canDoActions;
72
private
$isInProgress
;
77
private
$isReady
;
82
private
$download
;
83
100
public
function
__construct
(
$jobQueueId
,
$jobQueueType
,
$startTime
,
$endTime
,
101
$status
,
$itemsProcessed
,
$log
,
$dependencies
,
102
$itemsPerSec
, $canDoActions,
$isInProgress
,
103
$isReady
,
$download
)
104
{
105
$this->
setJobQueueId
(
$jobQueueId
);
106
$this->
setJobQueueType
(
$jobQueueType
);
107
$this->
setStartTime
(
$startTime
);
108
$this->
setEndTime
(
$endTime
);
109
$this->
setStatus
(
$status
);
110
$this->
setItemsProcessed
(
$itemsProcessed
);
111
$this->
setLog
(
$log
);
112
$this->
setDependencies
(
$dependencies
);
113
$this->
setItemsPerSec
(
$itemsPerSec
);
114
$this->
setCanDoActions
($canDoActions);
115
$this->
setIsInProgress
(
$isInProgress
);
116
$this->
setIsReady
(
$isReady
);
117
$this->
setDownload
(
$download
);
118
}
119
123
public
function
getJobQueueId
()
124
{
125
return
$this->jobQueueId
;
126
}
127
131
public
function
setJobQueueId
(
$jobQueueId
)
132
{
133
$this->jobQueueId = intval(
$jobQueueId
);
134
}
135
139
public
function
getJobQueueType
()
140
{
141
return
$this->jobQueueType
;
142
}
143
147
public
function
setJobQueueType
(
$jobQueueType
)
148
{
149
$this->jobQueueType =
$jobQueueType
;
150
}
151
155
public
function
getStartTime
()
156
{
157
return
$this->startTime
;
158
}
159
163
public
function
setStartTime
(
$startTime
)
164
{
165
$this->startTime =
$startTime
;
166
}
167
171
public
function
getEndTime
()
172
{
173
return
$this->endTime
;
174
}
175
179
public
function
setEndTime
(
$endTime
)
180
{
181
$this->endTime =
$endTime
;
182
}
183
187
public
function
getStatus
()
188
{
189
return
$this->status
;
190
}
191
195
public
function
setStatus
(
$status
)
196
{
197
$this->status =
$status
;
198
}
199
203
public
function
getItemsProcessed
()
204
{
205
return
$this->itemsProcessed
;
206
}
207
211
public
function
setItemsProcessed
(
$itemsProcessed
)
212
{
213
$this->itemsProcessed = intval(
$itemsProcessed
);
214
}
215
219
public
function
getLog
()
220
{
221
return
$this->log
;
222
}
223
227
public
function
setLog
(
$log
)
228
{
229
$this->log =
$log
;
230
}
231
235
public
function
getDependencies
()
236
{
237
return
$this->dependencies
;
238
}
239
243
public
function
setDependencies
(
$dependencies
)
244
{
245
$this->dependencies = [];
246
foreach
(
$dependencies
as $dependency) {
247
$this->dependencies[] = intval($dependency);
248
}
249
}
250
254
public
function
getItemsPerSec
()
255
{
256
return
$this->itemsPerSec
;
257
}
258
262
public
function
setItemsPerSec
(
$itemsPerSec
)
263
{
264
$this->itemsPerSec = floatval(
$itemsPerSec
);
265
}
266
270
public
function
isCanDoActions
()
271
{
272
return
$this->canDoActions;
273
}
274
278
public
function
setCanDoActions
($canDoActions)
279
{
280
$this->canDoActions = $canDoActions;
281
}
282
286
public
function
isInProgress
()
287
{
288
return
$this->isInProgress
;
289
}
290
294
public
function
setIsInProgress
(
$isInProgress
)
295
{
296
$this->
isInProgress
=
$isInProgress
;
297
}
298
302
public
function
isReady
()
303
{
304
return
$this->isReady
;
305
}
306
310
public
function
setIsReady
(
$isReady
)
311
{
312
$this->
isReady
=
$isReady
;
313
}
314
318
public
function
getDownload
()
319
{
320
return
$this->download
;
321
}
322
326
public
function
setDownload
(
$download
)
327
{
328
$this->download =
$download
;
329
}
330
335
public
function
getJSON
()
336
{
337
return
json_encode($this->
getArray
());
338
}
339
344
public
function
getArray
()
345
{
346
return
[
347
"jobQueueId"
=> $this->
getJobQueueId
(),
348
"jobQueueType"
=> $this->
getJobQueueType
(),
349
"startTime"
=> $this->
getStartTime
(),
350
"endTime"
=> $this->
getEndTime
(),
351
"status"
=> $this->
getStatus
(),
352
"itemsProcessed"
=> $this->
getItemsProcessed
(),
353
"log"
=> $this->
getLog
(),
354
"dependencies"
=> $this->
getDependencies
(),
355
"itemsPerSec"
=> $this->
getItemsPerSec
(),
356
"canDoActions"
=> $this->
isCanDoActions
(),
357
"isInProgress"
=> $this->
isInProgress
(),
358
"isReady"
=> $this->
isReady
(),
359
"download"
=> $this->
getDownload
() ==
null
? null : [
360
"text"
=> $this->
getDownload
()[
"text"
],
361
"link"
=> $this->
getDownload
()[
"link"
]
362
]
363
];
364
}
365
}
Fossology\UI\Api\Models\JobQueue
Model class to hold JobQueue info.
Definition:
JobQueue.php:18
Fossology\UI\Api\Models\JobQueue\setIsReady
setIsReady($isReady)
Definition:
JobQueue.php:310
Fossology\UI\Api\Models\JobQueue\getJSON
getJSON()
Definition:
JobQueue.php:335
Fossology\UI\Api\Models\JobQueue\isInProgress
isInProgress()
Definition:
JobQueue.php:286
Fossology\UI\Api\Models\JobQueue\$isReady
$isReady
Definition:
JobQueue.php:77
Fossology\UI\Api\Models\JobQueue\getStatus
getStatus()
Definition:
JobQueue.php:187
Fossology\UI\Api\Models\JobQueue\setItemsProcessed
setItemsProcessed($itemsProcessed)
Definition:
JobQueue.php:211
Fossology\UI\Api\Models\JobQueue\getDependencies
getDependencies()
Definition:
JobQueue.php:235
Fossology\UI\Api\Models\JobQueue\getDownload
getDownload()
Definition:
JobQueue.php:318
Fossology\UI\Api\Models\JobQueue\setDownload
setDownload($download)
Definition:
JobQueue.php:326
Fossology\UI\Api\Models\JobQueue\$itemsPerSec
$itemsPerSec
Definition:
JobQueue.php:63
Fossology\UI\Api\Models\JobQueue\$download
$download
Definition:
JobQueue.php:82
Fossology\UI\Api\Models\JobQueue\setLog
setLog($log)
Definition:
JobQueue.php:227
Fossology\UI\Api\Models\JobQueue\$dependencies
$dependencies
Definition:
JobQueue.php:58
Fossology\UI\Api\Models\JobQueue\setEndTime
setEndTime($endTime)
Definition:
JobQueue.php:179
Fossology\UI\Api\Models\JobQueue\$itemsProcessed
$itemsProcessed
Definition:
JobQueue.php:48
Fossology\UI\Api\Models\JobQueue\isReady
isReady()
Definition:
JobQueue.php:302
Fossology\UI\Api\Models\JobQueue\getItemsProcessed
getItemsProcessed()
Definition:
JobQueue.php:203
Fossology\UI\Api\Models\JobQueue\getEndTime
getEndTime()
Definition:
JobQueue.php:171
Fossology\UI\Api\Models\JobQueue\setIsInProgress
setIsInProgress($isInProgress)
Definition:
JobQueue.php:294
Fossology\UI\Api\Models\JobQueue\getItemsPerSec
getItemsPerSec()
Definition:
JobQueue.php:254
Fossology\UI\Api\Models\JobQueue\setDependencies
setDependencies($dependencies)
Definition:
JobQueue.php:243
Fossology\UI\Api\Models\JobQueue\setStartTime
setStartTime($startTime)
Definition:
JobQueue.php:163
Fossology\UI\Api\Models\JobQueue\setJobQueueType
setJobQueueType($jobQueueType)
Definition:
JobQueue.php:147
Fossology\UI\Api\Models\JobQueue\setStatus
setStatus($status)
Definition:
JobQueue.php:195
Fossology\UI\Api\Models\JobQueue\setItemsPerSec
setItemsPerSec($itemsPerSec)
Definition:
JobQueue.php:262
Fossology\UI\Api\Models\JobQueue\setJobQueueId
setJobQueueId($jobQueueId)
Definition:
JobQueue.php:131
Fossology\UI\Api\Models\JobQueue\$startTime
$startTime
Definition:
JobQueue.php:33
Fossology\UI\Api\Models\JobQueue\getStartTime
getStartTime()
Definition:
JobQueue.php:155
Fossology\UI\Api\Models\JobQueue\$jobQueueType
$jobQueueType
Definition:
JobQueue.php:28
Fossology\UI\Api\Models\JobQueue\$log
$log
Definition:
JobQueue.php:53
Fossology\UI\Api\Models\JobQueue\getArray
getArray()
Definition:
JobQueue.php:344
Fossology\UI\Api\Models\JobQueue\$isInProgress
$isInProgress
Definition:
JobQueue.php:72
Fossology\UI\Api\Models\JobQueue\isCanDoActions
isCanDoActions()
Definition:
JobQueue.php:270
Fossology\UI\Api\Models\JobQueue\$jobQueueId
$jobQueueId
Definition:
JobQueue.php:23
Fossology\UI\Api\Models\JobQueue\$status
$status
Definition:
JobQueue.php:43
Fossology\UI\Api\Models\JobQueue\getJobQueueId
getJobQueueId()
Definition:
JobQueue.php:123
Fossology\UI\Api\Models\JobQueue\__construct
__construct($jobQueueId, $jobQueueType, $startTime, $endTime, $status, $itemsProcessed, $log, $dependencies, $itemsPerSec, $canDoActions, $isInProgress, $isReady, $download)
Definition:
JobQueue.php:100
Fossology\UI\Api\Models\JobQueue\getJobQueueType
getJobQueueType()
Definition:
JobQueue.php:139
Fossology\UI\Api\Models\JobQueue\$endTime
$endTime
Definition:
JobQueue.php:38
Fossology\UI\Api\Models\JobQueue\getLog
getLog()
Definition:
JobQueue.php:219
Fossology\UI\Api\Models\JobQueue\setCanDoActions
setCanDoActions($canDoActions)
Definition:
JobQueue.php:278
src
www
ui
api
Models
JobQueue.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1