FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
fo::AgentDatabaseHandler Class Reference

Database handler for agents. More...

#include <libfossAgentDatabaseHandler.hpp>

Inheritance diagram for fo::AgentDatabaseHandler:
Inheritance graph
Collaboration diagram for fo::AgentDatabaseHandler:
Collaboration graph

Public Member Functions

 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...
 

Protected Attributes

DbManager dbManager
 DbManager to use.
 

Detailed Description

Database handler for agents.

Definition at line 36 of file libfossAgentDatabaseHandler.hpp.

Constructor & Destructor Documentation

fo::AgentDatabaseHandler::AgentDatabaseHandler ( DbManager  _dbManager)

Constructor for AgentDatabaseHandler

Parameters
_dbManagerDbManager to use

Definition at line 35 of file libfossAgentDatabaseHandler.cc.

fo::AgentDatabaseHandler::AgentDatabaseHandler ( AgentDatabaseHandler &&  other)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 43 of file libfossAgentDatabaseHandler.cc.

fo::AgentDatabaseHandler::AgentDatabaseHandler ( const AgentDatabaseHandler )
delete

Explicitly disallow copy constructor

fo::AgentDatabaseHandler::~AgentDatabaseHandler ( )
virtual

Default destructor for AgentDatabaseHandler

Definition at line 51 of file libfossAgentDatabaseHandler.cc.

Member Function Documentation

bool fo::AgentDatabaseHandler::begin ( ) const

BEGIN a transaction block in DB.

Returns
True on success;
False on failure;

Definition at line 60 of file libfossAgentDatabaseHandler.cc.

bool fo::AgentDatabaseHandler::commit ( ) const

COMMIT a transaction block in DB.

Returns
True on success;
False on failure;

Definition at line 70 of file libfossAgentDatabaseHandler.cc.

char * fo::AgentDatabaseHandler::getPFileNameForFileId ( unsigned long  pfileId) const

Get the file name of a give pfile id.

Parameters
pfileIdPfile to search
Returns
The file name (SHA1.MD5.SIZE)
See also
queryPFileForFileId()

Definition at line 91 of file libfossAgentDatabaseHandler.cc.

AgentDatabaseHandler fo::AgentDatabaseHandler::operator= ( const AgentDatabaseHandler )
delete

Explicitly disallow copy constructor

std::vector< unsigned long > fo::AgentDatabaseHandler::queryFileIdsVectorForUpload ( int  uploadId,
bool  ignoreFilesWithMimeType 
) const

Get pfile ids for a given upload id.

Parameters
uploadIdUpload id to fetch from
ignoreFilesWithMimeTypeignore files with particular mimetype
Returns
Vector of pfile ids in given upload id
See also
queryFileIdsForUpload()

Definition at line 103 of file libfossAgentDatabaseHandler.cc.

std::string fo::AgentDatabaseHandler::queryUploadTreeTableName ( int  uploadId)

Get the upload tree table name for a given upload id.

Parameters
uploadIdUpload id to check
Returns
Name of the table holding the upload tree

Definition at line 114 of file libfossAgentDatabaseHandler.cc.

bool fo::AgentDatabaseHandler::rollback ( ) const

ROLLBACK a transaction block in DB.

Returns
True on success;
False on failure;

Definition at line 80 of file libfossAgentDatabaseHandler.cc.


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