FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\CycloneDX\CycloneDXAgent Class Reference
Inheritance diagram for Fossology\CycloneDX\CycloneDXAgent:
Inheritance graph
Collaboration diagram for Fossology\CycloneDX\CycloneDXAgent:
Collaboration graph

Public Member Functions

 processUploadId ($uploadId)
 Given an upload ID, process the items in it. More...
 
- Public Member Functions inherited from Fossology\Lib\Agent\Agent
 __construct ($agentName, $version, $revision)
 
 scheduler_connect ()
 Connect with scheduler and initialize options. More...
 
 heartbeat ($newProcessed)
 Send hear beat to the scheduler. More...
 
 bail ($exitvalue)
 Bail the agent, print the stack and disconnect from scheduler. More...
 
 scheduler_disconnect ($exitvalue)
 Closes connection from scheduler. More...
 
 scheduler_greet ()
 Greet the scheduler at the beginning of connection. More...
 
 initArsTable ()
 Initialize ARS table.
 
 run_scheduler_event_loop ()
 Runs a loop to read commands from scheduler and process them. More...
 

Public Attributes

const OUTPUT_FORMAT_KEY = "outputFormat"
 Argument key for output format.
 
const DEFAULT_OUTPUT_FORMAT = "cyclonedx_json"
 Default output format.
 

Protected Member Functions

 getUri ($fileBase)
 Get the URI for the given package. More...
 
 computeUri ($uploadId)
 For a given upload, compute the URI. More...
 
 renderPackage ($uploadId)
 Given an upload id, render the report string. More...
 
 generateFileComponents ($filesWithLicenses, $treeTableName, $uploadId, $itemTreeBounds)
 Generate the components by files. More...
 
 writeReport ($packageNodes, $uploadId)
 Write the report the file and update report table. More...
 
 updateReportTable ($uploadId, $jobId, $fileName)
 Update the reportgen table with new report path. More...
 
 getMimeType ($uploadId)
 Get the mime type of the upload. More...
 

Protected Attributes

 $dbManager
 
 $agentNames = AgentRef::AGENT_LIST
 
 $uri
 
 $outputFormat = self::DEFAULT_OUTPUT_FORMAT
 
- Protected Attributes inherited from Fossology\Lib\Agent\Agent
 $userId
 
 $groupId
 
 $jobId
 
 $agentSpecifOptions = ""
 
 $agentSpecifLongOptions = array()
 
 $args = array()
 
 $dbManager
 
 $agentDao
 
 $container
 
 $schedulerMode
 

Private Attributes

 $reportGenerator
 
 $reportutils
 
 $uploadDao
 
 $clearingDao
 
 $licenseDao
 
 $licenseMap
 
 $licensesInDocument = []
 
 $packageName
 

Additional Inherited Members

- Static Public Member Functions inherited from Fossology\Lib\Agent\Agent
static heartbeat_handler ($signo)
 Function to handle hear beats from the agent and send them to the scheduler from STDOUT. More...
 

Detailed Description

Definition at line 41 of file cyclonedx.php.

Member Function Documentation

◆ computeUri()

Fossology\CycloneDX\CycloneDXAgent::computeUri (   $uploadId)
protected

For a given upload, compute the URI.

Parameters
int$uploadId

Definition at line 152 of file cyclonedx.php.

◆ generateFileComponents()

Fossology\CycloneDX\CycloneDXAgent::generateFileComponents (   $filesWithLicenses,
  $treeTableName,
  $uploadId,
  $itemTreeBounds 
)
protected

Generate the components by files.

Parameters
FileNode[]$filesWithLicenses
string$treeTableName
int$uploadId
Returns
array Components list

Definition at line 246 of file cyclonedx.php.

◆ getMimeType()

Fossology\CycloneDX\CycloneDXAgent::getMimeType (   $uploadId)
protected

Get the mime type of the upload.

Returns
string Mime type of the upload

