private void delete(List<PurgeableSnapshotDto> snapshots, DbSession session) {
   for (PurgeableSnapshotDto snapshot : snapshots) {
     LOG.debug(
         "<- Delete snapshot: {} [{}]",
         DateUtils.formatDateTime(snapshot.getDate()),
         snapshot.getSnapshotId());
     purgeDao.deleteSnapshots(
         PurgeSnapshotQuery.create().setRootSnapshotId(snapshot.getSnapshotId()), session);
     purgeDao.deleteSnapshots(
         PurgeSnapshotQuery.create().setId(snapshot.getSnapshotId()), session);
   }
 }
예제 #2
0
 public static PurgeableSnapshotDto createSnapshotWithDateTime(long snapshotId, String datetime) {
   PurgeableSnapshotDto snapshot = new PurgeableSnapshotDto();
   snapshot.setSnapshotId(snapshotId);
   snapshot.setDate(DateUtils.parseDateTime(datetime));
   return snapshot;
 }