strus  0.17
Public Types | Public Member Functions | List of all members
strus::DatabaseInterface Class Referenceabstract

Interface to the create,destroy the key value store database. More...

#include <databaseInterface.hpp>

Public Types

enum  ConfigType { CmdCreateClient, CmdCreate, CmdDestroy }
 Enumeration of different type of configurations Needed for getting the correct description of the configuration. More...
 

Public Member Functions

virtual ~DatabaseInterface ()
 Destructor. More...
 
virtual bool exists (const std::string &configsource) const =0
 Evaluate if the database specified exists. More...
 
virtual DatabaseClientInterfacecreateClient (const std::string &configsource) const =0
 Creates a client to access the key value store database. More...
 
virtual bool createDatabase (const std::string &configsource) const =0
 Creates a new key value store database described with config. More...
 
virtual bool restoreDatabase (const std::string &configsource, DatabaseBackupCursorInterface *backup) const =0
 Restore a database at the location described in config and restore the backup from the backup interface passed. More...
 
virtual bool destroyDatabase (const std::string &configsource) const =0
 Destroys an existing key value store database described with config. More...
 
virtual const char * getConfigDescription (const ConfigType &type) const =0
 Gets an example configuration description (source string as used by the functions here) createDatabase(const char*), destroyDatabase(const char*) and createDatabaseClient(const char*) for the usage printed by programs using this database. More...
 
virtual const char ** getConfigParameters (const ConfigType &type) const =0
 Get the list of known configuration parameter keys for verification of the configuration by programs using this database. More...
 

Detailed Description

Interface to the create,destroy the key value store database.

Member Enumeration Documentation

Enumeration of different type of configurations Needed for getting the correct description of the configuration.

Enumerator
CmdCreateClient 

Config description for the creation of an instance accessing the repository.

CmdCreate 

Config description for the creation of a repository that does not exist yet.

CmdDestroy 

Config description for the physical disposal of a repository.

Constructor & Destructor Documentation

virtual strus::DatabaseInterface::~DatabaseInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual DatabaseClientInterface* strus::DatabaseInterface::createClient ( const std::string &  configsource) const
pure virtual

Creates a client to access the key value store database.

Parameters
[in]configsourceconfiguration source string describing the database (not a filename !)
Returns
the client on success or NULL, if the operation failed
virtual bool strus::DatabaseInterface::createDatabase ( const std::string &  configsource) const
pure virtual

Creates a new key value store database described with config.

Parameters
[in]configsourceconfiguration source string describing the database (not a filename !)
Returns
true, if the operation succeeded
virtual bool strus::DatabaseInterface::destroyDatabase ( const std::string &  configsource) const
pure virtual

Destroys an existing key value store database described with config.

Parameters
[in]configsourceconfiguration source string describing the key value store database (not a filename !)
Returns
true, if the operation succeeded
virtual bool strus::DatabaseInterface::exists ( const std::string &  configsource) const
pure virtual

Evaluate if the database specified exists.

Parameters
[in]configsourceconfiguration source string describing the database (not a filename !)
virtual const char* strus::DatabaseInterface::getConfigDescription ( const ConfigType type) const
pure virtual

Gets an example configuration description (source string as used by the functions here) createDatabase(const char*), destroyDatabase(const char*) and createDatabaseClient(const char*) for the usage printed by programs using this database.

virtual const char** strus::DatabaseInterface::getConfigParameters ( const ConfigType type) const
pure virtual

Get the list of known configuration parameter keys for verification of the configuration by programs using this database.

virtual bool strus::DatabaseInterface::restoreDatabase ( const std::string &  configsource,
DatabaseBackupCursorInterface backup 
) const
pure virtual

Restore a database at the location described in config and restore the backup from the backup interface passed.

Parameters
[in]configsourceconfiguration source string describing location of the database restored (not a filename !)
[in]backupinterface to backup to restore
Returns
true, if the operation succeeded

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