Class RestoreJobExecutionListener

java.lang.Object
org.duracloud.snapshot.service.impl.RestoreJobExecutionListener
All Implemented Interfaces:
org.springframework.batch.core.JobExecutionListener

@Component("restoreJobListener") public class RestoreJobExecutionListener extends Object implements org.springframework.batch.core.JobExecutionListener
Author:
Erik Paulsson Date: 2/10/14
  • Constructor Details

    • RestoreJobExecutionListener

      public RestoreJobExecutionListener()
  • Method Details

    • setNotificationManager

      public void setNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)
      Parameters:
      notificationManager - the notificationManager to set
    • setRestorationRepo

      public void setRestorationRepo(RestoreRepo restoreRepo)
      Parameters:
      restoreRepo - the restoreRepo to set
    • setSnapshotTaskClientHelper

      public void setSnapshotTaskClientHelper(SnapshotTaskClientHelper snapshotTaskClientHelper)
      Parameters:
      snapshotTaskClientHelper - the snapshotTaskClientHelper to set
    • setBridgeConfig

      public void setBridgeConfig(BridgeConfiguration bridgeConfig)
      Parameters:
      bridgeConfig - the bridgeConfig to set
    • init

      public void init(ExecutionListenerConfig config, int daysToExpire)
    • beforeJob

      @Transactional public void beforeJob(org.springframework.batch.core.JobExecution jobExecution)
      Specified by:
      beforeJob in interface org.springframework.batch.core.JobExecutionListener
    • afterJob

      @Transactional public void afterJob(org.springframework.batch.core.JobExecution jobExecution)
      Specified by:
      afterJob in interface org.springframework.batch.core.JobExecutionListener
    • getExpirationDate

      protected Date getExpirationDate(Date endDate, int daysToExpire)
      Calculates the restore expiration date based on the restoration end date and the number of days before retirement
      Parameters:
      endDate - date on which the restoration completed
      daysToExpire - number of days the restored content should stay in place before it is retired
      Returns:
      expiration date of restored content