Interface IGitIntegrationStrategy

  • All Known Implementing Classes:
    BranchFilteredIntegrationStrategy, TransitionFilteredIntegrationStrategy

    public interface IGitIntegrationStrategy
    Snapshot Git integration strategy. Determines when snapshots shall be created or restored.
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • wantCreateSnapshot

        boolean wantCreateSnapshot​(IGitBoundProjectStateDelta delta,
                                   ISnapshotLocationProvider locationProvider)
        Tests whether it is desired to create a snapshot on the given Git-associated project state transition.
        Parameters:
        delta - the Git-associated project state delta, never null
        locationProvider - , the snapshot location provider, never null
        Returns:
        true if the snapshot creation is desired
      • wantRestoreSnapshot

        boolean wantRestoreSnapshot​(IGitBoundProjectStateDelta delta,
                                    ISnapshotLocationProvider locationProvider)
        Tests whether it is desired to restore a snapshot on the given Git-associated project state transition.
        Parameters:
        delta - the Git-associated project state delta, never null
        locationProvider - , the snapshot location provider, never null
        Returns:
        true if the snapshot restoration is desired
      • shallKeepSnapshot

        boolean shallKeepSnapshot​(org.eclipse.core.resources.IProject project,
                                  org.eclipse.jgit.lib.Repository repo,
                                  org.eclipse.jgit.lib.ObjectId revision)
        Tests whether a snapshot may be required in future. The snapshot is referred to by a project and commit.

        This method is used for garbage collection purposes and does not affect snapshot creation or restoration.

        Parameters:
        project - the project, never null
        repo - the repository, associated with the project, never null
        revision - SHA-1 of the commit, never null
        Returns:
        true if the snapshot shall be kept, false otherwise
      • requestUserApproval

        boolean requestUserApproval​(SnapshotGitRequest[] requests)
        Requests user approval of a snapshot operation consisting of the given requests.
        Parameters:
        requests - the requests, never null
        Returns:
        true if a user approved the operation, false otherwise