FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
#include <CompatibilityDatabaseHandler.hpp>
Public Member Functions | |
CompatibilityDatabaseHandler (fo::DbManager dbManager) | |
CompatibilityDatabaseHandler (CompatibilityDatabaseHandler &&other) | |
CompatibilityDatabaseHandler | spawn () const |
std::vector< unsigned long > | queryFileIdsForUpload (int uploadId) |
std::vector< unsigned long > | queryFileIdsForScan (int uploadId, int agentId) |
std::vector< unsigned long > | queryScannerIdsForUpload (int uploadId) |
Get the agent id of latest scanners run on the upload. More... | |
std::vector< unsigned long > | queryLicIdsFromPfile (unsigned long pFileId, vector< unsigned long > agentIds) |
to get the license id from the file id More... | |
std::vector< unsigned long > | queryMainLicenseForUpload (int uploadId, int groupId) |
Get the main licenses for the upload. More... | |
std::vector< std::tuple< unsigned long, std::string > > | queryLicDetails (const std::vector< unsigned long > &licId) |
store the id and type of that respective license in vector of tuple for all the licenses More... | |
CompatibilityStatus | queryRule1 (tuple< unsigned long, string > lic1, tuple< unsigned long, string > lic2) const |
This rule uses id of both the licenses to find the compatibility. More... | |
CompatibilityStatus | queryRule2 (std::tuple< unsigned long, std::string > lic1, std::tuple< unsigned long, std::string > lic2) const |
This rule uses license type of both the licenses to find the compatibility. More... | |
CompatibilityStatus | queryRule3 (std::tuple< unsigned long, std::string > lic1, std::tuple< unsigned long, std::string > lic2) const |
This rule uses license id and license type to find the compatibility. More... | |
bool | queryInsertResult (unsigned long pFileId, int a_id, unsigned long id1, unsigned long id2, const string &comp) |
insert the compatibility result in the comp_result table More... | |
bool | check (unsigned long id1, unsigned long id2, unsigned long pFileId) |
Checking whether the data is already present in database or not, to prevent redundancy. More... | |
CompatibilityStatus | getDefaultRule () const |
Get the default rule from DB as CompatibilityStatus. More... | |
Public Member Functions inherited from fo::AgentDatabaseHandler | |
AgentDatabaseHandler (DbManager dbManager) | |
AgentDatabaseHandler (AgentDatabaseHandler &&other) | |
AgentDatabaseHandler (const AgentDatabaseHandler &)=delete | |
virtual | ~AgentDatabaseHandler () |
AgentDatabaseHandler | operator= (const AgentDatabaseHandler &)=delete |
bool | begin () const |
BEGIN a transaction block in DB. More... | |
bool | commit () const |
COMMIT a transaction block in DB. More... | |
bool | rollback () const |
ROLLBACK a transaction block in DB. More... | |
char * | getPFileNameForFileId (unsigned long pfileId) const |
Get the file name of a give pfile id. More... | |
std::string | queryUploadTreeTableName (int uploadId) |
Get the upload tree table name for a given upload id. More... | |
std::vector< unsigned long > | queryFileIdsVectorForUpload (int uploadId, bool ignoreFilesWithMimeType) const |
Get pfile ids for a given upload id. More... | |
std::vector< unsigned long > | queryFileIdsVectorForUpload (int uploadId, int agentId, bool ignoreFilesWithMimeType) const |
Get pfile ids for a given upload id which agent has not scanned. More... | |
Additional Inherited Members | |
Protected Attributes inherited from fo::AgentDatabaseHandler | |
DbManager | dbManager |
DbManager to use. | |
Database handler for COMPATIBILITY agent
Definition at line 64 of file CompatibilityDatabaseHandler.hpp.
CompatibilityDatabaseHandler::CompatibilityDatabaseHandler | ( | fo::DbManager | dbManager | ) |
Default constructor for CompatibilityDatabaseHandler
dbManager | DBManager to be used |
Definition at line 27 of file CompatibilityDatabaseHandler.cc.
bool CompatibilityDatabaseHandler::check | ( | unsigned long | id1, |
unsigned long | id2, | ||
unsigned long | pFileId | ||
) |
Checking whether the data is already present in database or not, to prevent redundancy.
id1 | holding license 1 information |
id2 | holding license 2 information |
Definition at line 249 of file CompatibilityDatabaseHandler.cc.
CompatibilityStatus CompatibilityDatabaseHandler::getDefaultRule | ( | ) | const |
Get the default rule from DB as CompatibilityStatus.
Definition at line 305 of file CompatibilityDatabaseHandler.cc.
vector< unsigned long > CompatibilityDatabaseHandler::queryFileIdsForScan | ( | int | uploadId, |
int | agentId | ||
) |
Get a vector of all file id for a given upload id which are not scanned by the given agentId.
uploadId | Upload ID to be queried |
agentId | ID of the agent |
Definition at line 51 of file CompatibilityDatabaseHandler.cc.
vector< unsigned long > CompatibilityDatabaseHandler::queryFileIdsForUpload | ( | int | uploadId | ) |
Get a vector of all file id for a given upload id.
uploadId | Upload ID to be queried |
Definition at line 38 of file CompatibilityDatabaseHandler.cc.
bool CompatibilityDatabaseHandler::queryInsertResult | ( | unsigned long | pFileId, |
int | a_id, | ||
unsigned long | id1, | ||
unsigned long | id2, | ||
const string & | comp | ||
) |
insert the compatibility result in the comp_result table
pFileId | file id |
a_id | agent id |
id1 | first license id |
id2 | second license id |
comp | storing the compatibility result |
Definition at line 273 of file CompatibilityDatabaseHandler.cc.
vector< tuple< unsigned long, string > > CompatibilityDatabaseHandler::queryLicDetails | ( | const std::vector< unsigned long > & | licId | ) |
store the id and type of that respective license in vector of tuple for all the licenses
licId |
Definition at line 109 of file CompatibilityDatabaseHandler.cc.
std::vector< unsigned long > CompatibilityDatabaseHandler::queryLicIdsFromPfile | ( | unsigned long | pFileId, |
vector< unsigned long > | agentIds | ||
) |
to get the license id from the file id
pFileId |
Definition at line 77 of file CompatibilityDatabaseHandler.cc.
std::vector< unsigned long > CompatibilityDatabaseHandler::queryMainLicenseForUpload | ( | int | uploadId, |
int | groupId | ||
) |
Get the main licenses for the upload.
uploadId | Upload ID |
Definition at line 352 of file CompatibilityDatabaseHandler.cc.
CompatibilityStatus CompatibilityDatabaseHandler::queryRule1 | ( | tuple< unsigned long, string > | lic1, |
tuple< unsigned long, string > | lic2 | ||
) | const |
This rule uses id of both the licenses to find the compatibility.
lic1 | holding license 2 information i.e. license id and license type |
lic2 | holding license 2 information i.e. license id and license type |
Definition at line 133 of file CompatibilityDatabaseHandler.cc.
CompatibilityStatus CompatibilityDatabaseHandler::queryRule2 | ( | std::tuple< unsigned long, std::string > | lic1, |
std::tuple< unsigned long, std::string > | lic2 | ||
) | const |
This rule uses license type of both the licenses to find the compatibility.
lic1 | holding license 1 information |
lic2 | holding license 2 information |
Definition at line 169 of file CompatibilityDatabaseHandler.cc.
CompatibilityStatus CompatibilityDatabaseHandler::queryRule3 | ( | std::tuple< unsigned long, std::string > | lic1, |
std::tuple< unsigned long, std::string > | lic2 | ||
) | const |
This rule uses license id and license type to find the compatibility.
lic1 | holding license 1 information |
lic2 | holding license 2 information |
Definition at line 205 of file CompatibilityDatabaseHandler.cc.
std::vector< unsigned long > CompatibilityDatabaseHandler::queryScannerIdsForUpload | ( | int | uploadId | ) |
Get the agent id of latest scanners run on the upload.
uploadId | Upload ID |
Definition at line 330 of file CompatibilityDatabaseHandler.cc.
CompatibilityDatabaseHandler CompatibilityDatabaseHandler::spawn | ( | ) | const |
Spawn a new DbManager object.
Used to create new objects for threads.
Definition at line 295 of file CompatibilityDatabaseHandler.cc.