Sparksee
6.0.2
|
Public Member Functions | |
Sparksee (SparkseeConfig &config) | |
Creates a new instance. More... | |
virtual | ~Sparksee () |
Destructor. | |
Database * | Create (const std::wstring &path, const std::wstring &alias) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Creates a new Database instance. More... | |
Database * | Create (const std::wstring &path, const std::wstring &alias, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Creates a new Database instance. More... | |
Database * | Open (const std::wstring &path, bool_t readOnly) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Opens an existing Database instance. More... | |
Database * | Open (const std::wstring &path, bool_t readOnly, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Opens an existing Database instance. More... | |
Database * | Restore (const std::wstring &path, const std::wstring &backupFile) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Restores a Database from a backup file. More... | |
Database * | Restore (const std::wstring &path, const std::wstring &backupFile, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Restores a Database from a backup file. More... | |
Database * | RestoreEncryptedBackup (const std::wstring &path, const std::wstring &backupFile, const std::wstring &keyInHex, const std::wstring &ivInHex) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Restores a Database from an encrypted backup file. More... | |
Database * | RestoreEncryptedBackup (const std::wstring &path, const std::wstring &backupFile, const SparkseeConfig &config, const std::wstring &keyInHex, const std::wstring &ivInHex) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Restores a Database from an encrypted backup file. More... | |
bool_t | VerifyChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Verifies the Checksum integrity of the given image file and it's recovery log file. More... | |
bool_t | AddChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Converts a database WITHOUT checksums into a database WITH checksums. More... | |
bool_t | RemoveChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Converts a database WITH checksums into a database WITHOUT checksums. More... | |
void | SetUnrecoverableErrorCallback (SPARKSEE_UNRECOVERABLE_ERR_CALLBACK callback) |
Sets the unrecoverable error callback. More... | |
bool_t | Encrypt (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Converts a database WITHOUT encryption into an encrypted database. More... | |
bool_t | Decrypt (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
Converts a database WITH encryption into a database WITHOUT encryption. More... | |
void | ResizeInMemoryPool (int64_t newCapacity) throw (sparksee::gdb::SystemError) |
Resizes the in memory pool allocator. More... | |
int64_t | GetInMemoryPoolCapacity () |
Gets the capacity of the in-memory pool (in Megabytes) More... | |
Static Public Attributes | |
static const std::wstring | Version |
Sparksee version. | |
Private Member Functions | |
sparksee_core::SPARKSEE * | GetHandler () |
Gets the handled reference. More... | |
const sparksee_core::SPARKSEE * | GetHandler () const |
Gets the handled reference. More... | |
void | SetHandler (sparksee_core::SPARKSEE *h) |
Sets the handled reference. More... | |
void | FreeHandler () |
Frees (deletes) the handled reference. | |
bool_t | IsNull () const |
Gets if the handler is NULL. More... | |
Sparksee class.
All Sparksee programs must have one single Sparksee instance to manage one or more Database instances.
This class allows for the creation of new Databases or open an existing one.
Sparksee::Sparksee | ( | SparkseeConfig & | config | ) |
Creates a new instance.
config | [in/out] Sparksee configuration (may be updated). |
bool_t Sparksee::AddChecksums | ( | const std::wstring & | path | ) | |
throw | ( | sparksee::gdb::FileNotFoundException, | |||
sparksee::gdb::Error | |||||
) |
Converts a database WITHOUT checksums into a database WITH checksums.
Any error found is logged.
path | The path to the database image file |
sparksee::gdb::FileNotFoundException | |
sparksee::gdb::Error |
Database* Sparksee::Create | ( | const std::wstring & | path, |
const std::wstring & | alias | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Creates a new Database instance.
FileNotFoundException | If the given file cannot be created. |
Database* Sparksee::Create | ( | const std::wstring & | path, |
const std::wstring & | alias, | ||
const SparkseeConfig & | config | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
bool_t Sparksee::Decrypt | ( | const std::wstring & | path | ) | |
throw | ( | sparksee::gdb::FileNotFoundException, | |||
sparksee::gdb::Error | |||||
) |
Converts a database WITH encryption into a database WITHOUT encryption.
Any error found is logged.
path | The path to the database image file |
sparksee::gdb::FileNotFoundException | |
sparksee::gdb::Error |
bool_t Sparksee::Encrypt | ( | const std::wstring & | path | ) | |
throw | ( | sparksee::gdb::FileNotFoundException, | |||
sparksee::gdb::Error | |||||
) |
Converts a database WITHOUT encryption into an encrypted database.
Any error found is logged.
path | The path to the database image file |
sparksee::gdb::FileNotFoundException | |
sparksee::gdb::Error |
int64_t Sparksee::GetInMemoryPoolCapacity | ( | ) |
Gets the capacity of the in-memory pool (in Megabytes)
Database* Sparksee::Open | ( | const std::wstring & | path, |
bool_t | readOnly | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Opens an existing Database instance.
FileNotFoundException | If the given file does not exist. |
Database* Sparksee::Open | ( | const std::wstring & | path, |
bool_t | readOnly, | ||
const SparkseeConfig & | config | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Opens an existing Database instance.
The provided configuration will be used for all the database settings but not for the license, which must already be properly setup in this class.
path | [in] Database storage file. |
readOnly | [in] If TRUE, open Database in read-only mode. |
config | [in] Use a specific configuration instead of the one in this Sparksee |
FileNotFoundException | If the given file does not exist. |
bool_t Sparksee::RemoveChecksums | ( | const std::wstring & | path | ) | |
throw | ( | sparksee::gdb::FileNotFoundException, | |||
sparksee::gdb::Error | |||||
) |
Converts a database WITH checksums into a database WITHOUT checksums.
Any error found is logged.
path | The path to the database image file |
sparksee::gdb::FileNotFoundException | |
sparksee::gdb::Error |
void Sparksee::ResizeInMemoryPool | ( | int64_t | newCapacity | ) | |
throw | ( | sparksee::gdb::SystemError | |||
) |
Resizes the in memory pool allocator.
newCapacity | The new capacity of the in memory pool allocator |
Database* Sparksee::Restore | ( | const std::wstring & | path, |
const std::wstring & | backupFile | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Restores a Database from a backup file.
See the Graph class Backup method.
path | [in] Database storage file. |
backupFile | [in] The Backup file to be restored. |
FileNotFoundException | If the given file cannot be created, or the exported data file does not exists. |
Database* Sparksee::Restore | ( | const std::wstring & | path, |
const std::wstring & | backupFile, | ||
const SparkseeConfig & | config | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Restores a Database from a backup file.
See the Graph class Backup method.
path | [in] Database storage file. |
backupFile | [in] The Backup file to be restored. |
config | [in] Use a specific configuration instead of the one in this Sparksee |
FileNotFoundException | If the given file cannot be created, or the exported data file does not exists. |
Database* Sparksee::RestoreEncryptedBackup | ( | const std::wstring & | path, |
const std::wstring & | backupFile, | ||
const std::wstring & | keyInHex, | ||
const std::wstring & | ivInHex | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Restores a Database from an encrypted backup file.
See the Graph class EncryptedBackup method.
path | [in] Database storage file. |
backupFile | [in] The Backup file to be restored. |
keyInHex | [In] The AES encryption Key of the backup file as an hexadecimal string (8, 16 or 32 bytes). |
ivInHex | [In] The AES Initialization Vector of the backup file as an hexadecimal string (16 bytes). |
FileNotFoundException | If the given file cannot be created, or the exported data file does not exists. |
Database* Sparksee::RestoreEncryptedBackup | ( | const std::wstring & | path, |
const std::wstring & | backupFile, | ||
const SparkseeConfig & | config, | ||
const std::wstring & | keyInHex, | ||
const std::wstring & | ivInHex | ||
) | |||
throw | ( | sparksee::gdb::FileNotFoundException, | |
sparksee::gdb::Error | |||
) |
Restores a Database from an encrypted backup file.
See the Graph class EncryptedBackup method.
path | [in] Database storage file. |
backupFile | [in] The Backup file to be restored. |
config | [in] Use a specific configuration instead of the one in this Sparksee |
keyInHex | [In] The AES encryption Key of the backup file as an hexadecimal string (8, 16 or 32 bytes). |
ivInHex | [In] The AES Initialization Vector of the backup file as an hexadecimal string (16 bytes). |
FileNotFoundException | If the given file cannot be created, or the exported data file does not exists. |
void Sparksee::SetUnrecoverableErrorCallback | ( | SPARKSEE_UNRECOVERABLE_ERR_CALLBACK | callback | ) |
Sets the unrecoverable error callback.
callback | The unrecoverable error callback to set |
bool_t Sparksee::VerifyChecksums | ( | const std::wstring & | path | ) | |
throw | ( | sparksee::gdb::FileNotFoundException, | |||
sparksee::gdb::Error | |||||
) |
Verifies the Checksum integrity of the given image file and it's recovery log file.
The main database file checksums are always checked.
When the recovery log file exists, the recovery log file is also checked for checksum and format errors.
When the checksums of the main file or the recovery file are incorrect, the funcion returns false, in any other error it throws an exception.
Any error found is logged as a WARNING.
path | The path to the image file |
sparksee::gdb::FileNotFoundException | |
sparksee::gdb::Error |