FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\DecisionImporter\DecisionImporterDataCreator Class Reference
Collaboration diagram for Fossology\DecisionImporter\DecisionImporterDataCreator:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, AgentDao $agentDao, CopyrightDao $copyrightDao, LicenseDao $licenseDao, UploadDao $uploadDao, ClearingDao $clearingDao)
 
 setUserId (int $userId)
 
 setGroupId (int $groupId)
 
 setUploadId (int $uploadId)
 
 createClearingDecisions (FoDecisionData &$reportData, DecisionImporterAgent &$agentObj)
 
 createReportData (FoDecisionData &$reportData)
 
 createCopyrightData (FoDecisionData &$reportData, DecisionImporterAgent &$agentObj, string $agentName, int $jobId)
 Create copyright and sibling agent's related data in DB. More...
 
 createMonkBulkData (FoDecisionData &$reportData, DecisionImporterAgent &$agentObj)
 Create monkbulk findings from the report. More...
 
 createMainLicenses (FoDecisionData &$reportData, int $uploadId, int $groupId)
 

Private Member Functions

 createCxJobs (string $agentName, int $currentJobId, int $agentId)
 
 getClearingEventForLrb (array $clearingEventList, int $oldLrbId)
 
 createMonkBulkJobs (int $bulkId)
 

Private Attributes

 $dbManager
 
 $agentDao
 
 $copyrightDao
 
 $licenseDao
 
 $uploadDao
 
 $clearingDao
 
 $userId
 
 $groupId
 
 $uploadId
 

Detailed Description

This class contains all the helper functions to create data from JSON report in database.

Definition at line 30 of file DecisionImporterDataCreator.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\DecisionImporter\DecisionImporterDataCreator::__construct ( DbManager  $dbManager,
AgentDao  $agentDao,
CopyrightDao  $copyrightDao,
LicenseDao  $licenseDao,
UploadDao  $uploadDao,
ClearingDao  $clearingDao 
)
Parameters
DbManager$dbManagerDbManager to use
AgentDao$agentDaoAgentDao to use
CopyrightDao$copyrightDaoCopyrightDao to use
LicenseDao$licenseDaoLicenseDao to use
UploadDao$uploadDaoUploadDao to use
ClearingDao$clearingDaoClearingDao to use

Definition at line 94 of file DecisionImporterDataCreator.php.

Member Function Documentation

◆ createClearingDecisions()

Fossology\DecisionImporter\DecisionImporterDataCreator::createClearingDecisions ( FoDecisionData $reportData,
DecisionImporterAgent $agentObj 
)

It creates the clearing decisions and events from the report.

Parameters
FoDecisionData$reportDataThe FoDecisionData object that contains the data to be imported.
DecisionImporterAgent$agentObjAgent object to send heartbeats

Definition at line 135 of file DecisionImporterDataCreator.php.

◆ createCopyrightData()

Fossology\DecisionImporter\DecisionImporterDataCreator::createCopyrightData ( FoDecisionData $reportData,
DecisionImporterAgent $agentObj,
string  $agentName,
int  $jobId 
)

Create copyright and sibling agent's related data in DB.

Take the report data and create an entry for the agent in job queue. It then imports the agent data from report. It then creates records for decisions and events.

Parameters
FoDecisionData$reportDataThe report data object.
DecisionImporterAgent$agentObjAgent object to send heartbeats
string$agentNameThe name of the agent. (can be "copyright", "ecc" or "ipra")
int$jobIdCurrent job id

Definition at line 275 of file DecisionImporterDataCreator.php.

◆ createCxJobs()

Fossology\DecisionImporter\DecisionImporterDataCreator::createCxJobs ( string  $agentName,
int  $currentJobId,
int  $agentId 
)
private

It creates a job for the agent or return if it already exists. Thn marks it as completed, and then writes the agent record to the database.

Parameters
string$agentNameThe name of the agent to create a job for.
int$currentJobIdThe job queue id of the current job.
int$agentIdThe latest agent ID of the agent you want to run.

Definition at line 400 of file DecisionImporterDataCreator.php.

◆ createMainLicenses()

Fossology\DecisionImporter\DecisionImporterDataCreator::createMainLicenses ( FoDecisionData $reportData,
int  $uploadId,
int  $groupId 
)

Create main license entries for the upload

Parameters
FoDecisionData$reportData
int$uploadId
int$groupId

