FLAIM: F_Restore Class Reference

- Main Page
- Modules
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# F_Restore Class Reference

This is an abstract base class for reading backup data during a FlmDbRestore() operation. More...

`#include <flaim.h>`

List of all members.

## Public Member Functions
virtual RCODE | openBackupSet (void)=0
| FlmDbRestore() calls this method to give the application an opportunity to open the backup media, if needed.
virtual RCODE | openIncFile (FLMUINT uiIncBackupSeqNum)=0
| FlmDbRestore() calls this method to tell the application to open an incremental backup.
virtual RCODE | openRflFile (FLMUINT uiRFLFileNum)=0
| FlmDbRestore() calls this method to tell the application to open an RFL file that it wants to replay to recover transactions.
virtual RCODE | read (FLMUINT uiLength, void *pvBuffer, FLMUINT *puiBytesRead)=0
| Read data from the current file.
virtual RCODE | close (void)=0
| Close the current file.
virtual RCODE | abortFile (void)=0
| Abort the current file.
virtual RCODE | processUnknown (F_UnknownStream *pUnkStrm)=0
| Process an "unknown" object that was encountered while reading an RFL file.
virtual RCODE | status (eRestoreStatusType eStatusType, FLMUINT uiTransId, void *pvValue1, void *pvValue2, void *pvValue3, eRestoreActionType *peRestoreAction)=0
| FlmDbRestore() calls this method to report restore progress.

## Detailed Description

This is an abstract base class for reading backup data during a FlmDbRestore() operation.

This class must be implemented by an application. The FlmDbRestore() function calls methods of this class to read backup data from the backup medium. This object and the write callback function of FlmDbBackup() (see its fnWrite parameter) allow an application to have complete control over writing and reading of backup data. Backup data could be streamed directly to a tape device, or any other media the application chooses.

## Member Function Documentation

virtual RCODE F_Restore::abortFile | ( | void |  | ) | `[pure virtual]`

| Abort the current file. The current "file" will either be the regular backup file set, an incremental backup, or an RFL file. The action to be taken by the application is similar to what it should do for a call to the F_Restore::close() method. The subtle distinction lies in the fact that FlmDbRestore() encountered some kind of error and may want to retry. For most implementations, it will be sufficient to simply call the F_Restore::close() method from within this method.

virtual RCODE F_Restore::close | ( | void |  | ) | `[pure virtual]`

| Close the current file. The current "file" will either be the regular backup file set, an incremental backup, or an RFL file.

virtual RCODE F_Restore::openBackupSet | ( | void |  | ) | `[pure virtual]`

| FlmDbRestore() calls this method to give the application an opportunity to open the backup media, if needed. Subsequent calls to the F_Restore::read() method should return data from the backup that is being restored. When FlmDbRestore() is done reading from the backup set, it will call the F_Restore::close() method.

virtual RCODE F_Restore::openIncFile | ( | FLMUINT | uiIncBackupSeqNum | ) | `[pure virtual]`

  | FlmDbRestore() calls this method to tell the application to open an incremental backup. FlmDbRestore() attempts to restore incremental backups after it is finished restoring the regular (non-incremental backup). It will restore incremental backups until this method returns RCODE::FERR_IO_PATH_NOT_FOUND. This method should return RCODE::FERR_IO_PATH_NOT_FOUND if the requested incremental backup does not exist, or if it does not want FlmDbRestore() to restore any more incremental backups. If this method returns FERR_OK, subsequent calls to the F_Restore::read() method are expected to return data from the incremental backup. When FlmDbRestore() is done reading from the incremental backup, it will call the F_Restore::close() method. Parameters:
  uiIncBackupSeqNum | Sequence number of incremental backup that is to be opened.

virtual RCODE F_Restore::openRflFile | ( | FLMUINT | uiRFLFileNum | ) | `[pure virtual]`

  | FlmDbRestore() calls this method to tell the application to open an RFL file that it wants to replay to recover transactions. FlmDbRestore() attempts to restore RFL files after it is finished restoring the regular backup and any incremental backups. It will restore RFL files until this method returns RCODE::FERR_IO_PATH_NOT_FOUND. This method should return RCODE_FERR_IO_PATH_NOT_FOUND if the requested RFL file file does not exist, or if it does not want FlmDbRestore() to restore any more RFL files. If this method returns FERR_OK, subsequent calls to the F_Restore::read() method are expected to return data from the RFL file. When FlmDbRestore() is done reading from the RFL file, it will call the F_Restore::close() method. Parameters:
  uiRFLFileNum | Sequence number of RFL file that is to be opened.

virtual RCODE F_Restore::processUnknown | ( | F_UnknownStream * | pUnkStrm | ) | `[pure virtual]`

  | Process an "unknown" object that was encountered while reading an RFL file. When FlmDbRestore calls this method, it passes an F_UnknownStream object to the application, which allows the application to read the unknown data from the RFL file and process it as needed. Unknown data in the RFL file is data put there by the application as part of a transaction. It is generally data that is in some way associated with data in the database, but is not actually stored in the database. Even though it is not stored in the database, it is desireable to restore it during a FlmDbRestore() operation. Parameters:
  pUnkStrm | Object that allows the application to read the unknown data.

virtual RCODE F_Restore::read | ( | FLMUINT | uiLength,
|  | void * | pvBuffer,
|  | FLMUINT * | puiBytesRead
| ) | `[pure virtual]`

  | Read data from the current file. The current "file" will either be the regular backup file set, an incremental backup, or an RFL file. Parameters:
  uiLength | Number of bytes of data to read.
  pvBuffer | Buffer to place read data into.
  puiBytesRead | Returns the actual number of bytes read.

virtual RCODE F_Restore::status | ( | eRestoreStatusType | eStatusType,
|  | FLMUINT | uiTransId,
|  | void * | pvValue1,
|  | void * | pvValue2,
|  | void * | pvValue3,
|  | eRestoreActionType * | peRestoreAction
| ) | `[pure virtual]`

  | FlmDbRestore() calls this method to report restore progress. An application may abort the database restore operation by returning RESTORE_ACTION_STOP in *puiAction. Parameters:
  eStatusType | Restore status types.
  uiTransId | Transaction id of RFL operation being restored.
  pvValue1 | Value for RFL operation being restored - details defined for each eRestoreStatusType.
  pvValue2 | Value for RFL operation being restored - details defined for each eRestoreStatusType.
  pvValue3 | Value for RFL operation being restored - details defined for each eRestoreStatusType.
  peRestoreAction | Action the application wants FlmDbRestore() to take.