FOSSology  3.2.0rc1
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...
 
 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...
 
- Protected Member Functions inherited from Fossology\Lib\Agent\Agent
 processUploadId ($uploadId)
 Given an upload ID, process the items in it. More...
 

Private Attributes

 $uploadDao
 
 $clearingEventProcessor
 
 $agentLicenseEventProcessor
 
 $clearingDecisionFilter
 
 $clearingDecisionProcessor
 
 $clearingDao
 
 $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 44 of file ReuserAgent.php.

Member Function Documentation

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 254 of file ReuserAgent.php.

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 328 of file ReuserAgent.php.

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 273 of file ReuserAgent.php.

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 214 of file ReuserAgent.php.

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()

Definition at line 92 of file ReuserAgent.php.

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 142 of file ReuserAgent.php.

Member Data Documentation

AgentLicenseEventProcessor Fossology\Reuser\ReuserAgent::$agentLicenseEventProcessor
private

AgentLicenseEventProcessor object

Definition at line 57 of file ReuserAgent.php.

ClearingDao Fossology\Reuser\ReuserAgent::$clearingDao
private

ClearingDao object

Definition at line 69 of file ReuserAgent.php.

ClearingDecisionFilter Fossology\Reuser\ReuserAgent::$clearingDecisionFilter
private

ClearingDecisionFilter object

Definition at line 61 of file ReuserAgent.php.

ClearingDecisionProcessor Fossology\Reuser\ReuserAgent::$clearingDecisionProcessor
private

ClearingDecisionProcessor object

Definition at line 65 of file ReuserAgent.php.

ClearingEventProcessor Fossology\Reuser\ReuserAgent::$clearingEventProcessor
private

ClearingEventProcessor object

Definition at line 53 of file ReuserAgent.php.

DecisionTypes Fossology\Reuser\ReuserAgent::$decisionTypes
private

DecisionTypes object

Definition at line 73 of file ReuserAgent.php.

UploadDao Fossology\Reuser\ReuserAgent::$uploadDao
private

UploadDao object

Definition at line 49 of file ReuserAgent.php.


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