dca_interface  6.3.4
Best practices when using the XFE SDK API

How to obtain the initial local database

When you're designing an application that usually uses a local signature database you can either
  • install the application with the default local database,
  • integrate the download as part of your installation or
  • use remote database access until a complete database download is complete
This chapter discusses these solutions and their advantages and disadvantages.
Options to obtain an initial local database

Using global variables

The next chapter discusses how to deal with global variables. This is an important topic, as the API is based on instances rather than pointers or interfaces.
Using global variables

Startup/Shutdown sequence

The next section describes how to instantiate and shut down SCA instances (dca::DcaInstance) safely.
Startup/Shutdown sequence

Shut down safely

When implementing the schedule and update tasks it is necessary to call additional functions to speed up the shutdown, and ensure that all files are saved before the SCA is unloaded.
For further details refer to Common shutdown functions - safely shut down

Additional settings

The next section describes some additional tuning settings NOT available as part of the SCA API.
Additional settings

Tracing & Logging

This section describes how to use tracing and logging with the SCA API.
Tracing & Logging

URL Classification - Cache Sizes and Frequent Updates

This section describes what to keep in mind when changing cache sizes and how that may interfere with the frequent update mechanism.

URL Classification - Cache sizes and Frequent Updates
Example implementation of a schedule event subscriber.
Exception class used in the DCA.
Definition: base_classes.h:237
LogLevel setLogLevel(LogLevel newLevel)
Sets the logging level for the given class instance. The old value will be returned.
The update module is used to download and install DCA content and engine updates.
Definition: base_classes.h:917
Encapsulates the results of an update process.
Definition: base_classes.h:998
const unsigned int DCA_SIG_ABORT
Currently the only supported signal parameter for the DcaInstance::signal() function.
Stores the connection data for a database.
Definition: base_classes.h:815
ScheduleModuleId
This defines the module id of a schedule event.
Definition: base_classes.h:511
ScheduleActionType
This defines the action type of a schedule event.
Definition: base_classes.h:495
Database connection class for a local or remote database.
Definition: base_classes.h:859
@ LOG_Extensive
Use extensive logging, this may greatly increase the size of the log file.
Definition: base_classes.h:219
virtual void onEvent(dca::ScheduleActionType actionType, dca::ScheduleModuleId moduleId, const std::string &version, const std::string &text)
Implementation of interface class method onEvent.
Main class for the URL classification.
URL database classifier class.
LogLevel
This enum is used in all setLogLevel() functions to change the verbosity level of the classes.
Definition: base_classes.h:212
Use a License to initialize a classification package or a toolbox package.
Definition: base_classes.h:560
bool useLocalDatabase
Set to true to connect to a local or custom database, set to false to use a remote database.
Definition: base_classes.h:821
Encapsulates the init and deinit of the DCA API.
Definition: base_classes.h:315
const DbType DBT_Url
Used for DbConnection classes for URL classification.
static UrlClassification create(const DcaInstance &aDcaInstance, const License &aLicense)
Creates the URL classification module by using the given DcaInstance and License.
DbType dbType
The type of the database.
Definition: base_classes.h:820
Standard function result.
Definition: base_classes.h:148
An interface for schedule event notifications. Derive a class from this interface and implement onEve...
Definition: base_classes.h:526
UrlDbClassifier createDbClassifier(const DbConnection &aDbConnection, const UrlDbClassifierOptions &options=UrlDbClassifierOptions()) const
Create a URL database classifier. The classifier is created by using the provided database connection...
DbConnection createDbConnection(const License &aLicense, const DbConnectionData &dbcData, const ProxySettings &proxySettings=ProxySettings(), LogLevel aLogLevel=LOG_Initial) const
Creates a DbConnection object using the given DbConnectionData.
This structure is used to initialize the DcaInstance.
Definition: base_classes.h:264
static DcaInstance create(const InitData &initData)
Creates a DcaInstance, starts up the DCA API and initializes the required main module.
int main(int argc, char *argv[])
The main routine.