Definition at line 352 of file cyclonedx.php.

◆ getUri()

Fossology\CycloneDX\CycloneDXAgent::getUri (   $fileBase)
protected

Get the URI for the given package.

Parameters
string$fileBaseName of the upload
Returns
string URI for the upload

Definition at line 142 of file cyclonedx.php.

◆ processUploadId()

Fossology\CycloneDX\CycloneDXAgent::processUploadId (   $uploadId)

Given an upload ID, process the items in it.

This function is implemented by agent and should call heartbeat() at regular intervals.

Parameters
int$uploadIdUpload to be processed by the agent.
Returns
bool Process status
See also
Fossology::Lib::Agent::Agent::processUploadId()

Reimplemented from Fossology\Lib\Agent\Agent.

Definition at line 125 of file cyclonedx.php.

◆ renderPackage()

Fossology\CycloneDX\CycloneDXAgent::renderPackage (   $uploadId)
protected

Given an upload id, render the report string.

Parameters
int$uploadId
Returns
array Rendered report string

Definition at line 168 of file cyclonedx.php.

◆ updateReportTable()

Fossology\CycloneDX\CycloneDXAgent::updateReportTable (   $uploadId,
  $jobId,
  $fileName 
)
protected

Update the reportgen table with new report path.

Parameters
int$uploadIdUpload id
int$jobIdJob id
string$fileNameFile name of the report

Definition at line 341 of file cyclonedx.php.

◆ writeReport()

Fossology\CycloneDX\CycloneDXAgent::writeReport (   $packageNodes,
  $uploadId 
)
protected

Write the report the file and update report table.

Parameters
array$packageNodes
int$uploadId

Definition at line 318 of file cyclonedx.php.

Member Data Documentation

◆ $agentNames

array Fossology\CycloneDX\CycloneDXAgent::$agentNames = AgentRef::AGENT_LIST
protected

Agent names mapping

Definition at line 79 of file cyclonedx.php.

◆ $clearingDao

ClearingDao Fossology\CycloneDX\CycloneDXAgent::$clearingDao
private

ClearingDao object

Definition at line 62 of file cyclonedx.php.

◆ $dbManager

DbManager Fossology\CycloneDX\CycloneDXAgent::$dbManager
protected

DbManager object

Definition at line 71 of file cyclonedx.php.

◆ $licenseDao

LicenseDao Fossology\CycloneDX\CycloneDXAgent::$licenseDao
private

LicenseDao object

Definition at line 67 of file cyclonedx.php.

◆ $licenseMap

LicenseMap Fossology\CycloneDX\CycloneDXAgent::$licenseMap
private

LicenseMap object

Definition at line 75 of file cyclonedx.php.

◆ $licensesInDocument

SpdxLicenseInfo[] Fossology\CycloneDX\CycloneDXAgent::$licensesInDocument = []
private

List of licenses found in the document.

Definition at line 88 of file cyclonedx.php.

◆ $outputFormat

string Fossology\CycloneDX\CycloneDXAgent::$outputFormat = self::DEFAULT_OUTPUT_FORMAT
protected

Output format of the report

Definition at line 92 of file cyclonedx.php.

◆ $reportGenerator

BomReportGenerator Fossology\CycloneDX\CycloneDXAgent::$reportGenerator
private

UploadDao object

Definition at line 49 of file cyclonedx.php.

◆ $reportutils

ReportUtils Fossology\CycloneDX\CycloneDXAgent::$reportutils
private

ReportUtils object

Definition at line 54 of file cyclonedx.php.

◆ $uploadDao

UploadDao Fossology\CycloneDX\CycloneDXAgent::$uploadDao
private

UploadDao object

Definition at line 58 of file cyclonedx.php.

◆ $uri

string Fossology\CycloneDX\CycloneDXAgent::$uri
protected

URI of the file

Definition at line 83 of file cyclonedx.php.


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