Controller for Job model.
More...
|
| getAllUserResults ($id, $uid, $request, $response, $limit, $page, $apiVersion) |
|
| getAllResults ($id, $request, $response, $limit, $page, $apiVersion) |
|
| getFilteredResults ($uploadId, $request, $response, $limit, $page, $apiVersion) |
|
| updateEtaAndStatus (&$job) |
|
| getUploadEtaInSeconds ($jobId, $uploadId) |
|
| getJobStatus ($jobqueue) |
|
| addJobQueue (&$job, $request=null) |
|
| compareJobsInfo ($JobsInfo1, $JobsInfo2) |
| Sort compare function to order $JobsInfo by job_pk. More...
|
|
| sortJobsByDate ($job1, $job2) |
| Sort compare function to order $JobsInfo by jobqueue start time. More...
|
|
Controller for Job model.
Definition at line 37 of file JobController.php.
◆ addJobQueue()
Fossology\UI\Api\Controllers\JobController::addJobQueue |
( |
& |
$job, |
|
|
|
$request = null |
|
) |
| |
|
private |
Add the job queue to the job object
- Parameters
-
[in,out] | Job | $job | The job to be updated |
| Request | $request | The request object |
Definition at line 522 of file JobController.php.
◆ compareJobsInfo()
Fossology\UI\Api\Controllers\JobController::compareJobsInfo |
( |
|
$JobsInfo1, |
|
|
|
$JobsInfo2 |
|
) |
| |
|
private |
Sort compare function to order $JobsInfo by job_pk.
- Parameters
-
array | $JobsInfo1 | Result from GetJobInfo |
array | $JobsInfo2 | Result from GetJobInfo |
- Returns
- int
Definition at line 555 of file JobController.php.
◆ createJob()
Fossology\UI\Api\Controllers\JobController::createJob |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Create a new job
- Parameters
-
ServerRequestInterface | $request | |
ResponseHelper | $response | |
array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 160 of file JobController.php.
◆ deleteJob()
Fossology\UI\Api\Controllers\JobController::deleteJob |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Delete a job using it's Job ID and Queue ID. Job ID is job_pk in job table and Queue ID is jobqueue_pk in jobqueue table
- Parameters
-
ServerRequestInterface | $request | |
ResponseHelper | $response | |
array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 197 of file JobController.php.
◆ getAllJobs()
Fossology\UI\Api\Controllers\JobController::getAllJobs |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Get all jobs created by all the users
- Parameters
-
ServerRequestInterface | $request | |
ResponseHelper | $response | |
array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 69 of file JobController.php.
◆ getAllResults()
Fossology\UI\Api\Controllers\JobController::getAllResults |
( |
|
$id, |
|
|
|
$request, |
|
|
|
$response, |
|
|
|
$limit, |
|
|
|
$page, |
|
|
|
$apiVersion |
|
) |
| |
|
private |
Get all jobs for the current user.
- Parameters
-
integer | null | $id | Specific job id or null for all jobs |
Request | $request | Request object |
ResponseHelper | $response | Response object |
integer | $limit | Limit of jobs per page |
integer | $page | Page number required |
integer | $apiVersion | API version |
- Returns
- ResponseHelper
Definition at line 290 of file JobController.php.
◆ getAllUserResults()
Fossology\UI\Api\Controllers\JobController::getAllUserResults |
( |
|
$id, |
|
|
|
$uid, |
|
|
|
$request, |
|
|
|
$response, |
|
|
|
$limit, |
|
|
|
$page, |
|
|
|
$apiVersion |
|
) |
| |
|
private |
Get all jobs created by the current user.
- Parameters
-
integer | null | $id | Specific job id or null for all jobs |
integer | $uid | Specific user id |
Request | $request | Request object |
ResponseHelper | $response | Response object |
integer | $limit | Limit of jobs per page |
integer | $page | Page number required |
integer | $apiVersion | API version |
- Returns
- ResponseHelper
Definition at line 260 of file JobController.php.
◆ getFilteredResults()
Fossology\UI\Api\Controllers\JobController::getFilteredResults |
( |
|
$uploadId, |
|
|
|
$request, |
|
|
|
$response, |
|
|
|
$limit, |
|
|
|
$page, |
|
|
|
$apiVersion |
|
) |
| |
|
private |
Get all jobs for the given upload.
- Parameters
-
integer | $uploadId | Upload id to be filtered |
Request | $request | Request object |
ResponseHelper | $response | Response object |
integer | $limit | Limit of jobs per page |
integer | $page | Page number required |
integer | $apiVersion | API version |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 321 of file JobController.php.
◆ getJobs()
Fossology\UI\Api\Controllers\JobController::getJobs |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Get all jobs by a user
- Parameters
-
ServerRequestInterface | $request | |
ResponseHelper | $response | |
array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 105 of file JobController.php.
◆ getJobStatus()
Fossology\UI\Api\Controllers\JobController::getJobStatus |
( |
|
$jobqueue | ) |
|
|
private |
Get the job status based on jobqueue.
- Parameters
-
array | $jobqueue | The job queue with job id as values |
- Returns
- string Job status (Completed, Processing, Queued or Failed)
Definition at line 384 of file JobController.php.
◆ getUploadEtaInSeconds()
Fossology\UI\Api\Controllers\JobController::getUploadEtaInSeconds |
( |
|
$jobId, |
|
|
|
$uploadId |
|
) |
| |
|
private |
Get the ETA in seconds for the upload.
- Parameters
-
integer | $jobId | The job ID for which the ETA is required |
integer | $uploadId | Upload for which the ETA is required |
- Returns
- integer ETA in seconds (0 if job already finished)
Definition at line 365 of file JobController.php.
◆ sortJobsByDate()
Fossology\UI\Api\Controllers\JobController::sortJobsByDate |
( |
|
$job1, |
|
|
|
$job2 |
|
) |
| |
|
private |
Sort compare function to order $JobsInfo by jobqueue start time.
- Parameters
-
array | $job1 | Result from finalJobs |
array | $job2 | Result from finalJobs |
- Returns
- int
Definition at line 566 of file JobController.php.
◆ updateEtaAndStatus()
Fossology\UI\Api\Controllers\JobController::updateEtaAndStatus |
( |
& |
$job | ) |
|
|
private |
Update the ETA and status for the given job
- Parameters
-
[in,out] | Job | $job | The job to be updated |
Definition at line 345 of file JobController.php.
◆ JOB_COMPLETED
const Fossology\UI\Api\Controllers\JobController::JOB_COMPLETED = 0x1 << 1 |
◆ JOB_FAILED
const Fossology\UI\Api\Controllers\JobController::JOB_FAILED = 0x1 << 4 |
◆ JOB_QUEUED
const Fossology\UI\Api\Controllers\JobController::JOB_QUEUED = 0x1 << 3 |
◆ JOB_STARTED
const Fossology\UI\Api\Controllers\JobController::JOB_STARTED = 0x1 << 2 |
◆ UPLOAD_PARAM
const Fossology\UI\Api\Controllers\JobController::UPLOAD_PARAM = "upload" |
The documentation for this class was generated from the following file: