FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Controllers\JobController Class Reference

Controller for Job model. More...

Inheritance diagram for Fossology\UI\Api\Controllers\JobController:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Controllers\JobController:
Collaboration graph

Public Member Functions

 getJobs ($request, $response, $args)
 
 createJob ($request, $response, $args)
 
- Public Member Functions inherited from Fossology\UI\Api\Controllers\RestController
 __construct ($container)
 

Public Attributes

const UPLOAD_PARAM = "upload"
 
const JOB_COMPLETED = 0x1 << 1
 
const JOB_STARTED = 0x1 << 2
 
const JOB_QUEUED = 0x1 << 3
 
const JOB_FAILED = 0x1 << 4
 

Private Member Functions

 getAllResults ($id, $response, $limit, $page)
 
 getFilteredResults ($uploadId, $response, $limit, $page)
 
 updateEtaAndStatus (&$job)
 
 getUploadEtaInSeconds ($jobId, $uploadId)
 
 getJobStatus ($jobqueue)
 

Additional Inherited Members

- Protected Attributes inherited from Fossology\UI\Api\Controllers\RestController
 $container
 
 $restHelper
 
 $dbHelper
 

Detailed Description

Controller for Job model.

Definition at line 40 of file JobController.php.

Member Function Documentation

Fossology\UI\Api\Controllers\JobController::createJob (   $request,
  $response,
  $args 
)

Create a new job

Parameters
ServerRequestInterface$request
ResponseInterface$response
array$args
Returns
ResponseInterface

Definition at line 123 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::getAllResults (   $id,
  $response,
  $limit,
  $page 
)
private

Get all jobs for the current user.

Parameters
integer | null$idSpecific job id or null for all jobs
ResponseInterface$responseResponse object
integer$limitLimit of jobs per page
integer$pagePage number required
Returns
ResponseInterface

Definition at line 179 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::getFilteredResults (   $uploadId,
  $response,
  $limit,
  $page 
)
private

Get all jobs for the given upload.

Parameters
integer$uploadIdUpload id to be filtered
ResponseInterface$responseResponse object
integer$limitLimit of jobs per page
integer$pagePage number required
Returns
ResponseInterface

Definition at line 202 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::getJobs (   $request,
  $response,
  $args 
)

Get all jobs by a user

Parameters
ServerRequestInterface$request
ResponseInterface$response
array$args
Returns
ResponseInterface

Definition at line 70 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::getJobStatus (   $jobqueue)
private

Get the job status based on jobqueue.

Parameters
array$jobqueueThe job queue with job id as values
Returns
string Job status (Completed, Processing, Queued or Failed)

Definition at line 277 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::getUploadEtaInSeconds (   $jobId,
  $uploadId 
)
private

Get the ETA in seconds for the upload.

Parameters
integer$jobIdThe job ID for which the ETA is required
integer$uploadIdUpload for which the ETA is required
Returns
integer ETA in seconds (0 if job already finished)

Definition at line 258 of file JobController.php.

Fossology\UI\Api\Controllers\JobController::updateEtaAndStatus ( $job)
private

Update the ETA and status for the given job

Parameters
[in,out]Job$jobThe job to be updated

Definition at line 223 of file JobController.php.

Member Data Documentation

const Fossology\UI\Api\Controllers\JobController::JOB_COMPLETED = 0x1 << 1

Job completed successfully

Definition at line 49 of file JobController.php.

const Fossology\UI\Api\Controllers\JobController::JOB_FAILED = 0x1 << 4

Job failed

Definition at line 61 of file JobController.php.

const Fossology\UI\Api\Controllers\JobController::JOB_QUEUED = 0x1 << 3

Job waiting to be queued

Definition at line 57 of file JobController.php.

const Fossology\UI\Api\Controllers\JobController::JOB_STARTED = 0x1 << 2

Job started by scheduler

Definition at line 53 of file JobController.php.

const Fossology\UI\Api\Controllers\JobController::UPLOAD_PARAM = "upload"

Get query parameter name for upload filtering

Definition at line 45 of file JobController.php.


The documentation for this class was generated from the following file: