Class SnapshotGarbageCollectionService

java.lang.Object
com.e1c.g5.v8.dt.internal.snapshot.integration.git.SnapshotGarbageCollectionService
All Implemented Interfaces:
IManagedService

public class SnapshotGarbageCollectionService extends Object implements IManagedService
Removes snapshots when they become unnecessary. This happens in three cases:
  1. There are not branches pointing to the associated commit left.
  2. The project for which the snapshot was created is deleted.
  3. The removal is triggered externally with #removeNeedlessSnapshots(BiPredicate).
  • Constructor Details

    • SnapshotGarbageCollectionService

      public SnapshotGarbageCollectionService()
  • Method Details

    • activate

      public void activate()
      Specified by:
      activate in interface IManagedService
    • deactivate

      public void deactivate()
      Specified by:
      deactivate in interface IManagedService
    • removeNeedlessSnapshots

      public void removeNeedlessSnapshots(String reason, BiPredicate<org.eclipse.core.resources.IProject,org.eclipse.jgit.lib.ObjectId> shallKeepSnapshot)
      Schedules removing of needless snapshots according to the given predicate.
      Parameters:
      shallKeepSnapshot - the predicate to test if a snapshot shall be kept, cannot be null