dca_interface  6.3.4
dca::UpdateModule Class Reference

#include <base_classes.h>

Detailed Description

The update module is used to download and install DCA content and engine updates.

Definition at line 916 of file base_classes.h.

Public Member Functions

FunctionResult performUpdate (bool force, UpdateResults &results) const
 Performs an update for all licensed and initialized DCA modules and classifiers. More...
 
bool cancelUpdate () const
 Cancels a currently running update process. If there is currently no update running, this function does nothing. More...
 
LogLevel setLogLevel (LogLevel newLevel)
 Sets the logging level for the given class instance. The old value will be returned. More...
 

Static Public Member Functions

static UpdateModule create (const DcaInstance &aDcaInstance, const License &aLicense, const ProxySettings &proxySettings=ProxySettings())
 

Static Public Attributes

static DCA_MODULE_ID_TYPE ID
 This is the module id of the update module.
 

Member Function Documentation

◆ create()

static UpdateModule dca::UpdateModule::create ( const DcaInstance aDcaInstance,
const License aLicense,
const ProxySettings proxySettings = ProxySettings() 
)
static
\brief Initialization of the UpdateModule module.
\param[in] aDcaInstance A previously initialized DcaInstance object
\param[in] aLicense An initialized license object
\param[in] proxySettings Proxy settings for connecting to the update server. If not specified,
               the default DCA proxy settings will be used.
Returns
An initialized UpdateModule instance.

◆ performUpdate()

FunctionResult dca::UpdateModule::performUpdate ( bool  force,
UpdateResults results 
) const

Performs an update for all licensed and initialized DCA modules and classifiers.

The update process includes all currently loaded classifiers and their related initialization data. Updates are downloaded and applied as soon as possible. If an update requires the DCA to be restarted this is stated in the UpdateResults.restartRequired().

During the update process, any unknown URLs collected as part of the WebLearn process will be uploaded to the classification servers. WebLearn can be enabled during the initializaion process for a UrlDbClassifier

Parameters
[in]forceThe check for updates uses a per-module interval. The interval between update checks is specified by the update server. Subsequent calls to performUpdate will not result in any new file for the module being downloaded until this interval has passed. To enforce a real check for each module (ie ignoring the recommended update interval) set this parameter to true. Usually it is best to set this to false and let the update module itself decide when its time to really update any file.
[out]resultsThe result of the update process
Returns
If the function fails, the FunctionResult object contains the description.
Note
This function may take a long time to finish so it is strongly recommended to call this function in a dedicated thread.
When using url classification you will also need to call the DcaInstance::schedule() function to invoke signature database updates and merge processes.
See also
UrlDbClassifierOptions, DcaInstance::schedule()

◆ cancelUpdate()

bool dca::UpdateModule::cancelUpdate ( ) const

Cancels a currently running update process. If there is currently no update running, this function does nothing.

Since UpdateModule::performUpdate returns only after the complete update process is finished, it is necessary to have the ability to cancel an update process running in another thread.

Returns
true if the update process was successfully cancelled, false otherwise.

◆ setLogLevel()

LogLevel dca::UpdateModule::setLogLevel ( LogLevel  newLevel)

Sets the logging level for the given class instance. The old value will be returned.

Usually the logging level is set to LOG_Notice.

Parameters
[in]newLevelThe new LogLevel the class instance should use for logging
Returns
The old used logging level.

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