FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Decider\DeciderAgent Class Reference

Agent to decide license findings in an upload. More...

Inheritance diagram for Fossology\Decider\DeciderAgent:
Inheritance graph
Collaboration diagram for Fossology\Decider\DeciderAgent:
Collaboration graph

Public Member Functions

 __construct ($licenseMapUsage=null)
 
 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 RULES_NOMOS_IN_MONK = 0x1
 
const RULES_NOMOS_MONK_NINKA = 0x2
 
const RULES_BULK_REUSE = 0x4
 
const RULES_WIP_SCANNER_UPDATES = 0x8
 
const RULES_OJO_NO_CONTRADICTION = 0x10
 
const RULES_COPYRIGHT_FALSE_POSITIVE = 0x20
 
const RULES_COPYRIGHT_FALSE_POSITIVE_CLUTTER = 0x40
 
const RULES_ALL = 0xff
 

Protected Member Functions

 remapByProjectedId ($matches)
 Given a set of matches, remap according to project id instead of license id. More...
 
 areNomosMonkNinkaAgreed ($licenseMatches)
 Check if findings by all agents are same or not. More...
 
 getLicenseIdsOfMatchesForScanner ($scanner, $licenseMatches)
 extracts the matches corresponding to a scanner from a $licenseMatches structure More...
 
 areOtherScannerFindingsAndOJOAgreed ($licenseMatches)
 Check if the finding by only contains one single license and that no other scanner (nomos) has produced a contradicting statement. More...
 
 areOtherScannerFindingsAndRESOAgreed ($licenseMatches)
 Check if the finding by only contains one single license and that no other scanner (nomos) has produced a contradicting statement. More...
 

Private Member Functions

 processItem (Item $item)
 Given an item, check with the $activeRules and apply rules to it. More...
 
 existsUnhandledMatch ($projectedScannerMatches, $licensesFromDecision)
 Check if matches contains unhandled match. More...
 
 autodecideIfOjoMatchesNoContradiction (ItemTreeBounds $itemTreeBounds, $matches)
 Auto decide matches which are in nomos, monk and OJO findings. More...
 
 autodecideIfResoMatchesNoContradiction (ItemTreeBounds $itemTreeBounds, $matches)
 Auto decide matches which are in nomos, monk, OJO and Reso findings. More...
 
 autodecideNomosMonkNinka (ItemTreeBounds $itemTreeBounds, $matches)
 Auto decide matches which are in nomos, monk and ninka findings. More...
 
 autodecideNomosMatchesInsideMonk (ItemTreeBounds $itemTreeBounds, $matches)
 Auto decide matches by nomos which are in monk findings. More...
 
 isRegionIncluded ($small, $big)
 Check if the small highlight region is inside big one. More...
 
 areNomosMatchesInsideAMonkMatch ($licenseMatches)
 Check if matches by nomos are inside monk findings. More...
 
 getCopyrightsToDisableFalsePositivesClutter ($uploadId, $clutter_flag)
 
 callCopyrightDeactivationClutterRemovalScript ($tmpFilePath, $clutter_flag)
 

Private Attributes

 $activeRules
 
 $uploadDao
 
 $clearingDecisionProcessor
 
 $agentLicenseEventProcessor
 
 $clearingDao
 
 $highlightDao
 
 $showJobsDao
 
 $decisionTypes
 
 $licenseMap = null
 
 $licenseMapUsage = null
 
 $copyrightDao
 

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

Agent to decide license findings in an upload.

Definition at line 69 of file DeciderAgent.php.

Member Function Documentation

◆ areNomosMatchesInsideAMonkMatch()

Fossology\Decider\DeciderAgent::areNomosMatchesInsideAMonkMatch (   $licenseMatches)
private

Check if matches by nomos are inside monk findings.

Parameters
LicenseMatch[]$licenseMatches
Returns
boolean True if matches are inside monk, false otherwise

Definition at line 426 of file DeciderAgent.php.

◆ areNomosMonkNinkaAgreed()

Fossology\Decider\DeciderAgent::areNomosMonkNinkaAgreed (   $licenseMatches)
protected

Check if findings by all agents are same or not.

