AutoArchive._services.archiver — AutoArchive Developer Manual (ver. 1.0.4)

# AutoArchive._services.archiver

Archiver Service Component.

Provides services for creating the backup.

## Modules

### archiver_service_creator

`ArchiverServiceProviders` enum and `ArchiverServiceCreator` class.

class `AutoArchive._services.archiver.archiver_service_creator.` `ArchiverServiceCreator`

  Bases: `object`

  Creator of archiver service instances.

  classmethod `destroyServices`()

    Removes all existing archiver service instances.

    Existing instances of all services will be forgotten. Subsequent request to `getOrCreateArchiverService()` will result in creation of a new instance.

  classmethod `getOrCreateArchiverService`(archiverServiceProvider, workDir)

    Gets existing or creates the new archiver service instance.

    See also: `destroyServices()`.

    Parameters: | archiverServiceProvider (`ArchiverServiceProviders`) – The requested service provider. workDir (`str`) – Path to a directory which can be used to persistently store data.
    Returns: | Instance of an archiver service.
    Return type: | `IArchiver`
    Raises: | RuntimeError – If creation of the service provider failed.

  classmethod `getSupportedBackupTypes`(archiverServiceProvider)

    Returns a set of backup types supported by the given archiver service provider.

    Parameters: | archiverServiceProvider (`ArchiverServiceProviders`) – Service provider for which the backup types shall be returned.
    Returns: | Set of supported backup types.
    Return type: | `set<BackupTypes>`

  classmethod `getSupportedFeatures`(archiverServiceProvider, backupType=None)

    Returns a set of features supported by the given archiver service provider.

    Parameters: | archiverServiceProvider (`ArchiverServiceProviders`) – Service provider for which the backup types shall be returned. backupType (`BackupTypes`) – The backup type for which the features shall be returned or `None` if all supported features shall be returned.
    Returns: | Set of supported features.
    Return type: | `set<ArchiverFeatures>`
    Raises: | ValueError – If the given `backupType` is not supported by the `archiverServiceProvider`

### _tar_archiver_provider_base

`_TarArchiverProviderBase` class.

class `AutoArchive._services.archiver._tar_archiver_provider_base.` `_TarArchiverProviderBase`(workDir)

  Bases: `AutoArchive._archiving.iarchiver.IArchiver`

  Base class for tar archiver service providers.

  Abstract constructor of this class, should be called from derived constructors. It initializes the `workDir_` property.

  Parameters: | workDir (`str`) – Path to a writable directory. The service will use it as persistent storage.

  `backupFiles`(backupDefinition, compressionStrength=None)

    Performs basic checks before the backup creation.

    Note

    Derived classes should call this base method on the beginning of the overridden method.

    See also: `IArchiver.backupFiles()`.

  `backupFilesIncrementally`(backupDefinition, compressionStrength=None, level=None)

    Performs basic checks before the incremental backup creation.

    Note

    Derived classes should call this base method on the beginning of the overridden method.

    See also: `IArchiver.backupFilesIncrementally()`.

  static `getBackupFilePath_`(backupId, backupType, destination, level=None)

    Assembles the backup file name and returns a path to it.

    Parameters: | backupId (`str`) – ID of the backup for which the path shall be returned. backupType (`BackupTypes`) – Type of the backup. destination (`str`) – Path to the directory where the to the backup shall be created. level (`int`) – Backup level.
    Returns: | Path to the backup file.
    Return type: | `str`

  `getMaxBackupLevel`(backupId)

    See: `IArchiver.getMaxBackupLevel()`.

  `getStoredBackupIds`()

    See: `IArchiver.getMaxBackupLevel()`.

  classmethod `getSupportedFeatures`(backupType=None)

    See: `IArchiver.getSupportedFeatures()`.

  classmethod `getWorkingPath_`(properPath)
  `purgeStoredBackupData`(backupId)

    See: `IArchiver.purgeStoredBackupData()`.

  classmethod `raiseIfUnsupportedBackupType_`(backupType)

    Raises an exception if the passed `backupType` is not supported by the implementation.

    See also: `IArchiver.supportedBackupTypes`.

    Parameters: | backupType (`BackupTypes`) – The backup type that shall be checked.
    Raises: | ValueError – If the passed `backupType` is not supported by the concrete implementation.

  classmethod `raiseIfUnsupportedFeature_`(backupType, compressionStrength=None, level=None)
  `removeBackup`(backupDefinition)

    See: `IArchiver.removeBackup()`.

  `removeBackupIncrements`(backupDefinition, level=None)

    See: `IArchiver.removeBackupIncrements()`.

  `backupOperationError` = <AutoArchive._py_additions.event object>
  `fileAdd` = <AutoArchive._py_additions.event object>
  `workDir_`

    Gets path to the working directory.

    Return type: | `str`

### _external_tar_archiver_provider

`_ExternalTarArchiverProvider` class.

class `AutoArchive._services.archiver._external_tar_archiver_provider.` `_ExternalTarArchiverProvider`(workDir)

  Bases: `AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBase`

  External archiver service provider.

  See also: `_TarArchiverProviderBase`.

  Raises: | OSError – If creation of the snapshot directory failed.

  `backupFiles`(backupDefinition, compressionStrength=None)

    See: `_TarArchiverProviderBase.backupFiles()`.

  `backupFilesIncrementally`(backupDefinition, compressionStrength=None, level=None)

    See: `_TarArchiverProviderBase.backupFilesIncrementally()`.

  `getMaxBackupLevel`(backupId)

    See: `_TarArchiverProviderBase.getMaxBackupLevel()`.

  `getStoredBackupIds`()

    See: `_TarArchiverProviderBase.getStoredBackupIds()`.

  classmethod `getSupportedFeatures`(backupType=None)

    See: `_TarArchiverProviderBase.getSupportedFeatures()`.

  `purgeStoredBackupData`(backupId)

    See: `_TarArchiverProviderBase.purgeStoredBackupData()`.

  `removeBackupIncrements`(backupDefinition, level=None)

    See: `_TarArchiverProviderBase.removeBackupIncrements()`.

  `supportedBackupTypes` = frozenset({0, 1, 2, 3})

### _internal_tar_archiver_provider

`_InternalTarArchiverProvider` class.

class `AutoArchive._services.archiver._internal_tar_archiver_provider.` `_InternalTarArchiverProvider`(workDir)

  Bases: `AutoArchive._services.archiver._tar_archiver_provider_base._TarArchiverProviderBase`

  Internal archiver service provider.

  See also: `_TarArchiverProviderBase`.

  `backupFiles`(backupDefinition, compressionStrength=None)

    See: `_TarArchiverProviderBase.backupFiles()`.

  `backupFilesIncrementally`(backupDefinition, compressionStrength=None, level=None)

    See: `_TarArchiverProviderBase.backupFilesIncrementally()`.

  classmethod `getSupportedFeatures`(backupType=None)

    See: `_TarArchiverProviderBase.getSupportedFeatures()`.

  `supportedBackupTypes` = frozenset({0, 1, 2})