Interface ISnapshotManager


  • public interface ISnapshotManager
    Snapshot manager. Controls metadata snapshot creation and restoration.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void createMetadataSnapshot​(org.eclipse.core.resources.IProject project, Path targetPath, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Creates metadata snapshot for the project.
      void restoreMetadataFromSnapshot​(org.eclipse.core.resources.IProject project, Path snapshotPath, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Restores metadata for the projects from snapshot.
      void validateMetadataSnapshot​(org.eclipse.core.resources.IProject project, Path snapshotPath)
      Validates metadata snapshot.
    • Method Detail

      • createMetadataSnapshot

        void createMetadataSnapshot​(org.eclipse.core.resources.IProject project,
                                    Path targetPath,
                                    org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Creates metadata snapshot for the project.

        Cancellation is supported.

        Parameters:
        project - the project for which metadata snapshot is created, cannot be null
        targetPath - the snapshot file, cannot be null
        progressMonitor - the progress monitor, cannot be null
        Throws:
        SnapshotWriteException - if an IO exception or some other error occurs
      • restoreMetadataFromSnapshot

        void restoreMetadataFromSnapshot​(org.eclipse.core.resources.IProject project,
                                         Path snapshotPath,
                                         org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Restores metadata for the projects from snapshot.

        Operation cannot be cancelled.

        Parameters:
        project - the project for which metadata is restored, cannot be null
        snapshotPath - the snapshot file, cannot be null
        progressMonitor - the progress monitor, cannot be null
        Throws:
        SnapshotCorruptedException - if the snapshot is corrupted
        SnapshotVersionMismatchException - if the format version of the snapshot is not supported by this application
        SnapshotReadException - if an IO exception or some other error occurs
      • validateMetadataSnapshot

        void validateMetadataSnapshot​(org.eclipse.core.resources.IProject project,
                                      Path snapshotPath)
        Validates metadata snapshot. The following checks are performed:
        • The archive descriptor can be read and parsed.
        • The snapshot format version matches the current version.
        • The format version of every snapshot participant, which contributed to the snapshot, matches the current version of that participant.
        If any check fails, an appropriate exception is thrown.
        Parameters:
        project - the project for which the snapshot is validated, cannot be null
        snapshotPath - the snapshot file, cannot be null
        Throws:
        SnapshotCorruptedException - if the snapshot is corrupted
        SnapshotVersionMismatchException - if the format version of the snapshot is not supported by this application
        SnapshotReadException - if an IO exception or some other error occurs