FOSSology  4.7.1
Open Source License Compliance by Open Source Software
ReuserUtils.hpp File Reference
#include "ReuserDatabaseHandler.hpp"
#include "ReuserState.hpp"
#include "ReuserTypes.hpp"
#include "libfossologyCPP.hpp"
#include "libfossagent.h"
#include "libfossscheduler.h"
Include dependency graph for ReuserUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AGENT_NAME   "reuser"
 
#define AGENT_DESC   "reuser agent"
 
#define AGENT_ARS   "reuser_ars"
 

Functions

ReuserState getState (fo::DbManager &dbManager)
 Create a ReuserState from the database (registers agent key). More...
 
int queryAgentId (fo::DbManager &dbManager)
 Query and register the agent id. Bails on failure. More...
 
int writeARS (const ReuserState &state, int arsId, int uploadId, int success, fo::DbManager &dbManager)
 Write (insert/update) an ARS record.
 
void bail (int exitval)
 Disconnect scheduler and exit. More...
 
bool processUploadId (const ReuserState &, int uploadId, ReuserDatabaseHandler &databaseHandler)
 Process one upload through all active reuse relationships.
 

Detailed Description

Agent constants and free utility functions for the reuser agent. Mirrors OjoUtils.hpp from the ojo agent.

Definition in file ReuserUtils.hpp.

Function Documentation

◆ bail()

void bail ( int  exitval)

Disconnect scheduler and exit.

Disconnect scheduler and exit in case of failure.

Parameters
exitvalExit code to be sent to scheduler and returned by program

Disconnect scheduler and exit.

Parameters
exitvalError code

Disconnect scheduler and exit.

Disconnect scheduler and exit in case of failure.

Parameters
exitvalExit code to be sent to scheduler and returned by program
exitvalError code

Disconnect scheduler and exit.

Disconnect scheduler and exit in case of failure.

Parameters
exitvalExit code to be sent to scheduler and returned by program

Definition at line 90 of file CompatibilityUtils.cc.

◆ getState()

ReuserState getState ( DbManager dbManager)

Create a ReuserState from the database (registers agent key).

Create a ReuserState from the database (registers agent key).

Parameters
dbManagerDBManager to be used
Returns
state of the agent

Definition at line 13 of file utils.cc.

◆ queryAgentId()

int queryAgentId ( DbManager dbManager)

Query and register the agent id. Bails on failure.

Query the agent ID from the DB.

Parameters
dbManagerDbManager to be used
Returns
The agent if found, bail otherwise.

Definition at line 48 of file CompatibilityUtils.cc.