Interface Backupable

  • All Known Subinterfaces:
    Storage
    All Known Implementing Classes:
    BackendImpl, JEBackend, JEStorage, LDIFBackend, SchemaBackend, TaskBackend

    public interface Backupable
    This interface must be implemented by backends that support backup and restore. This is designed for backends containing all the data files in the same directory, sub-directories are not supported.
    • Method Detail

      • getDirectory

        Path getDirectory()
        Returns the directory containing all the backend files to be backed up.
        Returns:
        the directory containing all the backend files to be backed up.
      • getBackendFiles

        BackupManager.CountedIterator<BackendFile> getBackendFiles()
                                                            throws IOException
        Returns an iterator that goes over all the backend files. The iterator may return deleted files, such files must be ignored during iteration.
        Returns:
        A backend file iterator.
        Throws:
        IOException - If there is an error when trying to find the backend files.
      • getBackendID

        String getBackendID()
        Returns the backend name.
        Returns:
        the backend name.
      • beforeBackup

        default void beforeBackup()
        Performs any necessary processing before a backup is performed. For example, this can take a shared lock or flush out a memory cache to backend files or delete stale data files.
      • afterBackup

        default void afterBackup()
        Performs any necessary processing after a backup is performed. This method is called even if backup has failed. For example, this can release a shared lock.
      • beforeRestore

        default void beforeRestore()
        Performs any necessary processing before a restore is performed. For example, this can take an exclusive lock.
      • afterRestore

        default void afterRestore()
                           throws InitializationException
        Performs any necessary processing after a restore is performed. This method is called even if restore has failed. For example, this can release an exclusive lock or load the restored files into memory.
        Throws:
        InitializationException - If an error occurs.