strus  0.17
databaseInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_DATABASE_INTERFACE_HPP_INCLUDED
11 #define _STRUS_DATABASE_INTERFACE_HPP_INCLUDED
12 #include <string>
13 
14 namespace strus {
15 
17 class DatabaseClientInterface;
19 class DatabaseBackupCursorInterface;
20 
23 {
24 public:
26  virtual ~DatabaseInterface(){}
27 
30  virtual bool exists( const std::string& configsource) const=0;
31 
35  virtual DatabaseClientInterface* createClient( const std::string& configsource) const=0;
36 
40  virtual bool createDatabase( const std::string& configsource) const=0;
41 
46  virtual bool restoreDatabase( const std::string& configsource, DatabaseBackupCursorInterface* backup) const=0;
47 
51  virtual bool destroyDatabase( const std::string& configsource) const=0;
52 
56  {
60  };
61 
65  virtual const char* getConfigDescription( const ConfigType& type) const=0;
66 
69  virtual const char** getConfigParameters( const ConfigType& type) const=0;
70 };
71 
72 }//namespace
73 #endif
74 
virtual const char ** getConfigParameters(const ConfigType &type) const =0
Get the list of known configuration parameter keys for verification of the configuration by programs ...
Interface for accessing the strus key value storage database.
Definition: databaseClientInterface.hpp:27
virtual DatabaseClientInterface * createClient(const std::string &configsource) const =0
Creates a client to access the key value store database.
ConfigType
Enumeration of different type of configurations Needed for getting the correct description of the con...
Definition: databaseInterface.hpp:55
Config description for the physical disposal of a repository.
Definition: databaseInterface.hpp:59
virtual bool exists(const std::string &configsource) const =0
Evaluate if the database specified exists.
virtual bool createDatabase(const std::string &configsource) const =0
Creates a new key value store database described with config.
Config description for the creation of a repository that does not exist yet.
Definition: databaseInterface.hpp:58
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 interfa...
Interface to the create,destroy the key value store database.
Definition: databaseInterface.hpp:22
virtual ~DatabaseInterface()
Destructor.
Definition: databaseInterface.hpp:26
Database cursor interface that can be used for backup.
Definition: databaseBackupCursorInterface.hpp:18
virtual bool destroyDatabase(const std::string &configsource) const =0
Destroys an existing key value store database described with config.
Config description for the creation of an instance accessing the repository.
Definition: databaseInterface.hpp:57
virtual const char * getConfigDescription(const ConfigType &type) const =0
Gets an example configuration description (source string as used by the functions here) createDatabas...