Definition at line 568 of file DecisionImporterDataCreator.php.

◆ createMonkBulkData()

Fossology\DecisionImporter\DecisionImporterDataCreator::createMonkBulkData ( FoDecisionData $reportData,
DecisionImporterAgent $agentObj 
)

Create monkbulk findings from the report.

  1. Create license_ref_bulk and license_set_bulk entries.
  2. Create the job for monkbulk and deciderjob.
  3. Update clearing_event entries with job_fk
  4. Create highlight_bulk entries.
    Parameters
    FoDecisionData$reportData
    DecisionImporterAgent$agentObj

Definition at line 429 of file DecisionImporterDataCreator.php.

◆ createMonkBulkJobs()

Fossology\DecisionImporter\DecisionImporterDataCreator::createMonkBulkJobs ( int  $bulkId)
private

It creates a job and job queue for the monkbulk job agents. Then marks them as completed, and writes the agent ars records to the database.

Parameters
int$bulkIdlicense_ref_bulk ID to create jobs for.
Returns
int Job id

Definition at line 536 of file DecisionImporterDataCreator.php.

◆ createReportData()

Fossology\DecisionImporter\DecisionImporterDataCreator::createReportData ( FoDecisionData $reportData)

Insert report conf data from report into the database

Parameters
FoDecisionData$reportDataThe report data object.

Definition at line 225 of file DecisionImporterDataCreator.php.

◆ getClearingEventForLrb()

Fossology\DecisionImporter\DecisionImporterDataCreator::getClearingEventForLrb ( array  $clearingEventList,
int  $oldLrbId 
)
private

From the clearing event list, get the old clearing event id for a given license_ref_bulk id

Parameters
array$clearingEventList
int$oldLrbId
Returns
int|null Old clearing event id if found, null otherwise.

Definition at line 520 of file DecisionImporterDataCreator.php.

◆ setGroupId()

Fossology\DecisionImporter\DecisionImporterDataCreator::setGroupId ( int  $groupId)
Parameters
int$groupId

Definition at line 116 of file DecisionImporterDataCreator.php.

◆ setUploadId()

Fossology\DecisionImporter\DecisionImporterDataCreator::setUploadId ( int  $uploadId)
Parameters
int$uploadId

Definition at line 124 of file DecisionImporterDataCreator.php.

◆ setUserId()

Fossology\DecisionImporter\DecisionImporterDataCreator::setUserId ( int  $userId)
Parameters
int$userId

Definition at line 108 of file DecisionImporterDataCreator.php.

Member Data Documentation

◆ $agentDao

AgentDao Fossology\DecisionImporter\DecisionImporterDataCreator::$agentDao
private

AgentDao object

Definition at line 42 of file DecisionImporterDataCreator.php.

◆ $clearingDao

ClearingDao Fossology\DecisionImporter\DecisionImporterDataCreator::$clearingDao
private

ClearingDao object

Definition at line 66 of file DecisionImporterDataCreator.php.

◆ $copyrightDao

CopyrightDao Fossology\DecisionImporter\DecisionImporterDataCreator::$copyrightDao
private

CopyrightDao object

Definition at line 48 of file DecisionImporterDataCreator.php.

◆ $dbManager

DbManager Fossology\DecisionImporter\DecisionImporterDataCreator::$dbManager
private

DbManager object

Definition at line 36 of file DecisionImporterDataCreator.php.

◆ $groupId

int Fossology\DecisionImporter\DecisionImporterDataCreator::$groupId
private

Group ID to use while creating records.

Definition at line 78 of file DecisionImporterDataCreator.php.

◆ $licenseDao

LicenseDao Fossology\DecisionImporter\DecisionImporterDataCreator::$licenseDao
private

LicenseDao object

Definition at line 54 of file DecisionImporterDataCreator.php.

◆ $uploadDao

UploadDao Fossology\DecisionImporter\DecisionImporterDataCreator::$uploadDao
private

UploadDao object

Definition at line 60 of file DecisionImporterDataCreator.php.

◆ $uploadId

int Fossology\DecisionImporter\DecisionImporterDataCreator::$uploadId
private

Upload for which import is working.

Definition at line 84 of file DecisionImporterDataCreator.php.

◆ $userId

int Fossology\DecisionImporter\DecisionImporterDataCreator::$userId
private

User ID to use while creating records.

Definition at line 72 of file DecisionImporterDataCreator.php.


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