FOSSology  3.2.0rc1
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_ALL = 0xf
 

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

Private Attributes

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

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 75 of file DeciderAgent.php.

Member Function Documentation

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 380 of file DeciderAgent.php.

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 414 of file DeciderAgent.php.

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 458 of file DeciderAgent.php.

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[]$matches New license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 276 of file DeciderAgent.php.

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[]$matches New license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 322 of file DeciderAgent.php.

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[]$matches New license matches found
Returns
boolean True if decisions applied, false otherwise

Definition at line 297 of file DeciderAgent.php.

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 258 of file DeciderAgent.php.

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 442 of file DeciderAgent.php.

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

Check if the small highlight region is inside big one.

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

Definition at line 370 of file DeciderAgent.php.

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 196 of file DeciderAgent.php.

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.
See also
Fossology::Lib::Agent::Agent::processUploadId()

Definition at line 145 of file DeciderAgent.php.

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

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

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

Definition at line 345 of file DeciderAgent.php.

Member Data Documentation

int Fossology\Decider\DeciderAgent::$activeRules
private

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

Definition at line 87 of file DeciderAgent.php.

AgentLicenseEventProcessor Fossology\Decider\DeciderAgent::$agentLicenseEventProcessor
private

AgentLicenseEventProcessor object

Definition at line 99 of file DeciderAgent.php.

ClearingDao Fossology\Decider\DeciderAgent::$clearingDao
private

ClearingDao object

Definition at line 103 of file DeciderAgent.php.

ClearingDecisionProcessor Fossology\Decider\DeciderAgent::$clearingDecisionProcessor
private

ClearingDecisionProcessor object

Definition at line 95 of file DeciderAgent.php.

DecisionTypes Fossology\Decider\DeciderAgent::$decisionTypes
private

DecisionTypes object

Definition at line 115 of file DeciderAgent.php.

HighlightDao Fossology\Decider\DeciderAgent::$highlightDao
private

HighlightDao object

Definition at line 107 of file DeciderAgent.php.

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

LicenseMap object

Definition at line 119 of file DeciderAgent.php.

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

licenseMapUsage

Definition at line 123 of file DeciderAgent.php.

ShowJobsDao Fossology\Decider\DeciderAgent::$showJobsDao
private

ShowJobsDao object

Definition at line 111 of file DeciderAgent.php.

UploadDao Fossology\Decider\DeciderAgent::$uploadDao
private

UploadDao object

Definition at line 91 of file DeciderAgent.php.


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