Sparksee  6.0.2
STSSparksee Class Reference

Sparksee class. More...

Inheritance diagram for STSSparksee:
Inheritance graph
Collaboration diagram for STSSparksee:
Collaboration graph

Instance Methods

(id) - initWithConfig:
 Creates a new instance. More...
 
(STSDatabase *) - create:alias:
 Creates a new Database instance. More...
 
(STSDatabase *) - createWithConfig:alias:config:
 Creates a new Database instance. More...
 
(STSDatabase *) - open:readOnly:
 Opens an existing Database instance. More...
 
(STSDatabase *) - openWithConfig:readOnly:config:
 Opens an existing Database instance. More...
 
(STSDatabase *) - restore:backupFile:
 Restores a Database from a backup file. More...
 
(STSDatabase *) - restoreWithConfig:backupFile:config:
 Restores a Database from a backup file. More...
 
(STSDatabase *) - restoreEncryptedBackup:backupFile:keyInHex:ivInHex:
 Restores a Database from an encrypted backup file. More...
 
(STSDatabase *) - restoreEncryptedBackupWithConfig:backupFile:config:keyInHex:ivInHex:
 Restores a Database from an encrypted backup file. More...
 
(BOOL) - verifyChecksums:
 Verifies the Checksum integrity of the given image file and it's recovery log file. More...
 
(BOOL) - addChecksums:
 Converts a database WITHOUT checksums into a database WITH checksums. More...
 
(BOOL) - removeChecksums:
 Converts a database WITH checksums into a database WITHOUT checksums. More...
 
(BOOL) - encrypt:
 Converts a database WITHOUT encryption into an encrypted database. More...
 
(BOOL) - decrypt:
 Converts a database WITH encryption into a database WITHOUT encryption. More...
 
(void) - resizeInMemoryPool:
 Resizes the in memory pool allocator. More...
 
(long long) - getInMemoryPoolCapacity
 Gets the capacity of the in-memory pool (in Megabytes) More...
 
(void) - close
 Closes the Sparksee instance.
 
(BOOL) - isClosed
 Check if the Sparksee instance is closed.
 

Class Methods

(NSString *) + getVersion
 Sparksee version.
 

Detailed Description

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.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Method Documentation

- (BOOL) addChecksums: (NSString *)  path

Converts a database WITHOUT checksums into a database WITH checksums.

Any error found is logged. The database (and it's recovery log if present) does NOT have checksums. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the checksum could be added or false otherwise.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionnull
- (STSDatabase*) create: (NSString *)  path
alias: (NSString *)  alias 

Creates a new Database instance.

Parameters
path[in] Database storage file.
alias[in] Database alias name.
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created.
- (STSDatabase*) createWithConfig: (NSString *)  path
alias: (NSString *)  alias
config: (STSSparkseeConfig *)  config 

Creates a new Database instance.

Parameters
path[in] Database storage file.
alias[in] Database alias name.
config[in] Use a specific configuration instead of the one in this Sparksee
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created.
- (BOOL) decrypt: (NSString *)  path

Converts a database WITH encryption into a database WITHOUT encryption.

Any error found is logged. The database (and it's recovery log if present) is encrypted. The current encryption had been configured using SparkseeConfig. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the database could be unencrypted. The errors are returned with an exception.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionnull
- (BOOL) encrypt: (NSString *)  path

Converts a database WITHOUT encryption into an encrypted database.

Any error found is logged. The database (and it's recovery log if present) does is NOT encrypted. The encryption had already been configured using SparkseeConfig. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the database could be encrypted. The errors are returned with an exception.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionnull
- (long long) getInMemoryPoolCapacity

Gets the capacity of the in-memory pool (in Megabytes)

Returns
Returns the capacity of the in memory pool
- (id) initWithConfig: (STSSparkseeConfig *)  config

Creates a new instance.

Parameters
config[in/out] Sparksee configuration (may be updated).
- (STSDatabase*) open: (NSString *)  path
readOnly: (BOOL)  readOnly 

Opens an existing Database instance.

Parameters
path[in] Database storage file.
readOnly[in] If TRUE, open Database in read-only mode.
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file does not exist.
- (STSDatabase*) openWithConfig: (NSString *)  path
readOnly: (BOOL)  readOnly
config: (STSSparkseeConfig *)  config 

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.

Parameters
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
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file does not exist.
- (BOOL) removeChecksums: (NSString *)  path

Converts a database WITH checksums into a database WITHOUT checksums.

Any error found is logged. The database (and it's recovery log if present) have checksums. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the checksum could be removed. The errors are returned with an exception.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionnull
- (void) resizeInMemoryPool: (long long)  newCapacity

Resizes the in memory pool allocator.

Parameters
newCapacityThe new capacity of the in memory pool allocator
Returns
Returns true if was successful
Exceptions
System.SystemExceptionnull
- (STSDatabase*) restore: (NSString *)  path
backupFile: (NSString *)  backupFile 

Restores a Database from a backup file.

See the Graph class Backup method.

Parameters
path[in] Database storage file.
backupFile[in] The Backup file to be restored.
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created, or the exported data file does not exists.
- (STSDatabase*) restoreEncryptedBackup: (NSString *)  path
backupFile: (NSString *)  backupFile
keyInHex: (NSString *)  keyInHex
ivInHex: (NSString *)  ivInHex 

Restores a Database from an encrypted backup file.

See the Graph class EncryptedBackup method.

Parameters
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).
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created, or the exported data file does not exists.
- (STSDatabase*) restoreEncryptedBackupWithConfig: (NSString *)  path
backupFile: (NSString *)  backupFile
config: (STSSparkseeConfig *)  config
keyInHex: (NSString *)  keyInHex
ivInHex: (NSString *)  ivInHex 

Restores a Database from an encrypted backup file.

See the Graph class EncryptedBackup method.

Parameters
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).
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created, or the exported data file does not exists.
- (STSDatabase*) restoreWithConfig: (NSString *)  path
backupFile: (NSString *)  backupFile
config: (STSSparkseeConfig *)  config 

Restores a Database from a backup file.

See the Graph class Backup method.

Parameters
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
Returns
A Database instance.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionIf the given file cannot be created, or the exported data file does not exists.
- (BOOL) verifyChecksums: (NSString *)  path

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.

sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the image file
Returns
Returns true if the checksum verification succeeded. Returns false if an invalid checksum was detected.
Exceptions
System.ApplicationExceptionnull
System.IO.IOExceptionnull

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