FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\BusinessRules\AgentLicenseEventProcessor Class Reference

Handle events related to license findings. More...

Collaboration diagram for Fossology\Lib\BusinessRules\AgentLicenseEventProcessor:
Collaboration graph

Public Member Functions

 __construct (LicenseDao $licenseDao, AgentDao $agentDao)
 
 getScannerDetectedLicenses (ItemTreeBounds $itemTreeBounds, $usageId=LicenseMap::TRIVIAL)
 Get licenses detected by agents for a given upload tree item. More...
 
 getLatestScannerDetectedMatches (ItemTreeBounds $itemTreeBounds)
 Get all license id matches by agent for a given upload tree item. More...
 
 getScannedLicenses ($details)
 Get scanned license as a map of license-id => license-ref. More...
 
 getScannerEvents (ItemTreeBounds $itemTreeBounds, $usageId=LicenseMap::TRIVIAL)
 Get all scanner events that occurred on a given upload tree bound. More...
 

Protected Member Functions

 getScannerDetectedLicenseDetails (ItemTreeBounds $itemTreeBounds, $usageId=LicenseMap::TRIVIAL)
 Get licenses match from agents for given upload tree items. More...
 
 filterLatestScannerDetectedMatches ($agentDetectedLicenses, $uploadId)
 (A->B->C->X) => C->A->X if B=latestScannerId(A) More...
 
 filterDetectedLicenses ($agentDetectedLicenses, $agentLatestMap)
 (A->B->C->X, A->B) => C->A->X More...
 

Private Member Functions

 getLatestAgentIdPerAgent ($uploadId, $agentNames)
 Get map for agent name => agent id. More...
 
 createAgentClearingEvent ($licenseProperty)
 Create a new AgentClearingEvent. More...
 

Private Attributes

 $latestAgentMapCache = array()
 
 $licenseDao
 
 $agentDao
 

Detailed Description

Handle events related to license findings.

Definition at line 26 of file AgentLicenseEventProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::__construct ( LicenseDao  $licenseDao,
AgentDao  $agentDao 
)

Constructor for the event processor

Parameters
LicenseDao$licenseDaoLicense DAO to be used
AgentDao$agentDaoAgent DAO to be used

Definition at line 43 of file AgentLicenseEventProcessor.php.

Member Function Documentation

◆ createAgentClearingEvent()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::createAgentClearingEvent (   $licenseProperty)
private

Create a new AgentClearingEvent.

Parameters
array$licensePropertyLicense properties required for AgentClearingEvent in an associative array
Returns
AgentClearingEvent

Definition at line 255 of file AgentLicenseEventProcessor.php.

◆ filterDetectedLicenses()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::filterDetectedLicenses (   $agentDetectedLicenses,
  $agentLatestMap 
)
protected

(A->B->C->X, A->B) => C->A->X

Parameters
mixed[][][]$agentDetectedLicenses
array$agentLatestMap
Returns
mixed[][]

Definition at line 186 of file AgentLicenseEventProcessor.php.

◆ filterLatestScannerDetectedMatches()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::filterLatestScannerDetectedMatches (   $agentDetectedLicenses,
  $uploadId 
)
protected

(A->B->C->X) => C->A->X if B=latestScannerId(A)

Parameters
array$agentDetectedLicensesAgent license match map
int$uploadIdUpload to be queried
Returns
LicenseMatch[][][] map licenseId->agentName->licenseMatches

Definition at line 143 of file AgentLicenseEventProcessor.php.

◆ getLatestAgentIdPerAgent()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getLatestAgentIdPerAgent (   $uploadId,
  $agentNames 
)
private

Get map for agent name => agent id.

The function also updates the agent map cache.

Parameters
int$uploadIdUpload to query
array$agentNamesAgents required
Returns
array Map of agent name => agent id

Definition at line 163 of file AgentLicenseEventProcessor.php.

◆ getLatestScannerDetectedMatches()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getLatestScannerDetectedMatches ( ItemTreeBounds  $itemTreeBounds)

Get all license id matches by agent for a given upload tree item.

Parameters
ItemTreeBounds$itemTreeBoundsUpload tree bound
Returns
LicenseMatch[][][] map licenseId->agentName->licenseMatches

Definition at line 115 of file AgentLicenseEventProcessor.php.

◆ getScannedLicenses()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getScannedLicenses (   $details)

Get scanned license as a map of license-id => license-ref.

Parameters
array$detailsResult from getScannerDetectedLicenseDetails()
Returns
LicenseRef[] indexed by license id

Definition at line 211 of file AgentLicenseEventProcessor.php.

◆ getScannerDetectedLicenseDetails()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getScannerDetectedLicenseDetails ( ItemTreeBounds  $itemTreeBounds,
  $usageId = LicenseMap::TRIVIAL 
)
protected

Get licenses match from agents for given upload tree items.

Parameters
ItemTreeBounds$itemTreeBoundsUpload tree bounds to get results for
int$usageIdLicense usage
Returns
array Associative array with
res => array(
<license-id> => array(
<agent-name> => array(
id => <license-id>,
licenseRef => <license-ref>,
agentRef => <agent-ref>,
matchId => <highlight-match-id>,
percentage => <match-percentage>
)
)
)
Definition: nomos.h:426
Store the results of a regex match.
Definition: scanners.hpp:28
format

Definition at line 82 of file AgentLicenseEventProcessor.php.

◆ getScannerDetectedLicenses()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getScannerDetectedLicenses ( ItemTreeBounds  $itemTreeBounds,
  $usageId = LicenseMap::TRIVIAL 
)

Get licenses detected by agents for a given upload tree item.

Parameters
ItemTreeBounds$itemTreeBoundsUpload tree item bound
int$usageIdLicense usage
Returns
LicenseRef[]

Definition at line 55 of file AgentLicenseEventProcessor.php.

◆ getScannerEvents()

Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::getScannerEvents ( ItemTreeBounds  $itemTreeBounds,
  $usageId = LicenseMap::TRIVIAL 
)

Get all scanner events that occurred on a given upload tree bound.

Parameters
ItemTreeBounds$itemTreeBoundsUpload tree bound
int$usageIdLicense usage
Returns
AgentClearingEvent[][] indexed by LicenseId

Definition at line 231 of file AgentLicenseEventProcessor.php.

Member Data Documentation

◆ $agentDao

AgentDao Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::$agentDao
private

Agent DAO object

Definition at line 36 of file AgentLicenseEventProcessor.php.

◆ $latestAgentMapCache

array Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::$latestAgentMapCache = array()
private

License map cache

Definition at line 30 of file AgentLicenseEventProcessor.php.

◆ $licenseDao

LicenseDao Fossology\Lib\BusinessRules\AgentLicenseEventProcessor::$licenseDao
private

License DAO object

Definition at line 33 of file AgentLicenseEventProcessor.php.


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