Parameters
LicenseMatch[][]$licenseMatches
Returns
boolean True if they match, false otherwise

Definition at line 460 of file DeciderAgent.php.

◆ areOtherScannerFindingsAndOJOAgreed()

Fossology\Decider\DeciderAgent::areOtherScannerFindingsAndOJOAgreed (   $licenseMatches)
protected

Check if the finding by only contains one single license and that no other scanner (nomos) has produced a contradicting statement.

Parameters
LicenseMatch[][]$licenseMatches
Returns
boolean True if they match, false otherwise

Definition at line 504 of file DeciderAgent.php.

◆ areOtherScannerFindingsAndRESOAgreed()

Fossology\Decider\DeciderAgent::areOtherScannerFindingsAndRESOAgreed (   $licenseMatches)
protected

Check if the finding by only contains one single license and that no other scanner (nomos) has produced a contradicting statement.

Parameters
LicenseMatch[][]$licenseMatches
Returns
boolean True if they match, false otherwise

Definition at line 531 of file DeciderAgent.php.

◆ autodecideIfOjoMatchesNoContradiction()

Fossology\Decider\DeciderAgent::autodecideIfOjoMatchesNoContradiction ( ItemTreeBounds  $itemTreeBounds,
  $matches 
)
private

Auto decide matches which are in nomos, monk and OJO findings.

Get the matches which really agree and apply the decisions.

Parameters
ItemTreeBounds$itemTreeBoundsItemTreeBounds to apply decisions
LicenseMatch[]$matchesNew license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 287 of file DeciderAgent.php.

◆ autodecideIfResoMatchesNoContradiction()

Fossology\Decider\DeciderAgent::autodecideIfResoMatchesNoContradiction ( ItemTreeBounds  $itemTreeBounds,
  $matches 
)
private

Auto decide matches which are in nomos, monk, OJO and Reso findings.

Get the matches which really agree and apply the decisions.

Parameters
ItemTreeBounds$itemTreeBoundsItemTreeBounds to apply decisions
LicenseMatch[]$matchesNew license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 315 of file DeciderAgent.php.

◆ autodecideNomosMatchesInsideMonk()

Fossology\Decider\DeciderAgent::autodecideNomosMatchesInsideMonk ( ItemTreeBounds  $itemTreeBounds,
  $matches 
)
private

Auto decide matches by nomos which are in monk findings.

Get the nomos matches which really are inside monk findings and apply the decisions.

Parameters
ItemTreeBounds$itemTreeBoundsItemTreeBounds to apply decisions
LicenseMatch[]$matchesNew license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 368 of file DeciderAgent.php.

◆ autodecideNomosMonkNinka()

Fossology\Decider\DeciderAgent::autodecideNomosMonkNinka ( ItemTreeBounds  $itemTreeBounds,
  $matches 
)
private

Auto decide matches which are in nomos, monk and ninka findings.

Get the matches which really agree and apply the decisions.

Parameters
ItemTreeBounds$itemTreeBoundsItemTreeBounds to apply decisions
LicenseMatch[]$matchesNew license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 343 of file DeciderAgent.php.

◆ callCopyrightDeactivationClutterRemovalScript()

Fossology\Decider\DeciderAgent::callCopyrightDeactivationClutterRemovalScript (   $tmpFilePath,
  $clutter_flag 
)
private

Run the Python script with required parameters and return the output.

Parameters
string$tmpFilePathPath to temp file with input JSON
bool$clutter_flagRemove clutter as well?
Returns
string Return from script.

Definition at line 619 of file DeciderAgent.php.

◆ existsUnhandledMatch()

Fossology\Decider\DeciderAgent::existsUnhandledMatch (   $projectedScannerMatches,
  $licensesFromDecision 
)
private

Check if matches contains unhandled match.

Parameters
array$projectedScannerMatches
array[]$licensesFromDecision
Returns
boolean True if any unhandled match exists, false otherwise

Definition at line 269 of file DeciderAgent.php.

◆ getCopyrightsToDisableFalsePositivesClutter()

Fossology\Decider\DeciderAgent::getCopyrightsToDisableFalsePositivesClutter (   $uploadId,
  $clutter_flag 
)
private

