Class JaversSnapshotService

java.lang.Object
org.qubership.atp.dataset.db.jpa.JaversSnapshotService

@Service public class JaversSnapshotService extends Object
  • Constructor Details

  • Method Details

    • findGlobalIdAndCount

      public List<JaversCountResponse> findGlobalIdAndCount(Long lastRevisionCount)
      Get globalId and number of old objects.
      Parameters:
      lastRevisionCount - number of the last revisions.
      Returns:
      List of JaversCountResponse
    • findOldSnapshots

      public List<JvSnapshotEntity> findOldSnapshots(Long globalId, Long count)
      Get old snapshots by globalId and count.
      Parameters:
      globalId - globalId
      count - count
      Returns:
      List of JvSnapshotEntity
    • findTheOldestSnapshotByGlobalIdAndUpdateTypeAsInitial

      public JvSnapshotEntity findTheOldestSnapshotByGlobalIdAndUpdateTypeAsInitial(Long globalId)
      Get the oldest snapshot and update snapshot type with INITIAL value.
      Parameters:
      globalId - globalId
      Returns:
      JvSnapshotEntity entity;
    • deleteOldAndUpdateAsInitial

      @Transactional(rollbackFor=java.lang.Exception.class) public void deleteOldAndUpdateAsInitial(Long globalId, List<JvSnapshotEntity> snapshots)
      Delete old snapshots, commit properties and commits. And update the oldest snapshot as initial.
      Parameters:
      globalId - globalId
      snapshots - old snapshots
    • deleteTerminatedSnapshots

      @Transactional(rollbackFor=java.lang.Exception.class) public void deleteTerminatedSnapshots()
      Delete terminated snapshots, globalIds, commits and commit properties.