Class BackupManagerImpl

    • Field Detail

      • LOG

        protected static final org.exoplatform.services.log.Log LOG
      • DEFAULT_INCREMENTAL_JOB_PERIOD

        public static final String DEFAULT_INCREMENTAL_JOB_PERIOD
        Name of default incremental job period parameter in configuration.
        See Also:
        Constant Field Values
      • BACKUP_PROPERTIES

        public static final String BACKUP_PROPERTIES
        Name of backup properties parameter in configuration.
        See Also:
        Constant Field Values
      • FULL_BACKUP_TYPE

        public static final String FULL_BACKUP_TYPE
        Name of full backup type parameter in configuration.
        See Also:
        Constant Field Values
      • INCREMENTAL_BACKUP_TYPE

        public static final String INCREMENTAL_BACKUP_TYPE
        Name of incremental backup type parameter in configuration.
        See Also:
        Constant Field Values
      • DEFAULT_VALUE_INCREMENTAL_JOB_PERIOD

        public static final String DEFAULT_VALUE_INCREMENTAL_JOB_PERIOD
        Default value of incremental job period parameter in configuration.
        See Also:
        Constant Field Values
      • DEFAULT_VALUE_INCREMENTAL_BACKUP_TYPE

        public static final String DEFAULT_VALUE_INCREMENTAL_BACKUP_TYPE
        Default value of incremental backup type parameter in configuration.
      • DEFAULT_VALUE_FULL_BACKUP_TYPE

        public static final String DEFAULT_VALUE_FULL_BACKUP_TYPE
        Default value of incremental backup type parameter in configuration.
    • Constructor Detail

      • BackupManagerImpl

        public BackupManagerImpl​(org.exoplatform.container.xml.InitParams initParams,
                                 org.exoplatform.services.jcr.RepositoryService repoService)
        BackupManagerImpl constructor.
        Parameters:
        initParams - InitParams, the init parameters
        repoService - RepositoryService, the repository service
      • BackupManagerImpl

        public BackupManagerImpl​(org.exoplatform.container.ExoContainerContext ctx,
                                 org.exoplatform.container.xml.InitParams initParams,
                                 org.exoplatform.services.jcr.RepositoryService repoService)
        BackupManagerImpl constructor.
        Parameters:
        initParams - InitParams, the init parameters
        repoService - RepositoryService, the repository service
      • BackupManagerImpl

        public BackupManagerImpl​(org.exoplatform.container.xml.InitParams initParams,
                                 org.exoplatform.services.jcr.RepositoryService repoService,
                                 RegistryService registryService)
        BackupManagerImpl constructor. InitParams, the init parameters
        Parameters:
        repoService - RepositoryService, the repository service
        registryService - RegistryService, the registry service
      • BackupManagerImpl

        public BackupManagerImpl​(org.exoplatform.container.ExoContainerContext ctx,
                                 org.exoplatform.container.xml.InitParams initParams,
                                 org.exoplatform.services.jcr.RepositoryService repoService,
                                 RegistryService registryService)
        BackupManagerImpl constructor. InitParams, the init parameters
        Parameters:
        repoService - RepositoryService, the repository service
        registryService - RegistryService, the registry service
    • Method Detail

      • getMessages

        public BackupMessage[] getMessages()
        Getting the backup messages.
        Specified by:
        getMessages in interface BackupManager
        Returns:
        BackupMessage[] return the backup messages
      • startBackup

        public BackupChain startBackup​(BackupConfig config)
                                throws BackupOperationException,
                                       BackupConfigurationException,
                                       javax.jcr.RepositoryException,
                                       org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Starting backup.
        Specified by:
        startBackup in interface BackupManager
        Parameters:
        config - BackupConfig, the backup configuration
        Returns:
        BackupChain return the backup chain
        Throws:
        BackupOperationException - BackupOperationException will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • stopBackup

        public void stopBackup​(BackupChain backup)
        Stop backup.
        Specified by:
        stopBackup in interface BackupManager
        Parameters:
        backup - BackupChain, the backup chain
      • start

        public void start()
        Specified by:
        start in interface org.picocontainer.Startable
      • stop

        public void stop()
        Specified by:
        stop in interface org.picocontainer.Startable
      • findBackup

        public BackupChain findBackup​(String repository,
                                      String workspace)
        Finding current backup by repository and workspace.
        Specified by:
        findBackup in interface BackupManager
        Parameters:
        repository - String, the repository name
        workspace - String, the workspace name
        Returns:
        BackupChain return the current backup
      • findBackup

        public BackupChain findBackup​(String backupId)
        Finding current backup by identifier.
        Specified by:
        findBackup in interface BackupManager
        Parameters:
        backupId - String the backup identifier
        Returns:
        BackupChain return the current backup
      • getBackupDirectory

        public File getBackupDirectory()
        Getting backup directory.
        Specified by:
        getBackupDirectory in interface BackupManager
        Returns:
        File return the backup directory
      • getFullBackupType

        public String getFullBackupType()
        Getting full backup type.
        Specified by:
        getFullBackupType in interface BackupManager
        Returns:
        Sting return FQN to full backup type
      • getIncrementalBackupType

        public String getIncrementalBackupType()
        Getting incremental backup type.
        Specified by:
        getIncrementalBackupType in interface BackupManager
        Returns:
        String return FQN to full backup type
      • getDefaultIncrementalJobPeriod

        public long getDefaultIncrementalJobPeriod()
        Getting default incremental job period.
        Specified by:
        getDefaultIncrementalJobPeriod in interface BackupManager
        Returns:
        long return the default incremental job period
      • getLastRestore

        public JobWorkspaceRestore getLastRestore​(String repositoryName,
                                                  String workspaceName)
        Getting last restore by repository and workspace name.
        Specified by:
        getLastRestore in interface BackupManager
        Parameters:
        repositoryName - String, the repository name
        workspaceName - String, the workspace name
        Returns:
        JobWorkspaceRestore return the job to restore
      • getLastRepositoryRestore

        public JobRepositoryRestore getLastRepositoryRestore​(String repositoryName)
        Getting last repository restore by repository name.
        Specified by:
        getLastRepositoryRestore in interface BackupManager
        Parameters:
        repositoryName - String, the repository name
        Returns:
        JobWorkspaceRestore return the job to restore
      • restore

        public void restore​(BackupChainLog log,
                            String repositoryName,
                            org.exoplatform.services.jcr.config.WorkspaceEntry workspaceEntry,
                            boolean asynchronous)
                     throws BackupOperationException,
                            BackupConfigurationException,
                            javax.jcr.RepositoryException,
                            org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Restore from backup.
        Specified by:
        restore in interface BackupManager
        Parameters:
        log - BackupChainLog, the backup log
        repositoryName - String, repository name
        workspaceEntry - WorkspaceEntry, the workspace entry
        asynchronous - boolean, in 'true' then asynchronous restore.
        Throws:
        BackupOperationException - will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • restore

        public void restore​(RepositoryBackupChainLog log,
                            org.exoplatform.services.jcr.config.RepositoryEntry repositoryEntry,
                            boolean asynchronous)
                     throws BackupOperationException,
                            BackupConfigurationException,
                            javax.jcr.RepositoryException,
                            org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Repository restore from backup.
        Specified by:
        restore in interface BackupManager
        Parameters:
        log - RepositoryBackupChainLog, the repository backup log
        repositoryEntry - RepositoryEntry, the repository entry
        asynchronous - boolean, in 'true' then asynchronous restore.
        Throws:
        BackupOperationException - will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • restore

        public void restore​(RepositoryBackupChainLog log,
                            org.exoplatform.services.jcr.config.RepositoryEntry repositoryEntry,
                            boolean asynchronous,
                            boolean removeJobOnceOver)
                     throws BackupOperationException,
                            BackupConfigurationException,
                            javax.jcr.RepositoryException,
                            org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Repository restore from backup.
        Specified by:
        restore in interface BackupManager
        Parameters:
        log - RepositoryBackupChainLog, the repository backup log
        repositoryEntry - RepositoryEntry, the repository entry
        asynchronous - boolean, in 'true' then asynchronous restore.
        removeJobOnceOver - boolean, in 'true' then restore job well remove after restore.
        Throws:
        BackupOperationException - will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • restore

        public void restore​(RepositoryBackupChainLog rblog,
                            org.exoplatform.services.jcr.config.RepositoryEntry repositoryEntry,
                            Map<String,​String> workspaceNamesCorrespondMap,
                            boolean asynchronous)
                     throws BackupOperationException,
                            BackupConfigurationException,
                            javax.jcr.RepositoryException,
                            org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Repository restore from backup.
        Specified by:
        restore in interface BackupManager
        Parameters:
        rblog - RepositoryBackupChainLog, the repository backup log
        repositoryEntry - RepositoryEntry, the repository entry
        workspaceNamesCorrespondMap - the map with correspondence workspace name in RepositoryEntry and RepositoryBackupChainLog.
        asynchronous - boolean, in 'true' then asynchronous restore.
        Throws:
        BackupOperationException - will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • startBackup

        public RepositoryBackupChain startBackup​(RepositoryBackupConfig config)
                                          throws BackupOperationException,
                                                 BackupConfigurationException,
                                                 javax.jcr.RepositoryException,
                                                 org.exoplatform.services.jcr.config.RepositoryConfigurationException
        Starting repository backup.
        Specified by:
        startBackup in interface BackupManager
        Parameters:
        config - RepositoryBackupConfig, the backup configuration to repository
        Returns:
        RepositoryBackupChain return the repository backup chain
        Throws:
        BackupOperationException - BackupOperationException will be generate the exception BackupOperationException
        BackupConfigurationException - will be generate the exception BackupConfigurationException
        javax.jcr.RepositoryException - will be generate the exception RepositoryException
        org.exoplatform.services.jcr.config.RepositoryConfigurationException - will be generate the exception RepositoryConfigurationException
      • findRepositoryBackup

        public RepositoryBackupChain findRepositoryBackup​(String repository)
        Finding current backup by repository.
        Specified by:
        findRepositoryBackup in interface BackupManager
        Parameters:
        repository - String, the repository name
        Returns:
        RepositoryBackupChain return the current backup to repository
      • findRepositoryBackupId

        public RepositoryBackupChain findRepositoryBackupId​(String backupId)
        Finding current backup by id.
        Specified by:
        findRepositoryBackupId in interface BackupManager
        Parameters:
        backupId - String, the repository name
        Returns:
        RepositoryBackupChain return the current backup to repository
      • restoreExistingRepository

        public void restoreExistingRepository​(String repositoryBackupIdentifier,
                                              org.exoplatform.services.jcr.config.RepositoryEntry repositoryEntry,
                                              boolean asynchronous)
                                       throws BackupOperationException,
                                              BackupConfigurationException
        Restore existing repository. Previous data will be deleted. For getting status of repository restore can use BackupManager.getLastRestore(String repositoryName) method
        Specified by:
        restoreExistingRepository in interface ExtendedBackupManager
        Parameters:
        repositoryBackupIdentifier - backup identifier
        repositoryEntry - new repository configuration
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred
      • restoreExistingWorkspace

        public void restoreExistingWorkspace​(String workspaceBackupIdentifier,
                                             String repositoryName,
                                             org.exoplatform.services.jcr.config.WorkspaceEntry workspaceEntry,
                                             boolean asynchronous)
                                      throws BackupOperationException,
                                             BackupConfigurationException
        Restore existing workspace. Previous data will be deleted. For getting status of workspace restore can use BackupManager.getLastRestore(String repositoryName, String workspaceName) method
        Specified by:
        restoreExistingWorkspace in interface ExtendedBackupManager
        Parameters:
        workspaceBackupIdentifier - backup identifier
        workspaceEntry - new workspace configuration
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred
      • restoreExistingRepository

        public void restoreExistingRepository​(String repositoryBackupIdentifier,
                                              boolean asynchronous)
                                       throws BackupOperationException,
                                              BackupConfigurationException
        Restore existing repository. Previous data will be deleted. For getting status of repository restore can use BackupManager.getLastRestore(String repositoryName) method. ReprositoryEntry for restore should be contains in BackupChainLog.
        Specified by:
        restoreExistingRepository in interface ExtendedBackupManager
        Parameters:
        repositoryBackupIdentifier - identifier to repository backup.
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred
      • restoreExistingWorkspace

        public void restoreExistingWorkspace​(String workspaceBackupIdentifier,
                                             boolean asynchronous)
                                      throws BackupOperationException,
                                             BackupConfigurationException
        Restore existing workspace. Previous data will be deleted. For getting status of workspace restore can use BackupManager.getLastRestore(String repositoryName, String workspaceName) method WorkspaceEntry for restore should be contains in BackupChainLog.
        Specified by:
        restoreExistingWorkspace in interface ExtendedBackupManager
        Parameters:
        workspaceBackupIdentifier - identifier to workspace backup.
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred
      • restoreExistingRepository

        public void restoreExistingRepository​(File repositoryBackupSetDir,
                                              boolean asynchronous)
                                       throws BackupOperationException,
                                              BackupConfigurationException
        Restore existing repository. Previous data will be deleted. For getting status of repository restore can use BackupManager.getLastRestore(String repositoryName) method. ReprositoryEntry for restore should be contains in BackupChainLog.
        Specified by:
        restoreExistingRepository in interface ExtendedBackupManager
        Parameters:
        repositoryBackupSetDir - the directory with backup set
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred
      • restoreExistingWorkspace

        public void restoreExistingWorkspace​(File workspaceBackupSetDir,
                                             boolean asynchronous)
                                      throws BackupOperationException,
                                             BackupConfigurationException
        Restore existing workspace. Previous data will be deleted. For getting status of workspace restore can use BackupManager.getLastRestore(String repositoryName, String workspaceName) method WorkspaceEntry for restore should be contains in BackupChainLog.
        Specified by:
        restoreExistingWorkspace in interface ExtendedBackupManager
        Parameters:
        workspaceBackupSetDir - the directory with backup set
        asynchronous - if 'true' restore will be in asynchronous mode (i.e. in separated thread)
        Throws:
        BackupOperationException - if backup operation exception occurred
        BackupConfigurationException - if configuration exception occurred