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

Utility functions to process ClearingDecision. More...

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

Public Member Functions

 __construct (ClearingDao $clearingDao, AgentLicenseEventProcessor $agentLicenseEventProcessor, ClearingEventProcessor $clearingEventProcessor, DbManager $dbManager)
 
 hasUnhandledScannerDetectedLicenses (ItemTreeBounds $itemTreeBounds, $groupId, $additionalEventIds=array(), $licenseMap=null)
 
 makeDecisionFromLastEvents (ItemTreeBounds $itemBounds, $userId, $groupId, $type, $global, $additionalEventIds=array())
 Create clearing decisions from clearing events. More...
 
 getCurrentClearings (ItemTreeBounds $itemTreeBounds, $groupId, $usageId=LicenseMap::TRIVIAL)
 For a given item, get the clearing decisions. More...
 

Public Attributes

const NO_LICENSE_KNOWN_DECISION_TYPE = 2
 

Private Member Functions

 insertClearingEventsForAgentFindings (ItemTreeBounds $itemBounds, $userId, $groupId, $remove=false, $type=ClearingEventTypes::AGENT, $removedIds=array())
 Insert clearing events in DB for agent findings. More...
 
 clearingDecisionIsDifferentFrom (ClearingDecision $decision, $type, $scope, $clearingEventIds)
 Check if clearing decisions are different from clearing event ids. More...
 

Private Attributes

 $clearingDao
 
 $agentLicenseEventProcessor
 
 $clearingEventProcessor
 
 $dbManager
 

Detailed Description

Utility functions to process ClearingDecision.

Definition at line 24 of file ClearingDecisionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::__construct ( ClearingDao  $clearingDao,
AgentLicenseEventProcessor  $agentLicenseEventProcessor,
ClearingEventProcessor  $clearingEventProcessor,
DbManager  $dbManager 
)

Constructor

Parameters
ClearingDao$clearingDao
AgentLicenseEventProcessor$agentLicenseEventProcessor
ClearingEventProcessor$clearingEventProcessor
DbManager$dbManager

Definition at line 52 of file ClearingDecisionProcessor.php.

Member Function Documentation

◆ clearingDecisionIsDifferentFrom()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::clearingDecisionIsDifferentFrom ( ClearingDecision  $decision,
  $type,
  $scope,
  $clearingEventIds 
)
private

Check if clearing decisions are different from clearing event ids.

Parameters
ClearingDecision$decisionClearing decisions to check
int$typeClearing decision type required
int$scopeClearing decision scope required
array$clearingEventIdsClearing events to compare with
Returns
boolean True if they are same, false otherwise

Definition at line 124 of file ClearingDecisionProcessor.php.

◆ getCurrentClearings()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::getCurrentClearings ( ItemTreeBounds  $itemTreeBounds,
  $groupId,
  $usageId = LicenseMap::TRIVIAL 
)

For a given item, get the clearing decisions.

Parameters
ItemTreeBounds$itemTreeBounds
int$groupId
int$usageId
Returns
array Array of added and removed license findings
Exceptions
Exception

Definition at line 200 of file ClearingDecisionProcessor.php.

◆ hasUnhandledScannerDetectedLicenses()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::hasUnhandledScannerDetectedLicenses ( ItemTreeBounds  $itemTreeBounds,
  $groupId,
  $additionalEventIds = array(),
  $licenseMap = null 
)

Check if the given upload tree bound have unhandled license detections

Parameters
ItemTreeBounds$itemTreeBoundsUpload tree bound to check
int$groupIdCurrent group id
array$additionalEventIdsAdditional event ids to include, indexed by licenseId
null | LicenseMap$licenseMapIf given then license are considered as equal iff mapped to same
Returns
bool True if unhandled licenses found, false otherwise.

Definition at line 70 of file ClearingDecisionProcessor.php.

◆ insertClearingEventsForAgentFindings()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::insertClearingEventsForAgentFindings ( ItemTreeBounds  $itemBounds,
  $userId,
  $groupId,
  $remove = false,
  $type = ClearingEventTypes::AGENT,
  $removedIds = array() 
)
private

Insert clearing events in DB for agent findings.

Parameters
ItemTreeBounds$itemBoundsUpload tree bound of the item
int$userIdCurrent user id
int$groupIdCurrent group id
boolean$removeIs the license finding removed?
int$typeFinding type
array$removedIdsLicenses to be skipped
Returns
number[]

Definition at line 103 of file ClearingDecisionProcessor.php.

◆ makeDecisionFromLastEvents()

Fossology\Lib\BusinessRules\ClearingDecisionProcessor::makeDecisionFromLastEvents ( ItemTreeBounds  $itemBounds,
  $userId,
  $groupId,
  $type,
  $global,
  $additionalEventIds = array() 
)

Create clearing decisions from clearing events.

Parameters
ItemTreeBounds$itemBounds
int$userId
int$groupId
int$type
boolean$global
arrayAdditional event ids to include, indexed by licenseId

Definition at line 148 of file ClearingDecisionProcessor.php.

Member Data Documentation

◆ $agentLicenseEventProcessor

AgentLicenseEventProcessor Fossology\Lib\BusinessRules\ClearingDecisionProcessor::$agentLicenseEventProcessor
private

License event processor object

Definition at line 37 of file ClearingDecisionProcessor.php.

◆ $clearingDao

ClearingDao Fossology\Lib\BusinessRules\ClearingDecisionProcessor::$clearingDao
private

Clearing DAO object

Definition at line 34 of file ClearingDecisionProcessor.php.

◆ $clearingEventProcessor

ClearingEventProcessor Fossology\Lib\BusinessRules\ClearingDecisionProcessor::$clearingEventProcessor
private

Clearing event processor object

Definition at line 40 of file ClearingDecisionProcessor.php.

◆ $dbManager

DbManager Fossology\Lib\BusinessRules\ClearingDecisionProcessor::$dbManager
private

DB manager

Definition at line 43 of file ClearingDecisionProcessor.php.

◆ NO_LICENSE_KNOWN_DECISION_TYPE

integer Fossology\Lib\BusinessRules\ClearingDecisionProcessor::NO_LICENSE_KNOWN_DECISION_TYPE = 2

Decision type when no known license found

Definition at line 30 of file ClearingDecisionProcessor.php.


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