Use the copyright deactivation script to remove false positive copyrights.

Parameters
int$uploadIdUpload to process
bool$clutter_flagRemove clutter as well?
Returns
void

Definition at line 559 of file DeciderAgent.php.

◆ getLicenseIdsOfMatchesForScanner()

Fossology\Decider\DeciderAgent::getLicenseIdsOfMatchesForScanner (   $scanner,
  $licenseMatches 
)
protected

extracts the matches corresponding to a scanner from a $licenseMatches structure

Parameters
$scanner
LicenseMatch[][]$licenseMatches
Returns
int[] list of license ids

Definition at line 488 of file DeciderAgent.php.

◆ isRegionIncluded()

Fossology\Decider\DeciderAgent::isRegionIncluded (   $small,
  $big 
)
private

Check if the small highlight region is inside big one.

Parameters
int[]$smallThe smaller region, start at index 0, end at 1
int[]$bigThe bigger region, start at index 0, end at 1
Returns
boolean True if region is inside, else false

Definition at line 416 of file DeciderAgent.php.

◆ processItem()

Fossology\Decider\DeciderAgent::processItem ( Item  $item)
private

Given an item, check with the $activeRules and apply rules to it.

Get an UploadTree item, get the previous matches, current matches. Mark new licenses as WIP. Check the $activeRules and apply them on the item

Parameters
Item$itemItem to be processes
Returns
boolean True if operation resulted in success, false otherwise

Definition at line 203 of file DeciderAgent.php.

◆ processUploadId()

Fossology\Decider\DeciderAgent::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 146 of file DeciderAgent.php.

◆ remapByProjectedId()

Fossology\Decider\DeciderAgent::remapByProjectedId (   $matches)
protected

Given a set of matches, remap according to project id instead of license id.

Parameters
LicenseMatch[]$matchesMatches to be remaped
Returns
array[][] Remaped matches

Definition at line 391 of file DeciderAgent.php.

Member Data Documentation

◆ $activeRules

int Fossology\Decider\DeciderAgent::$activeRules
private

Rules active for upload (nomos in monk; ninka in monk; nomos, ninka and monk)

Definition at line 83 of file DeciderAgent.php.

◆ $agentLicenseEventProcessor

AgentLicenseEventProcessor Fossology\Decider\DeciderAgent::$agentLicenseEventProcessor
private

AgentLicenseEventProcessor object

Definition at line 95 of file DeciderAgent.php.

◆ $clearingDao

ClearingDao Fossology\Decider\DeciderAgent::$clearingDao
private

ClearingDao object

Definition at line 99 of file DeciderAgent.php.

◆ $clearingDecisionProcessor

ClearingDecisionProcessor Fossology\Decider\DeciderAgent::$clearingDecisionProcessor
private

ClearingDecisionProcessor object

Definition at line 91 of file DeciderAgent.php.

◆ $copyrightDao

CopyrightDao Fossology\Decider\DeciderAgent::$copyrightDao
private

CopyrightDao object

Definition at line 124 of file DeciderAgent.php.

◆ $decisionTypes

DecisionTypes Fossology\Decider\DeciderAgent::$decisionTypes
private

DecisionTypes object

Definition at line 111 of file DeciderAgent.php.

◆ $highlightDao

HighlightDao Fossology\Decider\DeciderAgent::$highlightDao
private

HighlightDao object

Definition at line 103 of file DeciderAgent.php.

◆ $licenseMap

LicenseMap Fossology\Decider\DeciderAgent::$licenseMap = null
private

LicenseMap object

Definition at line 115 of file DeciderAgent.php.

◆ $licenseMapUsage

int Fossology\Decider\DeciderAgent::$licenseMapUsage = null
private

licenseMapUsage

Definition at line 119 of file DeciderAgent.php.

◆ $showJobsDao

ShowJobsDao Fossology\Decider\DeciderAgent::$showJobsDao
private

ShowJobsDao object

Definition at line 107 of file DeciderAgent.php.

◆ $uploadDao

UploadDao Fossology\Decider\DeciderAgent::$uploadDao
private

UploadDao object

Definition at line 87 of file DeciderAgent.php.


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