Class JaversSnapshotScheduler

java.lang.Object
org.qubership.atp.ram.history.job.JaversSnapshotScheduler

@Service public class JaversSnapshotScheduler extends Object
  • Constructor Details

    • JaversSnapshotScheduler

      public JaversSnapshotScheduler()
  • Method Details

    • run

      @Scheduled(cron="${atp.archive.cron.expression}", zone="UTC") public void run()
      Job that removes irrelevant data from the change history.
    • findCdoIdAndCount

      public List<JaversCountResponse> findCdoIdAndCount(List<String> listOfCdoId)
      Get list of unique cdoId with number of objects with this cdoId.
      Returns:
      List of JaversCountResponse.
    • findOldObjects

      public List<JaversVersionsResponse> findOldObjects(JaversCountResponse response)
      Get old cdo objects.
      Parameters:
      response - object with cdo id and versions.
      Returns:
      List of JaversVersionsResponse.
    • findObjectWithMinVersion

      public Long findObjectWithMinVersion(JaversCountResponse response, List<JaversVersionsResponse> oldObjects)
      Get cdo object with min version.
      Returns:
      JaversVersionsResponse.
    • deleteByCdoIdAndVersions

      public void deleteByCdoIdAndVersions(String cdoId, List<Long> versions)
      Delete old cdo objects by cdo id and version.
      Parameters:
      cdoId - cdo id.
      versions - List of Long with old versions.
    • updateObjectAsInitial

      public void updateObjectAsInitial(String cdoId, Long version)
      Update the oldest cdo object as initial object.
      Parameters:
      cdoId - cdo id.
      version - the oldest version.
    • findTerminatedCdoId

      public List<String> findTerminatedCdoId()
      Get terminated cdo ids.
      Returns:
      List of String of terminated ids.
    • deleteTerminatedSnapshots

      public void deleteTerminatedSnapshots()
      Delete terminated objects.
    • execute

      @Transactional public void execute(JaversCountResponse response)
      Delete old versions.