Skip to content

PersistorFactoryObjectInterface

Amy Bowersox edited this page May 14, 2020 · 2 revisions

The Persistor Factory Object Interface

Create an object implementing this interface to store information about previously-analyzed items and information collated for reports in a data store other than the built-in SQLite one. This object is responsible for creating and configuring your persistor object.

The fully-qualified class name of the class implementing this interface should be inserted as the value of the _provider: property of the database: section of the configuration file.

Your object must implement all methods defined in this reference.

Your implementation can inherit from the class cbc_binary_toolkit.state.manager.BasePersistorFactory (defined here), to ensure that the protocol is properly implemented.

create_persistor method

def create_persistor(self, config):

This method is called when the toolkit is initialized, so your factory object can create and configure the persistor object instance that will be used.

Parameters:

  • config (type: Config) - Reference to a Config object pointing at the database: section of the configuration.

Returns:

(type: object) Instance of your persistor object.