FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Reuser\ReuserAgent Class Reference

The reuser agent. More...

Inheritance diagram for Fossology\Reuser\ReuserAgent:
Inheritance graph
Collaboration diagram for Fossology\Reuser\ReuserAgent:
Collaboration graph

Public Member Functions

 processUploadId ($uploadId)
 Get the upload items and reuse based on reuse mode. More...
 
 mapByClearingId ($clearingDecisions)
 Map clearing decisions by clearing id. 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...
 

Protected Member Functions

 reuseConfSettings ($uploadId, $reusedUploadId)
 
 reuseMainLicense ($uploadId, $groupId, $reusedUploadId, $reusedGroupId)
 Reuse main license from previous upload. More...
 
 reuseCopyrights ($uploadId, $reusedUploadId)
 Reuse deactivated Copyrights from previous upload. More...
 
 processEnhancedUploadReuse ($itemTreeBounds, $itemTreeBoundsReused, $reusedGroupId)
 Get clearing decisions and use copyClearingDecisionIfDifferenceIsSmall() More...
 
 copyClearingDecisionIfDifferenceIsSmall ($reusedPath, $newPath, $clearingDecision, $itemId)
 Use diff tool to compare files. More...
 
 mapByFileId ($clearingDecisions)
 Maps clearing decisions by file id. More...
 

Private Attributes

 $uploadDao
 
 $clearingEventProcessor
 
 $agentLicenseEventProcessor
 
 $clearingDecisionFilter
 
 $clearingDecisionProcessor
 
 $clearingDao
 
 $copyrightDao
 
 $aagentDao
 
 $decisionTypes
 

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...
 
- Protected Attributes inherited from Fossology\Lib\Agent\Agent
 $userId
 
 $groupId
 
 $jobId
 
 $agentSpecifOptions = ""
 
 $agentSpecifLongOptions = array()
 
 $args = array()
 
 $dbManager
 
 $agentDao
 
 $container
 
 $schedulerMode
 

Detailed Description

The reuser agent.

Definition at line 36 of file ReuserAgent.php.

Member Function Documentation

◆ copyClearingDecisionIfDifferenceIsSmall()

Fossology\Reuser\ReuserAgent::copyClearingDecisionIfDifferenceIsSmall (   $reusedPath,
  $newPath,
  $clearingDecision,
  $itemId 
)
protected

Use diff tool to compare files.

Uses diff tool to compare two files. If the line difference is less than 5, then reuser copy the decisions.

Parameters
string$reusedPath
string$newPath
ClearingDecision$clearingDecisionArray of clearing decisions
int$itemId
Exceptions

Definition at line 343 of file ReuserAgent.php.

◆ mapByClearingId()

Fossology\Reuser\ReuserAgent::mapByClearingId (   $clearingDecisions)

Map clearing decisions by clearing id.

Creates array with clearing ids as key and ClearingDecision object as value

Parameters
ClearingDecision$clearingDecisionsArray of clearing decisions
Returns
ClearingDecision[]

Definition at line 417 of file ReuserAgent.php.

◆ mapByFileId()

Fossology\Reuser\ReuserAgent::mapByFileId (   $clearingDecisions)
protected

Maps clearing decisions by file id.

Creates array with file ids as key and ClearingDecision object as value

Parameters
ClearingDecision$clearingDecisionsArray of clearing decisions
Returns
ClearingDecision[]

Definition at line 362 of file ReuserAgent.php.

◆ processEnhancedUploadReuse()

Fossology\Reuser\ReuserAgent::processEnhancedUploadReuse (   $itemTreeBounds,
  $itemTreeBoundsReused,
  $reusedGroupId 
)
protected

Get clearing decisions and use copyClearingDecisionIfDifferenceIsSmall()

Parameters
ItemTreeBounds$itemTreeBoundsCurrent upload
ItemTreeBounds$itemTreeBoundsReusedReused upload
int$reusedGroupId
See also
copyClearingDecisionIfDifferenceIsSmall()

Definition at line 295 of file ReuserAgent.php.

◆ processUploadId()

Fossology\Reuser\ReuserAgent::processUploadId (   $uploadId)

Get the upload items and reuse based on reuse mode.

Parameters
int$uploadIdUpload id to process
See also
Fossology::Lib::Agent::Agent::processUploadId()

Reimplemented from Fossology\Lib\Agent\Agent.

Definition at line 94 of file ReuserAgent.php.

◆ reuseCopyrights()

Fossology\Reuser\ReuserAgent::reuseCopyrights (   $uploadId,
  $reusedUploadId 
)
protected

Reuse deactivated Copyrights from previous upload.

Get add the main licenses from previous upload and make them in new upload

Parameters
int$uploadIdCurrent upload
int$reusedUploadIdUpload to reuse
Returns
boolean True once finished

Definition at line 195 of file ReuserAgent.php.

◆ reuseMainLicense()

Fossology\Reuser\ReuserAgent::reuseMainLicense (   $uploadId,
  $groupId,
  $reusedUploadId,
  $reusedGroupId 
)
protected

Reuse main license from previous upload.

Get add the main licenses from previous upload and make them in new upload

Parameters
int$uploadIdCurrent upload
int$groupIdCurrent user
int$reusedUploadIdUpload to reuse
int$reusedGroupIdGroup of reused upload
Returns
boolean True once finished

Definition at line 149 of file ReuserAgent.php.

Member Data Documentation

◆ $aagentDao

AgentDao Fossology\Reuser\ReuserAgent::$aagentDao
private

AgentDao object

Definition at line 69 of file ReuserAgent.php.

◆ $agentLicenseEventProcessor

AgentLicenseEventProcessor Fossology\Reuser\ReuserAgent::$agentLicenseEventProcessor
private

AgentLicenseEventProcessor object

Definition at line 49 of file ReuserAgent.php.

◆ $clearingDao

ClearingDao Fossology\Reuser\ReuserAgent::$clearingDao
private

ClearingDao object

Definition at line 61 of file ReuserAgent.php.

◆ $clearingDecisionFilter

ClearingDecisionFilter Fossology\Reuser\ReuserAgent::$clearingDecisionFilter
private

ClearingDecisionFilter object

Definition at line 53 of file ReuserAgent.php.

◆ $clearingDecisionProcessor

ClearingDecisionProcessor Fossology\Reuser\ReuserAgent::$clearingDecisionProcessor
private

ClearingDecisionProcessor object

Definition at line 57 of file ReuserAgent.php.

◆ $clearingEventProcessor

ClearingEventProcessor Fossology\Reuser\ReuserAgent::$clearingEventProcessor
private

ClearingEventProcessor object

Definition at line 45 of file ReuserAgent.php.

◆ $copyrightDao

CopyrightDao Fossology\Reuser\ReuserAgent::$copyrightDao
private

CopyrightDao object

Definition at line 65 of file ReuserAgent.php.

◆ $decisionTypes

DecisionTypes Fossology\Reuser\ReuserAgent::$decisionTypes
private

DecisionTypes object

Definition at line 73 of file ReuserAgent.php.

◆ $uploadDao

UploadDao Fossology\Reuser\ReuserAgent::$uploadDao
private

UploadDao object

Definition at line 41 of file ReuserAgent.php.


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